PlayerItemConsumeEvent Bug

Discussion in 'Plugin Development' started by ShakyTom, Sep 13, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    ShakyTom

    I am trying to cancel the consumption of golden apples but have encountered a very weird bug...

    My code is:

    Code:
    @EventHandler(ignoreCancelled = true, priority = EventPriority.LOWEST)
        public void appleConsume(PlayerItemConsumeEvent event) {
           
            if(event.getItem().getType() == Material.GOLDEN_APPLE && event.getItem().getData().getData() == 1) {
                event.setCancelled(true);   
            }
        }
    It cancels the event fine, but the client then thinks the helmet slot has been replaced by apples for some reason?!

    [​IMG]

    Is it something I am doing wrong, or a bug?

    Depending on what slot the apples are in when I eat them seems to change where they appear:

    [​IMG]

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 4, 2016
  2. Offline

    thomasb454


    This is a bug I believe, when I made a plugin for this it did the same thing.
     
Thread Status:
Not open for further replies.

Share This Page