Skip to content

Instantly share code, notes, and snippets.

@fluffy-kaiju
Last active July 30, 2021 13:50
Show Gist options
  • Save fluffy-kaiju/2c93aa0cf9342c14c98f006b633df698 to your computer and use it in GitHub Desktop.
Save fluffy-kaiju/2c93aa0cf9342c14c98f006b633df698 to your computer and use it in GitHub Desktop.
#!/bin/bash
d_print () {
screen -XS MCB stuff "tellraw @a {\"text\":\"$1\"}\n"
}
d_exe () {
screen -XS MCB stuff "$1\n"
}
d_init_game () {
d_exe "title @a times 20 100 20\n"
d_exe "minecraft:gamemode adventure @a\n"
d_exe "minecraft:clear @a\n"
d_exe "effect give @a resistance 99999 255\n"
d_exe "title @a title {\"text\":\"Init Apocalypse\",\"color\":\"dark_red\"}\n"
}
d_player_init () {
d_exe "title @a title {\"text\":\"Init Player\",\"color\":\"dark_red\"}\n"
d_exe "title @a times 20 100 20\n"
d_exe "replaceitem entity @a armor.head minecraft:leather_helmet{display:{color:10040115}}\n"
d_exe "replaceitem entity @a armor.chest minecraft:leather_chestplate{display:{color:10040115}}\n"
d_exe "replaceitem entity @a armor.legs minecraft:leather_leggings{display:{color:10040115}}\n"
d_exe "replaceitem entity @a armor.feet minecraft:leather_boots{display:{color:10040115}}\n"
d_exe "replaceitem entity @a container.0 minecraft:stone_axe\n"
d_exe "replaceitem entity @a container.1 minecraft:bread 32\n"
d_exe "essentials:heal *"
}
d_play_sound () {
sound=$1
coord=$2
vol=$3
min=$4
d_exe "playsound minecraft:$sound ambient @a $coord $vol 1 $min"
}
d_count_down () {
time=15
while ((time != 0))
do
echo $time
if [[ ($time == 15) || ($time < 11) ]]
then
d_play_sound "entity.experience_orb.pickup" "~ ~ ~" 2.0 1.0
d_print "$time"
fi
((time--))
sleep 1s
done
}
# d_count () {
# loop=$1
# sound=$2
# while ((loop >= 0))
# do
# d_play_sound "$sound" "~ ~ ~" "2.0" "1.0"
# ((loop--))
# sleep $3s
# done
# }
d_init_game
sleep 5s
d_player_init
d_print "game start in 30s"
sleep 15s
d_count_down
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment