You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
roidrole
changed the title
[1.12.2] mods.contenttweaker.Item.itemInteractionForEntity is not recognized
[1.12.2] mods.contenttweaker.IItemInteractionForEntity is not recognized
Jul 31, 2023
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.
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 :
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 text was updated successfully, but these errors were encountered: