Help removing Shulker Entity

  • 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 community!

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

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

chief pickle

Member
Sep 3, 2025
18
0
1
I'm making this skript as part of the animation for the opening of a card pack, it's where the player right clicks the shulker box with the item, it turns into the living entity with the nbt data, and it's SUPPOSED to remove the living shulker right before setting the original shulker box back but for some reason none of the normal things are working. Help would be much appreciated :emoji_slight_smile:

on right click:
# make sure it's a red shulker box
if type of clicked block is red shulker box:
# check the player is holding the correct item
if player's tool is brewer pottery sherd:
cancel event # prevent normal shulker box opening

# store block and location
set {_loc} to location of clicked block
set {_original} to type of clicked block

# remove the shulker box
set block at {_loc} to air

# coordinates (lower Y so the shulker fits properly)
set {_x} to x-coordinate of {_loc}
set {_y} to y-coordinate of {_loc} - 1
set {_z} to z-coordinate of {_loc}

# summon the open shulker
execute console command "summon minecraft:shulker %{_x}% %{_y}% %{_z}% {Color:14,Peek:100,NoAI:1b}"

# tag it 1 tick later
wait 1 tick
execute console command "tag @e[type=minecraft:shulker,sort=nearest,limit=1,distance=..2] add temp_shulker"

send "&cOpening red shulker..." to player
set {_shulker} to last spawned entity
# wait, then remove shulker first
wait 5 seconds
kill {_shulker}
wait 5 ticks
# only restore the block after the shulker is gone
set block at {_loc} to {_original}
send "&aShulker removed and original block restored." to player