Initial commit

This commit is contained in:
Victoria Fierce 2022-09-10 14:28:27 +02:00
commit c13c4bbd85
34 changed files with 422 additions and 0 deletions

9
README.md Normal file
View File

@ -0,0 +1,9 @@
# Malloc Minecraft Data Pack
This is the datapack that runs on most of the malloc.gg servers.
## Features
- Modifies some block loot tables to occasionally drop grist coins
- Adds a system for controlling fireworks and other RP special effects (Malloc FX)
- Adds a countdown timer system for use in RP events

View File

@ -0,0 +1,4 @@
function malloc:fx/anchors/reset
function malloc:fx/anchors/reset_tags
function malloc:fx/anchors/show
data merge entity @s {CustomName:'{"text":"DEFAULT","color":"white","bold":true}'}

View File

@ -0,0 +1 @@
data merge entity @s {ArmorItems:[],CustomNameVisible:0b,NoGravity:1b,Silent:1b,Invulnerable:1b,ShowArms:1b,Marker:1b,Invisible:1b,DisabledSlots:4144959}

View File

@ -0,0 +1,5 @@
tag @s add fx
tag @s remove fx-purple
tag @s remove fx-red
tag @s remove fx-blue
tag @s remove fx-green

View File

@ -0,0 +1,5 @@
function malloc:fx/anchors/reset
function malloc:fx/anchors/reset_tags
function malloc:fx/anchors/show
data merge entity @s {ArmorItems:[{id:"minecraft:leather_boots",Count:1b,tag:{display:{color:255}}},{id:"minecraft:leather_chestplate",Count:1b,tag:{display:{color:255}}},{id:"minecraft:leather_leggings",Count:1b,tag:{display:{color:255}}},{id:"minecraft:leather_helmet",Count:1b,tag:{display:{color:255}}}],CustomName:'{"text":"BLUE","color":"blue","bold": true}'}
tag @s add fx-blue

View File

@ -0,0 +1,5 @@
function malloc:fx/anchors/reset
function malloc:fx/anchors/reset_tags
function malloc:fx/anchors/show
data merge entity @s {CustomName:'{"text":"GREEN","color":"green","bold":true}',ArmorItems:[{id:"minecraft:leather_boots",Count:1b,tag:{display:{color:65280}}},{id:"minecraft:leather_chestplate",Count:1b,tag:{display:{color:65280}}},{id:"minecraft:leather_leggings",Count:1b,tag:{display:{color:65280}}},{id:"minecraft:leather_helmet",Count:1b,tag:{display:{color:65280}}}]}
tag @s add fx-green

View File

@ -0,0 +1,5 @@
function malloc:fx/anchors/reset
function malloc:fx/anchors/reset_tags
function malloc:fx/anchors/show
data merge entity @s {ArmorItems:[{id:"minecraft:leather_boots",Count:1b,tag:{display:{color:14483711}}},{id:"minecraft:leather_chestplate",Count:1b,tag:{display:{color:14483711}}},{id:"minecraft:leather_leggings",Count:1b,tag:{display:{color:14483711}}},{id:"minecraft:leather_helmet",Count:1b,tag:{display:{color:14483711}}}],CustomName:'{"text":"PURPLE","color":"light_purple","bold":true}'}
tag @s add fx-purple

View File

@ -0,0 +1,5 @@
function malloc:fx/anchors/reset
function malloc:fx/anchors/reset_tags
function malloc:fx/anchors/show
data merge entity @s {ArmorItems:[{id:"minecraft:leather_boots",Count:1b,tag:{display:{color:16711680}}},{id:"minecraft:leather_chestplate",Count:1b,tag:{display:{color:16711680}}},{id:"minecraft:leather_leggings",Count:1b,tag:{display:{color:16711680}}},{id:"minecraft:leather_helmet",Count:1b,tag:{display:{color:16711680}}}],CustomName:'{"text":"RED","color":"red","bold": true}'}
tag @s add fx-red

View File

@ -0,0 +1,2 @@
function malloc:fx/anchors/reset
data merge entity @s {CustomNameVisible:1b,Marker:0b,Invisible:1b,Glowing:1b}

View File

