I'm trying to make a method to change the pose of a player when interacting with an item but using the method provided by paper does not seem to work.
I'm sure that the code is executed because I tried to debug by sending messages, also in the console there are no errors.
I also tried to run it repeatedly with a task but it still does not work.
Can you help me?
I'm sure that the code is executed because I tried to debug by sending messages, also in the console there are no errors.
I also tried to run it repeatedly with a task but it still does not work.
Can you help me?
@EventHandler
public void interact(PlayerInteractEvent event) {
if (event.getHand() != EquipmentSlot.HAND)
return;
var item = event.getItem();
if (item == null || item.getType() != Material.STICK)
return;
var player = event.getPlayer();
player.setPose(Pose.SHOOTING, true);
}