Hello, today I am posting this post because I have a problem. Indeed, I would like to make a more or less simple system but on which I have some difficulties. I would like to make sure that when a player clicks on another player with handcuffs (custom item therefore) that the handcuffs go into the breastplate slot where they normally find a piece of armor. The problem is, I can't get the player I clicked on. I would like to go through the "onRightclick" function which we put directly in the class of the item but if that is not possible it does not matter if we go through an event forge. FYI I have already tried both without success. Probably due to my inexperience. Thank you in advance
ElpisII
And PS: I said above that the item should be put in an armor slot. And I know I created a basic item and not an armor so that will have to be thought about.Class where I create the item:
Item class :
public class CloseHandcuffs extends Item implements IHasModel {
public CloseHandcuffs(String name) {
setUnlocalizedName(name);
setRegistryName(name);
setCreativeTab(CreativeTabs.MATERIALS);
ItemInit.ITEMS.add(this);
}
@Override
public void registerModels() {
Main.proxy.registerItemRenderer(this, 0, "inventory");
}
}