@ -0,0 +1 @@
execute at @s run summon firework_rocket ~ ~ ~ {LifeTime:30,FireworksItem:{id:firework_rocket,Count:1,tag:{Fireworks:{Explosions:[{Type:1,Trail:1b,Colors:[I;5055],FadeColors:[I;3679299]},{Type:4,Trail:1b,Colors:[I;169676],FadeColors:[I;852045]},{Type:0,Colors:[I;579327],FadeColors:[I;10083071]}]}}}}

View File

@ -0,0 +1 @@
execute at @s run summon firework_rocket ~ ~ ~ {LifeTime:30,FireworksItem:{id:firework_rocket,Count:1,tag:{Fireworks:{Explosions:[{Type:3,Colors:[I;2211586],FadeColors:[I;3949361]},{Type:4,Trail:1b,Colors:[I;6999215],FadeColors:[I;6740298]}]}}}}

View File

@ -0,0 +1 @@
execute at @s run summon firework_rocket ~ ~ ~ {LifeTime:30,FireworksItem:{id:firework_rocket,Count:1,tag:{Fireworks:{Explosions:[{Type:2,Colors:[I;12521401],FadeColors:[I;4390919]},{Type:4,Trail:1b,Colors:[I;5699],FadeColors:[I;9506731]}]}}}}

View File

@ -0,0 +1 @@
execute at @s run summon firework_rocket ~ ~ ~ {LifeTime:30,FireworksItem:{id:firework_rocket,Count:1,tag:{Fireworks:{Explosions:[{Type:0,Flicker:1b,Colors:[I;12518918],FadeColors:[I;4400129]},{Type:1,Trail:1b,Colors:[I;5374501],FadeColors:[I;12845076]}]}}}}

View File

@ -0,0 +1,3 @@
schedule clear malloc:fx/anchors/reset
execute as @e[tag=fx] run function malloc:fx/anchors/show
execute as @e[tag=fx] run schedule function malloc:fx/anchors/reset 120s

View File

@ -0,0 +1,10 @@
execute as @e[scores={m_fireworks=1..},tag=fx-purple] run function malloc:fx/fireworks/purple
execute as @e[scores={m_fireworks=1..},tag=fx-purple] run scoreboard players remove @s m_fireworks 1
execute as @e[scores={m_fireworks=1..},tag=fx-red] run function malloc:fx/fireworks/red
execute as @e[scores={m_fireworks=1..},tag=fx-red] run scoreboard players remove @s m_fireworks 1
execute as @e[scores={m_fireworks=1..},tag=fx-green] run function malloc:fx/fireworks/green
execute as @e[scores={m_fireworks=1..},tag=fx-green] run scoreboard players remove @s m_fireworks 1
execute as @e[scores={m_fireworks=1..},tag=fx-blue] run function malloc:fx/fireworks/blue
execute as @e[scores={m_fireworks=1..},tag=fx-blue] run scoreboard players remove @s m_fireworks 1
execute as @e[scores={m_fireworks=1..}] run function malloc:fx/fireworks/purple
execute as @e[scores={m_fireworks=1..}] run scoreboard players remove @s m_fireworks 1

View File

@ -0,0 +1 @@
scoreboard objectives add m_fireworks dummy "Fireworks"

View File

@ -0,0 +1,6 @@
execute if entity @e[scores={m_fireworks=1..}] run function malloc:fx/launch_fireworks
execute as @e[name="malloc-fx-red"] run function malloc:fx/anchors/set_red
execute as @e[name="malloc-fx-blue"] run function malloc:fx/anchors/set_blue
execute as @e[name="malloc-fx-green"] run function malloc:fx/anchors/set_green
execute as @e[name="malloc-fx-purple"] run function malloc:fx/anchors/set_purple
schedule function malloc:fx/tick 1s

View File

@ -0,0 +1,2 @@
execute as @e[tag=fx] run function malloc:fx/anchors/reset

View File

@ -0,0 +1 @@
give @s wooden_sword{display:{Name:'{"text":"Bludgeon","color":"blue","bold":true,"italic":true}',Lore:['{"text":"Rare","color":"blue"}','{"text":"A bloody relic","color":"gray","italic":true}','{"text":"Season 3","color":"dark_purple"}']},RepairCost:99,CustomModelData:8284,AttributeModifiers:[{AttributeName:"generic.attack_damage",Name:"generic.attack_damage",Amount:2,Operation:0,UUID:[I;277762057,1843874502,-2058544209,453642984],Slot:"mainhand"},{AttributeName:"generic.max_health",Name:"generic.max_health",Amount:4,Operation:0,UUID:[I;1041819270,604653856,-1844031430,-190298056]},{AttributeName:"generic.follow_range",Name:"generic.follow_range",Amount:1,Operation:1,UUID:[I;733014868,1590578713,-1362821392,1988032686]},{AttributeName:"generic.movement_speed",Name:"generic.movement_speed",Amount:0.9,Operation:1,UUID:[I;-1192160407,-1558295472,-1980745157,-1863666218]}]} 1

