#how do i make it so every 5 minutes all the chests in my map, respawn with custom loot?
1 messages · Page 1 of 1 (latest)
You’ll want to save the locations of the chests in a list too.
You can probably store the block’s NBT or blockdata too (this will refill exactly, no variation)
im not stupid, i just need help with how to loop thru all chests because if i wanna loop them i first gotta loop all blocks and thats to laggy
permission: op
trigger:
add location of player to {chest.loc::*}
send "&2added your location to chest spawns, chests respawn every 15 minutes" to player
every 15 minutes:
loop {chest.loc::*}:
set block at loop-value to chest
set {_chest} to block at loop-value
loop 27 times:
set slot (loop-index - 1) of {_chest} to diamond sword named "Dagger Sword" with lore "A powerful weapon", "Looted from a chest"
set slot (loop-index - 1) of {_chest} to golden apple named "Rotten Apple" with lore "A precious but sometimes poisoned fruit", "Looted from a chest"
broadcast "&3&lAll Chests Have Been Respawned!"```
i have this now
but why does set slot (loop-index - 1) of {_chest} to diamond sword named "Dagger Sword" with lore "A powerful weapon", "Looted from a chest"
set slot (loop-index - 1) of {_chest} to golden apple named "Rotten Apple" with lore "A precious but sometimes poisoned fruit", "Looted from a chest" not work?

{_chest} is not an inventory; you cant set its slots
Try `{_chest}’s inventory'
Also, you are setting it to the sword, then immediately overriding it with the gap
also dont work
idk
