InventoryTransactionEvent

Discussion in 'Nukkit discussions and help' started by JackboyPlay, 20/11/16.

  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
Dismiss Notice
We welcome you on our site. This site is devoted to the Nukkit project and all that is connected with him. Here you can communicate, download plugins, also many other things get acquainted! Register the account right now :3
  1. JackboyPlay

    JackboyPlay Пользователь

    Messages:
    19
    Likes Received:
    1
    Minecraft:
    JackboyPlay
    Hello folks, if I use this:
    PHP:
    @EventHandler
    public void onTransact(InventoryTransactionEvent e){
    Set<Transactiontransactions e.getTransaction().getTransactions();
    Set<Inventoryinvs e.getTransaction().getInventories();
    for(
    Inventory inv invs){
    for(
    Transaction trans transactions){
    if(
    inv.getHolder() instanceof Player){
    Player player = (Playerinv.getHolder();
    e.setCancelled();
    }
    }
    }
    }
    The Event wont cancelled!
    If I want to send a message in this event to the player it works if a player put something into a chest but if a player take something out of a chest he wont get a message!
     
  2. JackboyPlay

    JackboyPlay Пользователь

    Messages:
    19
    Likes Received:
    1
    Minecraft:
    JackboyPlay
    CLOSED fixed it!
     

Share This Page