OldCombatMechanics

OldCombatMechanics

46.1k Downloads

Can't continuously consume golden apples

NessunoMC opened this issue · 10 comments

commented

Information

Problem Description

When a player eats multiple apples consecutively or while in combat, the apple is not consumed. Although the delay is set to zero.

commented

Do you mean that the golden apples have the effect but the quantity is not reduced? Also please don't use hastebin for pastes, they tend to randomly disappear when you most need them.

commented

Do you mean that the golden apples have the effect but the quantity is not reduced? Also please don't use hastebin for pastes, they tend to randomly disappear when you most need them.

It doesn't eat the golden apples and doesn't gets the effects.

commented

If you change the delay, does that affect the behaviour at all?

commented

If you change the delay, does that affect the behaviour at all?

I tried to change the delay too but it’s the same. This problem affects just using the old golden apples on true in the config.

commented

Is there a specific situation in which this happens? Because I don't find this to be the case at all.

commented

Is there a specific situation in which this happens? Because I don't find this to be the case at all.

By eating apples consecutively. To try, just open a server in 1.15.2 and activate the old golden apples.

Just try your plugin on 1.15.2 with OLD ENCHANTED GOLDEN APPLES on TRUE and try to consume apples consecutively.

Users said it also happens during the PVP.

commented

Is there a specific situation in which this happens? Because I don't find this to be the case at all.

By eating apples consecutively. To try, just open a server in 1.15.2 and activate the old golden apples.
Just try your plugin on 1.15.2 with OLD ENCHANTED GOLDEN APPLES on TRUE and try to consume apples consecutively.
Users said it also happens during the PVP.

Yes, of course I tried this and it's working fine. Otherwise I wouldn't have asked for more details. Unfortunately, to fix a bug I must first see it in action to figure out why it is occurring. Please try the next steps:

  1. Enable debug mode in the config and check for messages from the old golden apple module, and post them here.
  2. Please try running OCM on a server with just OCM, as this issue can likely be because of a conflict with another plugin. If that is the case, identifying the other plugin would be necessary to fix this.

No differences running it without any plugin.
Video > https://www.youtube.com/watch?v=OMVhehJM5LY&feature=youtu.be

commented

Can reproduce. Sadly I can also reproduce it with:

    @EventHandler(priority = EventPriority.HIGH)
    public void onItemConsume(PlayerItemConsumeEvent e){
        debug("No food for you!", e.getPlayer());
        e.setCancelled(true);
    }

It seems to be a bug in Bukkit/the MC client. If you cancel the eat event and the player continues to hold down right click, it might enter a weird in-between state where the client plays the eating animation forever without actually doing anything. I am not sure if it even shows for other players.

Maybe changing the itemstack or casting it into the void and restoring it a tick later or some other weird workaround hack can solve that...

commented

Can reproduce. Sadly I can also reproduce it with:

    @EventHandler(priority = EventPriority.HIGH)
    public void onItemConsume(PlayerItemConsumeEvent e){
        debug("No food for you!", e.getPlayer());
        e.setCancelled(true);
    }

It seems to be a bug in Bukkit/the MC client. If you cancel the eat event and the player continues to hold down right click, it might enter a weird in-between state where the client plays the eating animation forever without actually doing anything. I am not sure if it even shows for other players.

Maybe changing the itemstack or casting it into the void and restoring it a tick later or some other weird workaround hack can solve that...

So is it possibile to fix?

commented

Is there a specific situation in which this happens? Because I don't find this to be the case at all.

By eating apples consecutively. To try, just open a server in 1.15.2 and activate the old golden apples.

Just try your plugin on 1.15.2 with OLD ENCHANTED GOLDEN APPLES on TRUE and try to consume apples consecutively.

Users said it also happens during the PVP.

Yes, of course I tried this and it's working fine. Otherwise I wouldn't have asked for more details. Unfortunately, to fix a bug I must first see it in action to figure out why it is occurring. Please try the next steps:

  1. Enable debug mode in the config and check for messages from the old golden apple module, and post them here.
  2. Please try running OCM on a server with just OCM, as this issue can likely be because of a conflict with another plugin. If that is the case, identifying the other plugin would be necessary to fix this.