Skip to content

Commit 84f8708

Browse files
committed
v3.2 for Minecraft 1.21
1 parent aa446e3 commit 84f8708

12 files changed

+66
-37
lines changed

data/mb/funcs/init.mcf

+19-6
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
#---------------------------------#
22
# #
3-
# MUSICAL BLOCKS v2 #
3+
# MUSICAL BLOCKS v3.2 #
44
# by Nixinova #
55
# #
66
# World setup commands #
77
# #
88
#---------------------------------#
99

10+
_const version = "3.2"
11+
1012
tellraw @a "If the map has not been set up properly, please run the command again."
1113

1214
# Teleport players
1315
setworldspawn 968 5 1018
1416
spawnpoint @a 968 5 1018
1517
tp @a 968 5 1018
18+
clear @a
1619

1720
# Teams
1821
team add lobby
@@ -24,16 +27,22 @@ team add dead
2427
team modify dead color red
2528
team modify playing friendlyFire false
2629

30+
team join lobby @a
31+
2732
# Scoreboards
2833
scoreboard objectives add Timer dummy "Timer"
2934
scoreboard objectives add Dead deathCount "Dead"
3035
scoreboard objectives add Health health "Health"
31-
scoreboard objectives add MB dummy {"text":"§1M§3U§5S§7I§9C§bA§dL §2B§4L§6O§8C§aK§cS§r"}
36+
scoreboard objectives add MB dummy "MB"
3237
scoreboard objectives add Map dummy "Map"
3338
scoreboard objectives add Wins dummy "§aWins"
3439
scoreboard objectives add Players dummy "Players"
3540
scoreboard objectives add Colour dummy "Colour"
3641

42+
scoreboard players reset @a
43+
scoreboard objectives setdisplay sidebar Wins
44+
scoreboard objectives setdisplay below_name Wins
45+
3746
# Command blocks
3847
setblock 965 4 1041 repeating_command_block{Command:"function mb:map/running",auto:true}
3948

@@ -53,10 +62,10 @@ fill 962 3 1012 967 3 1017 redstone_lamp
5362
fill 973 3 1024 969 3 1019 redstone_lamp
5463
fill 969 3 1017 973 3 1012 redstone_lamp
5564
fill 973 2 1012 962 2 1024 redstone_block
56-
setblock 961 5 1018 player_wall_head[facing=east]{SkullOwner:{Name:"Nixinova"}}
57-
setblock 961 5 1019 birch_wall_sign[facing=east]{Text2:'"§1M§3U§5S§7I§9C§bA§dL"',Text3:'"§2B§4L§6O§8C§aK§cS"'}
58-
setblock 961 5 1017 birch_wall_sign[facing=east]{Text2:'{"text":"v3.0","color":"red"}'}
59-
setblock 974 5 1018 birch_wall_sign[facing=west]{Text1:'{"color":"green","clickEvent":{"action":"run_command","value":"function mb:map/play"},"text":"=========================="}',Text2:'{"bold":true,"color":"green","text":"Start"}',Text3:'{"bold":true,"color":"green","text":"Game"}',Text4:'{"color":"green","text":"=========================="}'}
65+
setblock 961 5 1018 player_wall_head[facing=east]{profile:{name:"Nixinova"}}
66+
setblock 961 5 1019 birch_wall_sign[facing=east]{front_text:{messages:['""','"§1M§3U§5S§7I§9C§bA§dL"','"§2B§4L§6O§8C§aK§cS"','""'],has_glowing_text:true}}
67+
setblock 961 5 1017 birch_wall_sign[facing=east]{front_text:{messages:['""','""','{"text":"v$(version)","color":"red"}','""'],has_glowing_text:true}}
68+
setblock 974 5 1018 birch_wall_sign[facing=west]{front_text:{messages:['{"color":"green","clickEvent":{"action":"run_command","value":"function mb:map/play"},"text":"=========================="}','{"bold":true,"color":"green","text":"Start"}','{"bold":true,"color":"green","text":"Game"}','{"color":"green","text":"=========================="}']}}
6069
setblock 976 4 1018 command_block{Command:"function mb:map/play"}
6170
setblock 974 4 1018 stone_button[facing=west]
6271

@@ -101,3 +110,7 @@ execute unless score #const2 RNG_77 matches 1.. run scoreboard players set #cons
101110
scoreboard players add #prev_number RNG_77 0
102111
scoreboard players set #m1 RNG_77 -1
103112
scoreboard players add #clock_time RNG_77 1
113+
114+
# Force refresh settings by having dummy game
115+
function mb:map/game_start
116+
stopsound @a

data/mb/funcs/map/.gl.mcf

-1
This file was deleted.

data/mb/funcs/map/countdown.mcf

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
#---------------------------------#
22
# #
3-
# MUSICAL BLOCKS v2 #
3+
# MUSICAL BLOCKS v3.2 #
44
# by Nixinova #
55
# #
66
# Starting countdown commands #
77
# #
88
#---------------------------------#
99

