[SPIGOT-882] PlayerDropItemEvent being fired incorrectly and causing duplication Created: 12/May/15  Updated: 21/May/15  Resolved: 21/May/15

Status: Closed
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major
Reporter: José Roberto de Araújo Júnior Assignee: Unassigned
Resolution: Cannot Reproduce Votes: 0
Labels: 1.8.3, Craftbukkit, PlayerDropItemEvent, bug, craftbukkit, dupe, duplication, event


 Description   

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



 Comments   
Comment by md_5 [ 21/May/15 ]

Cannot reproduce, no event fired for give command

Comment by José Roberto de Araújo Júnior [ 12/May/15 ]

The correct test plugin code:
http://pastebin.com/4xR4qLCX

Generated at Sat Dec 13 15:17:55 UTC 2025 using Jira 10.3.13#10030013-sha1:56dd970ae30ebfeda3a697d25be1f6388b68a422.