Why isn't this event not getting triggered?

Discussion in 'Plugin Development' started by epicguyuk, Jul 6, 2020.

  1. Offline



    I'm looking at line 67. Everything else works fine just the bit about it triggering when the cake is eaten. Can you please help me fix it or find another way?
    Last edited: Jul 6, 2020
  2. Offline

    timtower Moderator Moderator

    @epicguyuk Does something fire if you send a message before the cake check?
  3. Offline


  4. Offline


    @epicguyuk There's no line 76 in that pastebin.
  5. Offline


    You could use the playerinteractevent and check if the player's hunger bar isn't full. If it's not full you know that the player is going to consume the cake.

    When choosing this implementation you have to keep in mind that the playerinteractevent can be cancelled by other plugins, which prevent players from eating cake.
  6. Offline


  7. Offline

    timtower Moderator Moderator

    @epicguyuk Did you print the action and the type of the clicked block?

Share This Page