10+
_const MUSICAL_BLOCKS = '{"text":"[","color":"white","bold":true},{"text":"M","color":"dark_blue","bold":true},{"text":"U","color":"dark_aqua","bold":true},{"text":"S","color":"dark_purple","bold":true},{"text":"I","color":"gray","bold":true},{"text":"C","color":"blue","bold":true},{"text":"A","color":"aqua","bold":true},{"text":"L ","color":"light_purple","bold":true},{"text":"B","color":"dark_green","bold":true},{"text":"L","color":"dark_red","bold":true},{"text":"O","color":"gold","bold":true},{"text":"C","color":"dark_gray","bold":true},{"text":"K","color":"green","bold":true},{"text":"S","color":"red","bold":true},{"text":"]","color":"white","bold":true}'
11+
1012
_const starting_in = '{"text":" Starting in ","color":"white","bold":false}'
1113
_const timer = 'score starting Timer matches'
1214
_const target = '@a[team=lobby]'

data/mb/funcs/map/game_end.mcf

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
#---------------------------------#
22
# #
3-
# MUSICAL BLOCKS v2 #
3+
# MUSICAL BLOCKS v3.2 #
44
# by Nixinova #
55
# #
66
# Game ending commands #
77
# #
88
#---------------------------------#
99

1010
# Declare winner
11-
title @a title [{"selector":"@a[team=playing]"}]
12-
title @a subtitle [{"text":" has won!","color":"green"}]
11+
_if ('entity @a[team=playing]') {
12+
title @a title [{"selector":"@a[team=playing]"}]
13+
title @a subtitle [{"text":" has won!","color":"green"}]
14+
tellraw @a [{"selector":"@a[team=playing]"}, {"text":" has won!","color":"green"}]
15+
}
1316

1417
# Update scoreboards
1518
scoreboard players add @a[team=playing] Wins 1
@@ -21,6 +24,6 @@ scoreboard objectives setdisplay sidebar Wins
2124

2225
# Move players to lobby
2326
clear @a
24-
tp @a 967 5 1018
27+
tp @a 968 5 1018
2528
team join lobby @a
2629
gamemode adventure @a[team=lobby]

data/mb/funcs/map/game_start.mcf

+11-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#---------------------------------#
22
# #
3-
# MUSICAL BLOCKS v2 #
3+
# MUSICAL BLOCKS v3.2 #
44
# by Nixinova #
55
# #
66
# Game starting commands #
@@ -16,13 +16,19 @@ scoreboard players reset starting Map
1616
scoreboard players set playing Map 1
1717
scoreboard players set Round MB 0
1818
scoreboard players reset @a Dead
19-
scoreboard objectives setdisplay sidebar MB
19+
scoreboard objectives setdisplay sidebar
2020

2121
# Move players to game map
2222
spreadplayers 1044 964 3 14 false @a[team=lobby]
23-
stopsound @a
24-
execute as @a at @s run playsound minecraft:music_disc.stal master @a
2523
team join playing @a[team=lobby]
2624

27-
# Setup round
25+
# Music
26+
stopsound @a
27+
execute if score number RNG_77 matches 1 run execute as @a at @s run playsound minecraft:music_disc.stal master @a
28+
execute if score number RNG_77 matches 2 run execute as @a at @s run playsound minecraft:music_disc.blocks master @a
29+
execute if score number RNG_77 matches 3 run execute as @a at @s run playsound minecraft:music_disc.chirp master @a
30+
execute if score number RNG_77 matches 4 run execute as @a at @s run playsound minecraft:music_disc.pigstep master @a
31+
execute if score number RNG_77 matches 5 run execute as @a at @s run playsound minecraft:music_disc.otherside master @a
32+
33+
# Set up round
2834
function mb:map/round_setup

data/mb/funcs/map/play.mcf

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
#---------------------------------#
22
# #
3-
# MUSICAL BLOCKS v2 #
3+
# MUSICAL BLOCKS v3.2 #
44
# by Nixinova #
55
# #
66
# Game initialising commands #
77
# #
88
#---------------------------------#
99

