if(delay > 0)
delayedCommands = (List<String>) context.getSessionData("delayed-commands");
int cooldown = (Integer) context.getSessionData("cooldown");
boolean cancelAction = (Boolean) context.getSessionData("cancel-action");
boolean consumeSelf = (Boolean) context.getSessionData("consume-self");
TernaryState requireSneaking = (TernaryState) context.getSessionData("require-sneaking");
boolean keepOnDeath = (Boolean) context.getSessionData("keep-on-death");
List<CommandItemAction> actions = new ArrayList<CommandItemAction>();
String missingConsumableMessage = "mech.command-items.need";
String cooldownMessage = "mech.command-items.wait";
CommandItemDefinition def = new CommandItemDefinition(name, stack, type, clickType, permNode, commands.toArray(new String[commands.size()]), delay, delayedCommands.toArray(new String[delayedCommands.size()]), cooldown, cancelAction, consumables.toArray(new ItemStack[consumables.size()]), consumeSelf, requireSneaking, keepOnDeath, actions.toArray(new CommandItemAction[actions.size()]), missingConsumableMessage, cooldownMessage);