Помогите Как отключить ивенты в левой руке для айтемов?

  • Автор темы Автор темы Haru
  • Дата начала Дата начала

Haru

Активный участник
Пользователь
Баллы
76
Приветствую, как отключить ивенты right click для всех айтемов во второй руке персонажа?

upload_2020-4-18_16-42-16.png
 

Что-то слепил, но выдает ошибку (Только сегодня занялся плагинами)

Код:
    public void Interact(PlayerInteractEvent e) {
        Action a = e.getAction();
        if(a == Action.RIGHT_CLICK_AIR && a == Action.RIGHT_CLICK_BLOCK) return;
        Player p = e.getPlayer();
        EquipmentSlot slot = slot.getHand();
        if(e.getHand() == EquipmentSlot.OFF_HAND){
           e.setCancelled(true);
            }
       
        }
 
Что-то слепил, но выдает ошибку (Только сегодня занялся плагинами)

Код:
    public void Interact(PlayerInteractEvent e) {
        Action a = e.getAction();
        if(a == Action.RIGHT_CLICK_AIR && a == Action.RIGHT_CLICK_BLOCK) return;
        Player p = e.getPlayer();
        EquipmentSlot slot = slot.getHand();
        if(e.getHand() == EquipmentSlot.OFF_HAND){
           e.setCancelled(true);
            }
      
        }
Код:
public void Interact(PlayerInteractEvent e) {
        Action a = e.getAction();
        if(a == Action.RIGHT_CLICK_AIR || a == Action.RIGHT_CLICK_BLOCK) return;
        Player p = e.getPlayer();
        if(e.getHand() == EquipmentSlot.OFF_HAND){
           e.setCancelled(true);
            }
      
        }
 
Назад
Верх