give(item) zenmethod results in Could not resolve IItemStack error
xkforce opened this issue ยท 2 comments
This code results in a [PREINITIALIZATION][CLIENT][ERROR] contenttweakerfoods.zs:25: Could not resolve <minecraft : gold_ingot>
var nightshade = VanillaFactory.createItemFood("nightshade", 6);
nightshade.saturation = 7.2;
nightshade.maxStackSize = 64;
nightshade.alwaysEdible = true;
nightshade.onItemFoodEaten = function(item, world, player) {
player.give(<minecraft : gold_ingot>);
};
nightshade.register();
This code works but spams the chat:
var nightshade = VanillaFactory.createItemFood("nightshade", 6);
nightshade.saturation = 7.2;
nightshade.maxStackSize = 64;
nightshade.alwaysEdible = true;
nightshade.onItemFoodEaten = function(item, world, player) {
player.executeCommand("give @p minecraft : gold_ingot");
};
nightshade.register();
As far as I can tell, the two lines should be interchangeable but they're not. One works and the other doesn't.
At the time CoT runs, there are no Items yet registered, which is why ZS cannot deduct what <minecraft:gold_ingot>
means, as it has no information that this should be an item.
Replace the Bracket wih <item:minecraft:gold_ingot>
and you should get a onetime information that the item could not be found but is tried to be used anyways.