[1.12.2] mods.contenttweaker.IItemInteractionForEntity is not recognized
roidrole opened this issue ยท 2 comments
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();
The mod wasn't built when the commit adding this functionality was merged in, so the latest version of CF unfortunately does not match the version on GitHub/in the docs. I'll update the docs, but unfortunately there's no way to use this feature until they release a new build on CF.
Docs have been updated per CraftTweaker/CraftTweaker-Documentation#548