Other available versions. Ordered by newest to oldest versions:
Just so you know, we don't know the file format for every file. If it's just a bunch of random characters, it's probably a .zip or .jar.
import:
org.bukkit.inventory.InventoryHolder
org.bukkit.event.block.Action
org.bukkit.inventory.EquipmentSlot
org.bukkit.event.inventory.InventoryType
org.bukkit.inventory.HorseInventory
org.bukkit.Bukkit
org.bukkit.Material
on rightclick with any shulker box:
{-betterShulkerBoxes::%uuid of player%::slotIndex} is not set
player is not sneaking
(Action.LEFT_CLICK_AIR) and (Action.RIGHT_CLICK_AIR) contains event.getAction()
if clicked entity is instance of InventoryHolder:
stop
play sound "block.shulker_box.open" with volume 2 and pitch 1 to player
set {_blockState} to event-item.getItemMeta().getBlockState()
set {_inventory} to Bukkit.createInventory(player,InventoryType.SHULKER_BOX)
{_inventory}.setContents((inventory of {_blockState}).getContents())
open {_inventory} to player
if event.getHand() is EquipmentSlot.HAND:
set {-betterShulkerBoxes::%uuid of player%::slotIndex} to (inventory of player).getHeldItemSlot()
else:
set {-betterShulkerBoxes::%uuid of player%::slotIndex} to 40
set {-betterShulkerBoxes::%uuid of player%::item} to event-item
set {-betterShulkerBoxes::%uuid of player%::inventory} to {_inventory}
on swap hand item:
{-betterShulkerBoxes::%uuid of player%::slotIndex} is set
(inventory of player).getItem({-betterShulkerBoxes::%uuid of player%::slotIndex}) is player's held item
cancel event
on drop:
{-betterShulkerBoxes::%uuid of player%::slotIndex} is set
(inventory of player).getItem({-betterShulkerBoxes::%uuid of player%::slotIndex}) is not set
cancel event
on inventory close:
{-betterShulkerBoxes::%uuid of player%::slotIndex} is set
play sound "block.shulker_box.close" with volume 2 and pitch 1 to player
set {_openedShulker} to slot {-betterShulkerBoxes::%uuid of player%::slotIndex} of player's inventory
set {_itemMeta} to {_openedShulker}.getItemMeta()
set {_blockState} to {_itemMeta}.getBlockState()
(inventory of {_blockState}).setContents({-betterShulkerBoxes::%uuid of player%::inventory}.getContents())
if (inventory of {_itemMeta}.getBlockState()).equals(inventory of {_blockState}) is false:
{_itemMeta}.setBlockState({_blockState})
{_openedShulker}.setItemMeta({_itemMeta})
set slot {-betterShulkerBoxes::%uuid of player%::slotIndex} of player's inventory to {_openedShulker}
delete {-betterShulkerBoxes::%uuid of player%::*}
on inventory click:
{-betterShulkerBoxes::%uuid of player%::slotIndex} is set
event-inventory is not player's current inventory
(index of clicked slot) and (hotbar button) and (hotbar button+41) contains {-betterShulkerBoxes::%uuid of player%::slotIndex}
inventory action is not instant move
cancel event
on inventory click:
{-betterShulkerBoxes::%uuid of player%::slotIndex} is not index of clicked slot
event-inventory is inventory of player
event-item is any shulker box
click type is drop key
cancel event
play sound "block.shulker_box.open" with volume 2 and pitch 1 to player
set {_blockState} to event-item.getItemMeta().getBlockState()
set {_inventory} to Bukkit.createInventory(player,InventoryType.SHULKER_BOX)
{_inventory}.setContents((inventory of {_blockState}).getContents())
open {_inventory} to player
set {-betterShulkerBoxes::%uuid of player%::slotIndex} to index of clicked slot
set {-betterShulkerBoxes::%uuid of player%::item} to event-item
set {-betterShulkerBoxes::%uuid of player%::inventory} to {_inventory}
on death of player:
{-betterShulkerBoxes::%uuid of victim%::slotIndex} is set
(world of victim).getGameRuleValue("keepInventory") is "false"
set {_index} to event.getDrops().indexOf({-betterShulkerBoxes::%uuid of victim%::item})
set {_itemMeta} to {-betterShulkerBoxes::%uuid of victim%::item}.getItemMeta()
set {_blockState} to {_itemMeta}.getBlockState()
(inventory of {_blockState}).setContents({-betterShulkerBoxes::%uuid of victim%::inventory}.getContents())
{_itemMeta}.setBlockState({_blockState})
event.getDrops().get({_index}).setItemMeta({_itemMeta})
delete {-betterShulkerBoxes::%uuid of victim%::*}
on inventory click:
cursor slot of player is any shulker box
click type is right mouse button
event-item is not any shulker box
event.getSlotType() is not InventoryType.SlotType.RESULT
cancel event
set {_item} to cursor slot of player
set {_itemMeta} to {_item}.getItemMeta()
set {_blockState} to {_itemMeta}.getBlockState()
set {_inventory} to inventory of {_blockState}
if event-item is set:
set {_type} to event-item.getType()
else:
set {_type} to Material.AIR
if {_type} is not Material.AIR:
{_inventory} has enough space for event-item
play sound "item.bundle.insert" with volume 2 and pitch 1 to player
add event-item to {_inventory}
set clicked slot to air
{_itemMeta}.setBlockState({_blockState})
{_item}.setItemMeta({_itemMeta})
set cursor slot of player to {_item}
else:
event.getSlotType() is not InventoryType.SlotType.ARMOR
event-inventory is not instance of HorseInventory
play sound "item.bundle.remove_one" with volume 2 and pitch 1 to player
loop 27 times:
set {_loopedItem} to slot 27-loop-value of {_inventory}
{_loopedItem} is not air
set clicked slot to {_loopedItem}
set slot 27-loop-value of {_inventory} to air
{_itemMeta}.setBlockState({_blockState})
{_item}.setItemMeta({_itemMeta})
set cursor slot of player to {_item}
stop
on world save:
loop all players:
{-betterShulkerBoxes::%uuid of loop-value%::slotIndex} is set
set {_openedShulker} to slot {-betterShulkerBoxes::%uuid of loop-value%::slotIndex} of loop-value's inventory
set {_itemMeta} to {_openedShulker}.getItemMeta()
set {_blockState} to {_itemMeta}.getBlockState()
(inventory of {_blockState}).setContents({-betterShulkerBoxes::%uuid of loop-value%::inventory}.getContents())
if (inventory of {_itemMeta}.getBlockState()).equals(inventory of {_blockState}) is false:
{_itemMeta}.setBlockState({_blockState})
{_openedShulker}.setItemMeta({_itemMeta})
set slot {-betterShulkerBoxes::%uuid of loop-value%::slotIndex} of loop-value's inventory to {_openedShulker}