Следуйте инструкциям в видео ниже, чтобы узнать, как установить наш сайт как веб-приложение на главный экран вашего устройства.
Примечание: Эта функция может быть недоступна в некоторых браузерах.
INVENTORY_CLICK:
chest_deny:
click-type: ANY
action-type: ANY
inventory-type: CHEST
slot-type: ANY
item: type:STONE
actions:
- CANCEL_EVENT=true
chest_deny:
click-type: ANY
action-type: ANY
inventory-type: FURNACE
slot-type: ANY
item: type:STONE
actions:
- CANCEL_EVENT=true
Мне нужно это реализовать своим плагином.Вот возможное решение:
Плагин ReActionsАктиваторы не дадут вообще взаимодействовать с камнем (STONE), пока ты находишься в каком-либо сундуке или печке.Код:INVENTORY_CLICK: chest_deny: click-type: ANY action-type: ANY inventory-type: CHEST slot-type: ANY item: type:STONE actions: - CANCEL_EVENT=true chest_deny: click-type: ANY action-type: ANY inventory-type: FURNACE slot-type: ANY item: type:STONE actions: - CANCEL_EVENT=true
Перенести в plugins/ReActions/Activators/Activators.yml
@EventHandler()
public final void onChestMove(InventoryClickEvent event){
Inventory top = event.getView().getTopInventory();
Inventory bottom = event.getView().getBottomInventory();
if(top.getType() == InventoryType.CHEST && bottom.getType() == InventoryType.PLAYER){
if(event.getCurrentItem() != null && event.getCurrentItem().getTypeId() != 0){
// player picked a item up + a Chest is opened
// and now i have no clue how to continue.
// сундук открыт + игрок поднял предмет мышкой
}
}
}
Спасибо! Я гуглил, но не нашел. Скорее всего я неправильно писал ☹️Нагуглил за тебя
Код:@EventHandler() public final void onChestMove(InventoryClickEvent event){ Inventory top = event.getView().getTopInventory(); Inventory bottom = event.getView().getBottomInventory(); if(top.getType() == InventoryType.CHEST && bottom.getType() == InventoryType.PLAYER){ if(event.getCurrentItem() != null && event.getCurrentItem().getTypeId() != 0){ // player picked a item up + a Chest is opened // and now i have no clue how to continue. // сундук открыт + игрок поднял предмет мышкой } } }