Skip to content

PlayerItemConsumeEvent is fired when it shouldn't be #4682

@partydev

Description

@partydev

What behaviour is expected:

Setting the food level of a player to 20 will not fire the PlayerItemConsumeEvent.

What behaviour is observed:

Setting the food level of a player to 20 fires the PlayerItemConsumeEvent.

Steps/models to reproduce:

    @EventHandler
    fun PlayerItemConsumeEvent.onConsume() {
        isCancelled = true
        player.setFoodLevel(20)
    }

Will continue firing the event. If you make a food item and cancel the consume event and then set the player food level to 20, it will keep firing the event in an infinite loop until they switch items.

Plugin list:

N/A

Paper version:

[16:04:34 INFO]: This server is running Purpur version git-Purpur-"54fdd69" (MC: 1.16.3) (Implementing API version 1.16.3-R0.1-SNAPSHOT)
[16:04:34 INFO]: Previous version: git-Purpur-786 (MC: 1.16.3)
[16:04:34 INFO]: Unknown version
(a fork of purpur that only modified being able to toggle lag compensating eating for testing)

Anything else:

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: acceptedDisputed bug is accepted as valid or Feature accepted as desired to be added.type: bugSomething doesn't work as it was intended to.upstream: bukkitIssues exists in Bukkit and/or CraftBukkit.version: 1.16Game version 1.16

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions