#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)

sullen lantern
#

We dont give out made skripts here, but we can help if you have a problem with an existing skript :)

#

i can give you some help tho

#

start with every 5 minutes:

ocean ravine
#

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)

steep shale
#
    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?

torn geyser
ocean ravine
#

{_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

ocean ravine