I'm trying to make a random item selector (kinda like Mario Kart) and I have this in my .sk file:
But all it does is set my hotbar to the first slot. Nothing appears in slot 5 at all. I'm not sure why this isn't working, as it seems super simple.
Code:
on step on pressure plate:
loop 10 times:
set player's selected hotbar slot to slot 0 of player
set {_number} to a random number between 1 and 4
if {_number} is 1:
set slot 5 of player to 1 oak plank
if {_number} is 2:
set slot 5 of player to 1 birch plank
if {_number} is 3:
set slot 5 of player to 1 acacia plank
if {_number} is 4:
set slot 5 of player to 1 dark oak plank
wait a tick