-
Bug
-
Resolution: Cannot Reproduce
-
Major
-
None
-
None
PlayerDropItemEvent is being fired when a player receives items from /give command and causes duplication of 1 item for each command execution when the event is cancelled.
Note: Affects both Spigot and CraftBukkit
https://youtu.be/5gvv7sUGTHI
https://youtu.be/lG57H8klk3U
For example, if I have this plugin:
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerDropItemEvent;
import org.bukkit.plugin.java.JavaPlugin;public class TestPlugin extends JavaPlugin implements Listener
{
@Override
public void onEnable()Unknown macro: { getServer().getPluginManager().registerEvents(this, this); }@EventHandler(ignoreCancelled = true)
void on(PlayerDropItemEvent event)Unknown macro: { getLogger().info("Player Drop Item Event}}
And execute the commands below the event PlayerDropItemEvent will be fired even thought the player didn't drop any item and cancelling it will cause the player to receive one extra item.
/give player minecraft:wooden_axe 1
The player will receive 2 wooden axes instead of 1
/give player minecraft:crafting_table 64
The player will receive 65 crafting tables instead of 64
/give player minecraft:iron_ore
The player will receive 2 iron ores instead of 1
Tested versions:
git-Bukkit-0a645a2
git-Spigot-870264a-0a645a2