Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
roidrole opened this issue Jul 31, 2023 · 2 comments
Open

Comments

@roidrole
Copy link

roidrole commented Jul 31, 2023

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

@roidrole 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
@democat3457
Copy link

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.

@democat3457
Copy link

Docs have been updated per CraftTweaker/CraftTweaker-Documentation#548

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants