Vanilla GUI anti dupe fixes.

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

Dovias

New Member
Dec 8, 2019
6
1
0
26
These not really are snippets but, these are useful things which prevent some annoying bugs, or dupes within vanilla GUI's

  • Anti "Move all items from container to player's cursor" dupe
    Requires skript-mirror:
Code:
import:
  org.bukkit.event.inventory.InventoryType
  org.bukkit.event.inventory.InventoryAction

on inventory click:
  if event.getWhoClicked().getOpenInventory().getTopInventory().getType() is InventoryType.CHEST: #You can change type to your's gui Type.
    if event.getWhoClicked().getOpenInventory().getTopInventory().getTitle() is "Name of chest":
      if event.getAction() is InventoryAction.COLLECT_TO_CURSOR:
        if "%event.getWhoClicked().getOpenInventory().getTopInventory().getContents()%" contains         "%event.getCursor().asOne()%":
          cancel event
  • Anti "lock item in slot that contains air" whenever inventory click event is cancelled
    Requires skript-mirror:
Code:
import:
  org.bukkit.event.inventory.InventoryDragEvent

on InventoryDragEvent:
  if event-inventory's name is "Title name of inventory":
    cancel event