10-
scoreboard players reset online Players
11-
execute as @a run scoreboard players add online Players 1
12-
_if ('score online Players matches 2..') {
10+
scoreboard players reset Online Players
11+
execute as @a run scoreboard players add Online Players 1
12+
_if ('score Online Players matches 2..') {
1313
scoreboard players reset starting Timer
1414
scoreboard players set starting Map 1
1515
_}
16-
execute unless score online Players matches 2.. run tellraw @p [{"text":"Not enough players!","color":"red"}]
16+
execute unless score Online Players matches 2.. run tellraw @p [{"text":"Not enough players!","color":"red"}]

data/mb/funcs/map/round.mcf

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
#file: ./
22
#---------------------------------#
33
# #
4-
# MUSICAL BLOCKS v2 #
4+
# MUSICAL BLOCKS v3.2 #
55
# by Nixinova #
66
# #
77
# Round commands #
88
# #
99
#---------------------------------#
1010

11+
_const MUSICAL_BLOCKS = '{"text":"[","color":"white","bold":true},{"text":"M","color":"dark_blue","bold":true},{"text":"U","color":"dark_aqua","bold":true},{"text":"S","color":"dark_purple","bold":true},{"text":"I","color":"gray","bold":true},{"text":"C","color":"blue","bold":true},{"text":"A","color":"aqua","bold":true},{"text":"L ","color":"light_purple","bold":true},{"text":"B","color":"dark_green","bold":true},{"text":"L","color":"dark_red","bold":true},{"text":"O","color":"gold","bold":true},{"text":"C","color":"dark_gray","bold":true},{"text":"K","color":"green","bold":true},{"text":"S","color":"red","bold":true},{"text":"]","color":"white","bold":true}'
12+
1113
_const map = 'score randomiser Map matches'
1214
_const colour = 'score colour Map matches'
1315
_const area = '1058 5 978 1029 5 949'
@@ -49,8 +51,8 @@ _set_colours('13', 'yellow', 'lime', 'black', 'red', 'white', 'orange')
4951

5052
# Give colour to each player
5153
_modal announce_colour (colour, chat_colour) {
52-
_for(1, 9) {
53-
execute if score $(colour) Colour matches 1 run give @a[team=playing] $(colour)_wool{_NoStack:$(i)}
54+
_for(0, 8) {
55+
execute if score $(colour) Colour matches 1 run item replace entity @a[team=playing] hotbar.$(i) with $(colour)_wool
5456
}
5557
execute if score $(colour) Colour matches 1 run tellraw @a[team=playing] [$(MUSICAL_BLOCKS),{"text":" Selected colour: ","bold":false},{"text":"$(colour)","color":"$(chat_colour)","bold":false}]
5658
}

data/mb/funcs/map/round_setup.mcf

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#---------------------------------#
22
# #
3-
# MUSICAL BLOCKS v2 #
3+
# MUSICAL BLOCKS v3.2 #
44
# by Nixinova #
55
# #
66
# Map setup commands #

data/mb/funcs/map/running.mcf

+8-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#---------------------------------#
22
# #
3-
# MUSICAL BLOCKS v2 #
3+
# MUSICAL BLOCKS v3.2 #
44
# by Nixinova #
55
# #
66
# Always running commands #
@@ -14,16 +14,19 @@ team join lobby @a[x=967,y=4,z=1018,distance=..10]
1414
gamemode adventure @a[team=lobby]
1515
effect give @a[team=lobby] instant_health 5 0 true
1616
effect give @a[team=lobby] saturation 5 0 true
17+
effect give @a[team=lobby] fire_resistance 1 0 true
1718
scoreboard players add running Timer 1
1819
execute if score running Timer matches 1000.. run scoreboard players set running Timer 0
20+
tp @a[x=968,y=9,z=1018,distance=..2] 968 5 1018
1921

2022
# Death
21-
team join dead @a[scores={Health=..17}]
22-
execute if entity @a[scores={Health=..17}] run tellraw @a ["",{"selector":"@a[scores={Health=..17}]"},{"text":" burned to death","color":"yellow"}]
23+
_const deadPlayers = '@a[scores={Health=..17}]'
24+
team join dead $(deadPlayers)
25+
execute if entity $(deadPlayers) run tellraw @a ["",{"selector":"$(deadPlayers)"},{"text":" has been eliminated","color":"gold"}]
2326
gamemode spectator @a[team=dead]
2427
effect give @a[team=dead] instant_health
25-
execute store result score alive Players if entity @e[team=playing]
26-
execute if score online Players matches 2.. if score alive Players matches ..1 if score Round MB matches 1.. run function mb:map/game_end
28+
execute store result score Alive Players if entity @e[team=playing]
29+
execute if score Online Players matches 2.. if score Alive Players matches ..1 if score Round MB matches 1.. run function mb:map/game_end
2730

2831
# Game start
2932
execute if score starting Map matches 1.. run function mb:map/countdown

pack.mcmeta

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"pack": {
3-
"pack_format": 6,
4-
"description": "Musical Blocks v3.1 data pack for Minecraft 1.16 by Nixinova."
3+
"pack_format": 45,
4+
"supported_formats": [45, 63],
5+
"description": "Musical Blocks v3.2 for Minecraft 1.21 - data pack by Nixinova."
56
}
67
}

package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@nixinova/musical-blocks",
3-
"version": "3.1",
4-
"description": "Musical Blocks / Block Party minigame in vanilla Minecraft",
3+
"version": "3.2",
4+
"description": "Data pack for playing the Musical Blocks minigame in vanilla Minecraft",
55
"author": "Nixinova (https://nixinova.com)",
66
"private": true,
77
"scripts": {

0 commit comments

Comments
 (0)