#how do i put items into the chest that i spawned?
1 messages · Page 1 of 1 (latest)
also, how would i make a variable, the arguments from the command
- No idea off the top of my head, but I'm sure reading the docs might help you (search for "
inventory") - You just did. Read lines 5 to 8, as that's exactly what you did
no??? he placed a chest with the line 5-8, and it can be tricky to play with chest inventory
i gotchu, this is the code i made for a random item in chest generator command /refill: trigger: loop blocks in radius {radius} around {chestloc}: if loop-block is a chest: clear loop-block's inventory #------------------------------------------------------------------------------------------------------# #This part is the tier or name for your chest. #We use the {_chestTier} variable to say what level or the name is/of our chest. set {_chestTier} to "Tier V" #We use the type of block to find which chest will be which level or have which name. if block under loop-block is purple stained glass: #create hologram {_chestTier} with text {_chestTier} on block above loop-block set {item} to a random number between 3 and 6 loop {item} times: set {randomitem} to random element out of {chest.refill.list::*} set {slot} to random number between 0 and 26 set slot {slot} of loop-block's inventory to {item} #------------------------------------------------------------------------------------------------------# send "&aSuccesfully filled every chest in a %{radius}% blocks radius" to player send action bar "&aSuccesfully filled every chest in a %{radius}% blocks radius" to player ps: when i made the code i had less than 2 week of experience so the code is very bad so just focus on set {slot} to random number between 0 and 26 set slot {slot} of loop-block's inventory to {item}
incorrect. here's exactly what line 5 says: set {_w} to arg-1
There is no chest in here, just a variable {_w} and an argument arg-1.
They asked how to set a variable to an argument, which is exactly what that line is doing: setting a variable (which they are using in the location() function as the world parameter) to the value of the first argument in the command (which is the world).
in a way yes he did his own question but yeah ;-;
/\ ouch
YEAH BUT HE ASKED TO PUT ITEMS IN A CHEST OK >:(
how do i put items into it though through the command ðŸ˜
