#How do I replace the way skript handles block ids with actual Minecraft ids?

1 messages · Page 1 of 1 (latest)

toxic jolt
#

Code:
command /summonrandomblock:
trigger:
set {_list::} to all blocks
set {_a} to size of {_list::
}
set {_b} to a random element out of {_list::*}

    execute player command "/setblock -353 -60 -104 minecraft:%{_b}%"

When I run the command, it doesn’t work more than likely due to the way skript handles block ids. For example: if it landed on yellow wool, it wouldn’t work due to it being listed as “yellow wool” instead of “yellow_wool”

Note:
I am starting to learn skript which makes this stuff difficult to me currently.

stuck mist
#

Set block at location(x, y, z world"world") to {_b}

broken arrow
#

try to stay away from executing console commands, skript usually has built in methods to do stuff
in this case it’s set block at %location% to %block/itemtype% with % meaning the types it accepts
you should use the location function to get a location for this, like location(x,y,z) or location(-353, -60, -104)
so your line would be set block at location(-353, -60, -104) to {_b}