From c13c4bbd8509c203f4f62c514910e259b3cff2c6 Mon Sep 17 00:00:00 2001 From: Victoria Fierce Date: Sat, 10 Sep 2022 14:28:27 +0200 Subject: [PATCH] Initial commit --- README.md | 9 ++ .../functions/fx/anchors/new.mcfunction | 4 + .../functions/fx/anchors/reset.mcfunction | 1 + .../fx/anchors/reset_tags.mcfunction | 5 ++ .../functions/fx/anchors/set_blue.mcfunction | 5 ++ .../functions/fx/anchors/set_green.mcfunction | 5 ++ .../fx/anchors/set_purple.mcfunction | 5 ++ .../functions/fx/anchors/set_red.mcfunction | 5 ++ .../functions/fx/anchors/show.mcfunction | 2 + .../functions/fx/fireworks/blue.mcfunction | 1 + .../functions/fx/fireworks/green.mcfunction | 1 + .../functions/fx/fireworks/purple.mcfunction | 1 + .../functions/fx/fireworks/red.mcfunction | 1 + .../functions/fx/highlight_fx.mcfunction | 3 + .../functions/fx/launch_fireworks.mcfunction | 10 +++ data/malloc/functions/fx/load.mcfunction | 1 + data/malloc/functions/fx/tick.mcfunction | 6 ++ data/malloc/functions/hide_fx.mcfunction | 2 + data/malloc/functions/items/bludgeon.json | 1 + data/malloc/functions/items/half-door.json | 1 + data/malloc/functions/ticks/load.mcfunction | 10 +++ .../functions/ticks/on_countdown.mcfunction | 7 ++ .../functions/ticks/on_second.mcfunction | 2 + .../ticks/reset_countdown_clock.mcfunction | 1 + data/malloc/functions/ticks/tick.mcfunction | 3 + .../functions/ticks/uninstall.mcfunction | 2 + .../loot_tables/functions/grist_coin.json | 46 ++++++++++ data/malloc/loot_tables/items/dagger.json | 84 +++++++++++++++++++ data/malloc/loot_tables/items/grist_coin.json | 46 ++++++++++ data/malloc/predicate/fx/rng_trigger.json | 4 + data/minecraft/loot_tables/blocks/stone.json | 53 ++++++++++++ .../loot_tables/entities/creeper.json | 80 ++++++++++++++++++ data/minecraft/tags/functions/load.json | 9 ++ pack.mcmeta | 6 ++ 34 files changed, 422 insertions(+) create mode 100644 README.md create mode 100644 data/malloc/functions/fx/anchors/new.mcfunction create mode 100644 data/malloc/functions/fx/anchors/reset.mcfunction create mode 100644 data/malloc/functions/fx/anchors/reset_tags.mcfunction create mode 100644 data/malloc/functions/fx/anchors/set_blue.mcfunction create mode 100644 data/malloc/functions/fx/anchors/set_green.mcfunction create mode 100644 data/malloc/functions/fx/anchors/set_purple.mcfunction create mode 100644 data/malloc/functions/fx/anchors/set_red.mcfunction create mode 100644 data/malloc/functions/fx/anchors/show.mcfunction create mode 100644 data/malloc/functions/fx/fireworks/blue.mcfunction create mode 100644 data/malloc/functions/fx/fireworks/green.mcfunction create mode 100644 data/malloc/functions/fx/fireworks/purple.mcfunction create mode 100644 data/malloc/functions/fx/fireworks/red.mcfunction create mode 100644 data/malloc/functions/fx/highlight_fx.mcfunction create mode 100644 data/malloc/functions/fx/launch_fireworks.mcfunction create mode 100644 data/malloc/functions/fx/load.mcfunction create mode 100644 data/malloc/functions/fx/tick.mcfunction create mode 100644 data/malloc/functions/hide_fx.mcfunction create mode 100644 data/malloc/functions/items/bludgeon.json create mode 100644 data/malloc/functions/items/half-door.json create mode 100644 data/malloc/functions/ticks/load.mcfunction create mode 100644 data/malloc/functions/ticks/on_countdown.mcfunction create mode 100644 data/malloc/functions/ticks/on_second.mcfunction create mode 100644 data/malloc/functions/ticks/reset_countdown_clock.mcfunction create mode 100644 data/malloc/functions/ticks/tick.mcfunction create mode 100644 data/malloc/functions/ticks/uninstall.mcfunction create mode 100644 data/malloc/loot_tables/functions/grist_coin.json create mode 100644 data/malloc/loot_tables/items/dagger.json create mode 100644 data/malloc/loot_tables/items/grist_coin.json create mode 100644 data/malloc/predicate/fx/rng_trigger.json create mode 100644 data/minecraft/loot_tables/blocks/stone.json create mode 100644 data/minecraft/loot_tables/entities/creeper.json create mode 100644 data/minecraft/tags/functions/load.json create mode 100644 pack.mcmeta diff --git a/README.md b/README.md new file mode 100644 index 0000000..b91f9f0 --- /dev/null +++ b/README.md @@ -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 diff --git a/data/malloc/functions/fx/anchors/new.mcfunction b/data/malloc/functions/fx/anchors/new.mcfunction new file mode 100644 index 0000000..2e3ceb9 --- /dev/null +++ b/data/malloc/functions/fx/anchors/new.mcfunction @@ -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}'} diff --git a/data/malloc/functions/fx/anchors/reset.mcfunction b/data/malloc/functions/fx/anchors/reset.mcfunction new file mode 100644 index 0000000..fbd7bd1 --- /dev/null +++ b/data/malloc/functions/fx/anchors/reset.mcfunction @@ -0,0 +1 @@ +data merge entity @s {ArmorItems:[],CustomNameVisible:0b,NoGravity:1b,Silent:1b,Invulnerable:1b,ShowArms:1b,Marker:1b,Invisible:1b,DisabledSlots:4144959} diff --git a/data/malloc/functions/fx/anchors/reset_tags.mcfunction b/data/malloc/functions/fx/anchors/reset_tags.mcfunction new file mode 100644 index 0000000..16790ef --- /dev/null +++ b/data/malloc/functions/fx/anchors/reset_tags.mcfunction @@ -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 diff --git a/data/malloc/functions/fx/anchors/set_blue.mcfunction b/data/malloc/functions/fx/anchors/set_blue.mcfunction new file mode 100644 index 0000000..18454d6 --- /dev/null +++ b/data/malloc/functions/fx/anchors/set_blue.mcfunction @@ -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 diff --git a/data/malloc/functions/fx/anchors/set_green.mcfunction b/data/malloc/functions/fx/anchors/set_green.mcfunction new file mode 100644 index 0000000..8ba112c --- /dev/null +++ b/data/malloc/functions/fx/anchors/set_green.mcfunction @@ -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 diff --git a/data/malloc/functions/fx/anchors/set_purple.mcfunction b/data/malloc/functions/fx/anchors/set_purple.mcfunction new file mode 100644 index 0000000..8f6d1bd --- /dev/null +++ b/data/malloc/functions/fx/anchors/set_purple.mcfunction @@ -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 diff --git a/data/malloc/functions/fx/anchors/set_red.mcfunction b/data/malloc/functions/fx/anchors/set_red.mcfunction new file mode 100644 index 0000000..ba649b0 --- /dev/null +++ b/data/malloc/functions/fx/anchors/set_red.mcfunction @@ -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 diff --git a/data/malloc/functions/fx/anchors/show.mcfunction b/data/malloc/functions/fx/anchors/show.mcfunction new file mode 100644 index 0000000..9475f32 --- /dev/null +++ b/data/malloc/functions/fx/anchors/show.mcfunction @@ -0,0 +1,2 @@ +function malloc:fx/anchors/reset +data merge entity @s {CustomNameVisible:1b,Marker:0b,Invisible:1b,Glowing:1b} diff --git a/data/malloc/functions/fx/fireworks/blue.mcfunction b/data/malloc/functions/fx/fireworks/blue.mcfunction new file mode 100644 index 0000000..90e034b --- /dev/null +++ b/data/malloc/functions/fx/fireworks/blue.mcfunction @@ -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]}]}}}} diff --git a/data/malloc/functions/fx/fireworks/green.mcfunction b/data/malloc/functions/fx/fireworks/green.mcfunction new file mode 100644 index 0000000..8b5f5c4 --- /dev/null +++ b/data/malloc/functions/fx/fireworks/green.mcfunction @@ -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]}]}}}} diff --git a/data/malloc/functions/fx/fireworks/purple.mcfunction b/data/malloc/functions/fx/fireworks/purple.mcfunction new file mode 100644 index 0000000..e805281 --- /dev/null +++ b/data/malloc/functions/fx/fireworks/purple.mcfunction @@ -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]}]}}}} diff --git a/data/malloc/functions/fx/fireworks/red.mcfunction b/data/malloc/functions/fx/fireworks/red.mcfunction new file mode 100644 index 0000000..f3e16ee --- /dev/null +++ b/data/malloc/functions/fx/fireworks/red.mcfunction @@ -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]}]}}}} diff --git a/data/malloc/functions/fx/highlight_fx.mcfunction b/data/malloc/functions/fx/highlight_fx.mcfunction new file mode 100644 index 0000000..dd910cc --- /dev/null +++ b/data/malloc/functions/fx/highlight_fx.mcfunction @@ -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 diff --git a/data/malloc/functions/fx/launch_fireworks.mcfunction b/data/malloc/functions/fx/launch_fireworks.mcfunction new file mode 100644 index 0000000..fd536d2 --- /dev/null +++ b/data/malloc/functions/fx/launch_fireworks.mcfunction @@ -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 diff --git a/data/malloc/functions/fx/load.mcfunction b/data/malloc/functions/fx/load.mcfunction new file mode 100644 index 0000000..9a51f7a --- /dev/null +++ b/data/malloc/functions/fx/load.mcfunction @@ -0,0 +1 @@ +scoreboard objectives add m_fireworks dummy "Fireworks" diff --git a/data/malloc/functions/fx/tick.mcfunction b/data/malloc/functions/fx/tick.mcfunction new file mode 100644 index 0000000..03c6d72 --- /dev/null +++ b/data/malloc/functions/fx/tick.mcfunction @@ -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 diff --git a/data/malloc/functions/hide_fx.mcfunction b/data/malloc/functions/hide_fx.mcfunction new file mode 100644 index 0000000..5875ec5 --- /dev/null +++ b/data/malloc/functions/hide_fx.mcfunction @@ -0,0 +1,2 @@ +execute as @e[tag=fx] run function malloc:fx/anchors/reset + diff --git a/data/malloc/functions/items/bludgeon.json b/data/malloc/functions/items/bludgeon.json new file mode 100644 index 0000000..de64d1d --- /dev/null +++ b/data/malloc/functions/items/bludgeon.json @@ -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 diff --git a/data/malloc/functions/items/half-door.json b/data/malloc/functions/items/half-door.json new file mode 100644 index 0000000..49e3263 --- /dev/null +++ b/data/malloc/functions/items/half-door.json @@ -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 diff --git a/data/malloc/functions/ticks/load.mcfunction b/data/malloc/functions/ticks/load.mcfunction new file mode 100644 index 0000000..59e79b9 --- /dev/null +++ b/data/malloc/functions/ticks/load.mcfunction @@ -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 diff --git a/data/malloc/functions/ticks/on_countdown.mcfunction b/data/malloc/functions/ticks/on_countdown.mcfunction new file mode 100644 index 0000000..935917b --- /dev/null +++ b/data/malloc/functions/ticks/on_countdown.mcfunction @@ -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 diff --git a/data/malloc/functions/ticks/on_second.mcfunction b/data/malloc/functions/ticks/on_second.mcfunction new file mode 100644 index 0000000..1ae13ae --- /dev/null +++ b/data/malloc/functions/ticks/on_second.mcfunction @@ -0,0 +1,2 @@ +schedule function malloc:ticks/on_second 1s +scoreboard players add m_everybody m_tick_seconds 20 diff --git a/data/malloc/functions/ticks/reset_countdown_clock.mcfunction b/data/malloc/functions/ticks/reset_countdown_clock.mcfunction new file mode 100644 index 0000000..7c24a78 --- /dev/null +++ b/data/malloc/functions/ticks/reset_countdown_clock.mcfunction @@ -0,0 +1 @@ +scoreboard players set m_everybody m_countdown_clocked 0 diff --git a/data/malloc/functions/ticks/tick.mcfunction b/data/malloc/functions/ticks/tick.mcfunction new file mode 100644 index 0000000..ce8c82d --- /dev/null +++ b/data/malloc/functions/ticks/tick.mcfunction @@ -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 diff --git a/data/malloc/functions/ticks/uninstall.mcfunction b/data/malloc/functions/ticks/uninstall.mcfunction new file mode 100644 index 0000000..bf24596 --- /dev/null +++ b/data/malloc/functions/ticks/uninstall.mcfunction @@ -0,0 +1,2 @@ +scoreboard objectives remove m_tick_seconds +schedule clear malloc:tick/tick diff --git a/data/malloc/loot_tables/functions/grist_coin.json b/data/malloc/loot_tables/functions/grist_coin.json new file mode 100644 index 0000000..b3c0322 --- /dev/null +++ b/data/malloc/loot_tables/functions/grist_coin.json @@ -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}" + } + ] + } + ] + } + ] +} diff --git a/data/malloc/loot_tables/items/dagger.json b/data/malloc/loot_tables/items/dagger.json new file mode 100644 index 0000000..3d3decf --- /dev/null +++ b/data/malloc/loot_tables/items/dagger.json @@ -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" + } + ] + } + ] + } + ] + } + ] +} diff --git a/data/malloc/loot_tables/items/grist_coin.json b/data/malloc/loot_tables/items/grist_coin.json new file mode 100644 index 0000000..b3c0322 --- /dev/null +++ b/data/malloc/loot_tables/items/grist_coin.json @@ -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}" + } + ] + } + ] + } + ] +} diff --git a/data/malloc/predicate/fx/rng_trigger.json b/data/malloc/predicate/fx/rng_trigger.json new file mode 100644 index 0000000..af4cb2b --- /dev/null +++ b/data/malloc/predicate/fx/rng_trigger.json @@ -0,0 +1,4 @@ +{ + "condition": "minecraft:random_chance", + "chance": 0.15 +} diff --git a/data/minecraft/loot_tables/blocks/stone.json b/data/minecraft/loot_tables/blocks/stone.json new file mode 100644 index 0000000..8cc7034 --- /dev/null +++ b/data/minecraft/loot_tables/blocks/stone.json @@ -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" + } + ] + } + ] + } + ] + } + ] +} diff --git a/data/minecraft/loot_tables/entities/creeper.json b/data/minecraft/loot_tables/entities/creeper.json new file mode 100644 index 0000000..5d96066 --- /dev/null +++ b/data/minecraft/loot_tables/entities/creeper.json @@ -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" + } + } + ] + } + ] +} diff --git a/data/minecraft/tags/functions/load.json b/data/minecraft/tags/functions/load.json new file mode 100644 index 0000000..c873dfe --- /dev/null +++ b/data/minecraft/tags/functions/load.json @@ -0,0 +1,9 @@ +{ + "values": [ + "malloc:ticks/load", + "malloc:ticks/tick", + "malloc:ticks/on_countdown", + "malloc:fx/load", + "malloc:fx/tick" + ] +} diff --git a/pack.mcmeta b/pack.mcmeta new file mode 100644 index 0000000..7a04f0f --- /dev/null +++ b/pack.mcmeta @@ -0,0 +1,6 @@ +{ + "pack": { + "pack_format": 10, + "description": "Malloc Minecraft Item Functions" + } +}