Prevent player from copying certain items on Creative mode?

Discussion in 'Plugin Development' started by MrAndeos, Aug 19, 2018.

Thread Status:
Not open for further replies.
  1. Offline

    MrAndeos

    Hello.

    I wonder if there (in Bukkit API) is any way of canceling or preventing a copying of given ItemStack on Creative mode, by clicking Shift or double-clicking the item? While trying to do this using InventoryClickEvent I realized that the event is getting called, but the returned ItemStack (getCurrentItem()) is null, so I can't know what is the copied item, and the returned SlotType is CONTAINER.
     
  2. @MrAndeos
    Theres an InventoryCreativeEvent, you can try that event
     
  3. Offline

    Zombie_Striker

    @MrAndeos
    There is no way to directly check if an item is being copied. However, you can search the player's inventory for duplicated itemstack either when the player clicks their inventory or when they drop an item.
     
Thread Status:
Not open for further replies.

Share This Page