View File

@ -0,0 +1 @@
give @s wooden_axe{display:{Name:'{"text":"Mandatory Half-Door","color":"blue","bold":true,"italic":true}',Lore:['{"text":"Common","color":"gray"}','{"text":"Happy MFHDW! Or else.","color":"gray","italic":true}','{"text":"Ancient Lore","color":"dark_purple"}']},HideFlags:2,2885,AttributeModifiers:[{AttributeName:"generic.luck",Name:"generic.luck",Amount:1,Operation:0,UUID:[I;324001315,-821342605,-1596038948,305830992]},{AttributeName:"generic.attack_damage",Name:"generic.attack_damage",Amount:0,Operation:1,UUID:[I;-1471006602,1256541172,-1508003833,-176671147]}]} 1

View File

@ -0,0 +1,10 @@
scoreboard objectives add m_tick_seconds dummy "Event Clock (Seconds)"
scoreboard objectives add m_countdown dummy "Event Countdown (Seconds)"
scoreboard objectives add m_countdown_clocked dummy "Event Countdown (Clocked)"
scoreboard players set m_everybody m_tick_seconds 0
scoreboard players set m_everybody m_countdown 0
scoreboard players set m_everybody m_countdown_clocked 0
bossbar add malloc:countdown "Countdown"
bossbar set malloc:countdown visible false
bossbar set malloc:countdown color purple

View File

@ -0,0 +1,7 @@
execute unless score m_everybody m_countdown matches ..0 run scoreboard players remove m_everybody m_countdown 1
bossbar set malloc:countdown players @p
execute if score m_everybody m_countdown matches 1.. run bossbar set malloc:countdown visible true
execute store result bossbar malloc:countdown value run scoreboard players get m_everybody m_countdown
scoreboard players operation m_everybody m_countdown_clocked = m_everybody m_countdown
schedule function malloc:ticks/on_countdown 1s
schedule function malloc:ticks/reset_countdown_clock 1t

View File

@ -0,0 +1,2 @@
schedule function malloc:ticks/on_second 1s
scoreboard players add m_everybody m_tick_seconds 20

View File

@ -0,0 +1 @@
scoreboard players set m_everybody m_countdown_clocked 0

View File

@ -0,0 +1,3 @@
execute if score m_everybody m_tick_seconds matches 20 run scoreboard players reset m_everybody m_tick_seconds
execute unless score m_everybody m_tick_seconds matches 20 run scoreboard players add m_everybody m_tick_seconds 1
schedule function malloc:ticks/tick 1t

View File

@ -0,0 +1,2 @@
scoreboard objectives remove m_tick_seconds
schedule clear malloc:tick/tick

View File

@ -0,0 +1,46 @@
{
"type": "minecraft:empty",
"pools": [
{
"rolls": 1,
"bonus_rolls": 0,
"entries": [
{
"type": "minecraft:item",
"name": "minecraft:iron_nugget",
"functions": [
{
"function": "minecraft:set_nbt",
"tag": "{malloc: {coinValue:1}}"
},
{
"function": "minecraft:set_name",
"entity": "this",
"name": "Grist"
},
{
"function": "minecraft:set_lore",
"entity": "this",
"lore": [
{
"text": "Common"
},
{
"text": "A familiar currency"
},
{
"text": "Ancient Lore",
"color": "dark_purple"
}
]
},
{
"function": "minecraft:set_nbt",
"tag": "{CustomModelData:93197}"
}
]
}
]
}
]
}

View File

