Hi, i want to add to my plugin rotating furniture, and tried to do onEntityInteract, because the furniture is armor stand, but when i tried to do it(with code under text) and i clicked on model nothing happend, it works only when i am on gamemode spectator and click directly on armor stand. Is there option to do the entity interact?
This is fragment of code
@EventHandler
public void onEntityInteract(PlayerInteractEntityEvent e) {
Player player = e.getPlayer();
Entity entity = e.getRightClicked();
if (entity.getType() == EntityType.
ARMOR_STAND
) {
ArmorStand armorStand = (ArmorStand) entity;
if (player.isSneaking()) {
rotateArmorStand(armorStand);
e.setCancelled(true);
}
}
}