command /loaditemdisplay:
trigger:
give iron trapdoor named "&fItem Display" to the player
on place:
add location of event-block to {blocks::*} if name of player's tool is "&fItem Display"
function itemdispgui(p: player):
set {_gui} to a new chest inventory with 1 row with name "Item Display"
set slots 1,2,3,4,5,6,7,8 of {_gui} to black stained glass pane named "&8*"
set slot 4 of {_gui} to {disp.%{locofitemdisp.%{_p}%}%}
open {_gui} to {_p}
on right click:
{blocks::*} contains location of clicked block
cancel event
itemdispgui(player)
on inventory close:
set {disp::%{locofitemdisp::%player%}%} to slot 4 of event-inventory if name of event-inventory is "Item Display"
on inventory click:
event-inventory is not player's inventory
click type is left mouse button
name of event-inventory is "Item Display"
cancel event
on break:
{blocks::*} contains location of event-block
cancel event
remove location of event-block from {blocks::*}
set event-block to air
drop event-block at location of event-block