Code:
on death:
execute console command "smite %victim%"
cancel event
set player's gamemode to spectator
send title "&4&lYou died!" with subtitle "5 seconds until respawn." to player for 1.5 seconds
wait 1 second
send title "&4&lYou died!" with subtitle "4 seconds until respawn." to player for 1.5 seconds
wait 1 second
send title "&4&lYou died!" with subtitle "3 seconds until respawn." to player for 1.5 seconds
wait 1 second
send title "&4&lYou died!" with subtitle "2 seconds until respawn." to player for 1.5 seconds
wait 1 second
send title "&4&lYou died!" with subtitle "1 seconds until respawn." to player for 1.5 seconds
wait 1 second
set player's gamemode to survival
execute player command "spawn"
send title "&a&lRespawned!" with subtitle "You have been sent back to spawn." to player for 2 seconds
I tried drop all items in players inventory, nothing happens and nothing drops. How can I make all of there items drop?