Skip to content

[1.12.2] mods.contenttweaker.IItemInteractionForEntity is not recognized #275

@roidrole

Description

@roidrole

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();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions