diff --git a/src/main/java/ch/njol/skript/command/ScriptCommand.java b/src/main/java/ch/njol/skript/command/ScriptCommand.java index 93e8cad25b0..fdfb1364f17 100644 --- a/src/main/java/ch/njol/skript/command/ScriptCommand.java +++ b/src/main/java/ch/njol/skript/command/ScriptCommand.java @@ -474,7 +474,13 @@ public Date getLastUsage(UUID uuid, Event event) { } else { String name = getStorageVariableName(event); assert name != null; - return (Date) Variables.getVariable(name, null, false); + Object variable = Variables.getVariable(name, null, false); + if (!(variable instanceof Date)) { + Skript.warning("Variable {" + name + "} was not a date! You may be using this variable elsewhere. " + + "This warning is letting you know that this variable is now overridden for the command storage."); + return null; + } + return (Date) variable; } }