@ -0,0 +1,84 @@
{
"type": "minecraft:empty",
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "minecraft:wooden_sword",
"functions": [
{
"function": "minecraft:set_name",
"name": {
"text": "Dagger",
"color": "green"
}
},
{
"function": "minecraft:set_lore",
"lore": [
{
"text": "Uncommon",
"color": "green"
},
{
"text": "A bloody relic",
"color": "gray"
},
{
"text": "Season 3",
"color": "dark_purple"
}
]
},
{
"function": "minecraft:set_nbt",
"tag": "{RepairCost:99,CustomModelData:92197}"
},
{
"function": "minecraft:set_attributes",
"modifiers": [
{
"attribute": "minecraft:generic.movement_speed",
"name": "",
"amount": 0.9,
"operation": "multiply_base",
"slot": "mainhand"
},
{
"attribute": "minecraft:generic.follow_range",
"name": "",
"amount": 4,
"operation": "multiply_base",
"slot": "mainhand"
},
{
"attribute": "minecraft:generic.max_health",
"name": "",
"amount": 4,
"operation": "addition",
"slot": "mainhand"
},
{
"attribute": "minecraft:generic.attack_damage",
"name": "",
"amount": 3,
"operation": "addition",
"slot": "mainhand"
},
{
"attribute": "minecraft:generic.knockback_resistance",
"name": "",
"amount": 0.8,
"operation": "multiply_base",
"slot": "mainhand"
}
]
}
]
}
]
}
]
}

View File

@ -0,0 +1,46 @@
{
"type": "minecraft:empty",
"pools": [
{
"rolls": 1,
"bonus_rolls": 0,
"entries": [
{
"type": "minecraft:item",
"name": "minecraft:iron_nugget",
"functions": [
{
"function": "minecraft:set_nbt",
"tag": "{malloc: {coinValue:1}}"
},
{
"function": "minecraft:set_name",
"entity": "this",
"name": "Grist"
},
{
"function": "minecraft:set_lore",
"entity": "this",
"lore": [
{
"text": "Common"
},
{
"text": "A familiar currency"
},
{
"text": "Ancient Lore",
"color": "dark_purple"
}
]
},
{
"function": "minecraft:set_nbt",
"tag": "{CustomModelData:93197}"
}
]
}
]
}
]
}

View File

@ -0,0 +1,4 @@
{
"condition": "minecraft:random_chance",
"chance": 0.15
}

View File

@ -0,0 +1,53 @@
{
"type": "minecraft:block",
"pools": [
{
"rolls": 1,
"bonus_rolls": 0,
"entries": [
{
"type": "minecraft:alternatives",
"children": [
{
"type": "minecraft:item",
"name": "minecraft:stone",
"conditions": [
{
"condition": "minecraft:match_tool",
"predicate": {
"enchantments": [
{
"enchantment": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
]
},
{
"type": "minecraft:group",
"children": [
{
"type": "minecraft:loot_table",
"name": "malloc:items/grist_coin"
},
{
"type": "minecraft:item",
"name": "minecraft:cobblestone"
}
],
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
]
}
]
}
]
}
]
}

View File

@ -0,0 +1,80 @@
{
"type": "minecraft:entity",
"pools": [
{
"rolls": 1,
"bonus_rolls": 0,
"entries": [
{
"type": "minecraft:item",
"name": "minecraft:gunpowder",
"functions": [
{
"function": "minecraft:set_count",
"count": {
"type": "minecraft:uniform",
"min": 0,
"max": 2
},
"add": false
},
{
"function": "minecraft:looting_enchant",
"count": {
"type": "minecraft:uniform",
"min": 0,
"max": 1
}
}
]
},
{
"type": "minecraft:loot_table",
"name": "malloc:items/grist_coin",
"functions": [
{
"function": "minecraft:set_count",
"count": {
"min": 5,
"max": 15
}
},
{
"function": "minecraft:looting_enchant",
"count": {
"type": "minecraft:uniform",
"min": 5,
"max": 15
}
}
],
"conditions": [
{
"condition": "minecraft:killed_by_player"
}
]
}
]
},
{
"rolls": 1,
"bonus_rolls": 0,
"entries": [
{
"type": "minecraft:tag",
"name": "minecraft:creeper_drop_music_discs",
"expand": true
}
],
"conditions": [
{
"condition": "minecraft:entity_properties",
"entity": "killer",
"predicate": {
"type": "#minecraft:skeletons"
}
}
]
}
]
}

View File

@ -0,0 +1,9 @@
{
"values": [
"malloc:ticks/load",
"malloc:ticks/tick",
"malloc:ticks/on_countdown",
"malloc:fx/load",
"malloc:fx/tick"
]
}

6
pack.mcmeta Normal file
View File

@ -0,0 +1,6 @@
{
"pack": {
"pack_format": 10,
"description": "Malloc Minecraft Item Functions"
}
}