-
Notifications
You must be signed in to change notification settings - Fork 19
Description
I am trying to add an item interaction for an entity and it doesn't work. For testing, I used the example script (see below) in the documentation. After loading the game, the chat says "No such member : IItemInteractionForEntity". The item still gets loaded, but it has no right-click action on an entity, which leads me to believe it is an error in the mod itself or, at least, an error in documentation.
Mods loaded :
- base-1.12.2-3.14.0
- ContentTweaker-1.12.2-4.10.0
- CraftTweaker2-1.12-4.20.690
- jei_1.12.2-4.16.1.1003
- RessourceLoader-MC1.12.1-1.5.3
Here is the exmple script :
#loader contenttweaker
import mods.contenttweaker.VanillaFactory;
import mods.contenttweaker.Item;
import mods.contenttweaker.IItemInteractionForEntity;
import crafttweaker.entity.IEntityLivingBase;
var sheep_remover = VanillaFactory.createItem("sheep_remover");
sheep_remover.itemInteractionForEntity = function(stack, player, target, hand) {
if target.definition.id == "minecraft:sheep" {
target.removeFromWorld();
stack.shrink(1);
return true;
}
return false;
};
sheep_remover.register();