From cc56263f95a89eaa22b1a8579f79a793c18c0de3 Mon Sep 17 00:00:00 2001 From: OraneUtan Date: Sun, 17 May 2020 19:46:21 +0200 Subject: [PATCH 01/58] Split datapack_utils.py --- build/datapack_utils.py | 34 ----------------------------- build/{ => minecraft}/loot_table.py | 0 build/minecraft/utils.py | 16 ++++++++++++++ build/utils.py | 19 ++++++++++++++++ 4 files changed, 35 insertions(+), 34 deletions(-) delete mode 100644 build/datapack_utils.py rename build/{ => minecraft}/loot_table.py (100%) create mode 100644 build/minecraft/utils.py create mode 100644 build/utils.py diff --git a/build/datapack_utils.py b/build/datapack_utils.py deleted file mode 100644 index 1e9fecb..0000000 --- a/build/datapack_utils.py +++ /dev/null @@ -1,34 +0,0 @@ -import os, json, re, itertools -from functools import reduce - -def get_files_in(path, re_filename=None, extension=None): - """Returns and filters files contained in a folder recursively""" - listOfFiles = list() - for (dirpath, dirnames, filenames) in os.walk(path): - for filename in filenames: - if re_filename and not re.match(re_filename, filename): - continue - listOfFiles.append(os.path.join(dirpath, filename)) - - if extension: - listOfFiles = [file for file in listOfFiles if os.path.splitext(file)[1] == extension] - - return listOfFiles - -def filename_from_path(path): - """ Extracts the filename without the extension from a path """ - return os.path.splitext(os.path.basename(path))[0] - -def get_mc_name(path, basedir): - segments = os.path.normpath(path).split(os.path.sep) - for segment in segments: - segments = segments[1:] - if segment == basedir: - break - return os.path.splitext(reduce((lambda a,b: a+'/'+b), segments))[0] - -def get_ingame_path(path, pack_name): - """ Get ingame path of resource """ - path_segments = os.path.splitext(os.path.normpath(path))[0].split(os.path.sep) - ingame_path_segments = path_segments[path_segments.index(pack_name):] - return ingame_path_segments[0] + ':' + reduce((lambda a,b: a + '/' + b), ingame_path_segments[2:]) \ No newline at end of file diff --git a/build/loot_table.py b/build/minecraft/loot_table.py similarity index 100% rename from build/loot_table.py rename to build/minecraft/loot_table.py diff --git a/build/minecraft/utils.py b/build/minecraft/utils.py new file mode 100644 index 0000000..e1d5434 --- /dev/null +++ b/build/minecraft/utils.py @@ -0,0 +1,16 @@ +import os, json, re, itertools +from functools import reduce + +def get_mc_name(path, basedir): + segments = os.path.normpath(path).split(os.path.sep) + for segment in segments: + segments = segments[1:] + if segment == basedir: + break + return os.path.splitext(reduce((lambda a,b: a+'/'+b), segments))[0] + +def get_ingame_path(path, pack_name): + """ Get ingame path of resource """ + path_segments = os.path.splitext(os.path.normpath(path))[0].split(os.path.sep) + ingame_path_segments = path_segments[path_segments.index(pack_name):] + return ingame_path_segments[0] + ':' + reduce((lambda a,b: a + '/' + b), ingame_path_segments[2:]) \ No newline at end of file diff --git a/build/utils.py b/build/utils.py new file mode 100644 index 0000000..db3796f --- /dev/null +++ b/build/utils.py @@ -0,0 +1,19 @@ +import os, re + +def get_files_in(path, re_filename=None, extension=None): + """Returns and filters files contained in a folder recursively""" + listOfFiles = list() + for (dirpath, dirnames, filenames) in os.walk(path): + for filename in filenames: + if re_filename and not re.match(re_filename, filename): + continue + listOfFiles.append(os.path.join(dirpath, filename)) + + if extension: + listOfFiles = [file for file in listOfFiles if os.path.splitext(file)[1] == extension] + + return listOfFiles + +def filename_from_path(path): + """ Extracts the filename without the extension from a path """ + return os.path.splitext(os.path.basename(path))[0] \ No newline at end of file From cb15ca6ec30570d4e04d4d2ddbfc2d15fffe18f7 Mon Sep 17 00:00:00 2001 From: OraneUtan Date: Tue, 19 May 2020 12:02:13 +0200 Subject: [PATCH 02/58] Added central registry of all hat types Instead of having to work on multiple files when adding new hats, this registry in combination with the build scripts are going to centralize that workflow --- hat_registry.yml | 77 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 hat_registry.yml diff --git a/hat_registry.yml b/hat_registry.yml new file mode 100644 index 0000000..3bc84ce --- /dev/null +++ b/hat_registry.yml @@ -0,0 +1,77 @@ +categories: + - "*": + - fez: { custom_model_data: 3000 } + - squid: { custom_model_data: 3001 } + - arrow: { custom_model_data: 3002 } + - frying_pan: { custom_model_data: 3003 } + + - tophats: + - white: { custom_model_data: 3100 } + - orange: { custom_model_data: 3101 } + - magenta: { custom_model_data: 3102 } + - light_blue: { custom_model_data: 3103 } + - yellow: { custom_model_data: 3104 } + - lime: { custom_model_data: 3105 } + - pink: { custom_model_data: 3106 } + - gray: { custom_model_data: 3107 } + - light_gray: { custom_model_data: 3108 } + - cyan: { custom_model_data: 3109 } + - purple: { custom_model_data: 3110 } + - blue: { custom_model_data: 3111 } + - brown: { custom_model_data: 3112 } + - green: { custom_model_data: 3113 } + - red: { custom_model_data: 3114 } + - black: { custom_model_data: 3115 } + - rainbow: { custom_model_data: 3116 } + - black_monocle: { custom_model_data: 3117 } + + - cats: + - ocelot: { custom_model_data: 3120 } + - tabby: { custom_model_data: 3121 } + - tuxedo: { custom_model_data: 3122 } + - red: { custom_model_data: 3123 } + - siamese: { custom_model_data: 3124 } + - british_shorthair: { custom_model_data: 3125 } + - calico: { custom_model_data: 3126 } + - persian: { custom_model_data: 3127 } + - ragdoll: { custom_model_data: 3128 } + - white: { custom_model_data: 3129 } + - jellie: { custom_model_data: 3130 } + - black: { custom_model_data: 3131 } + + - glasses: + - sunglasses: { custom_model_data: 3140 } + - harry_potter: { custom_model_data: 3141 } + - half_rim: { custom_model_data: 3142 } + - rainbow: { custom_model_data: 3143 } + - librarian: { custom_model_data: 3144 } + - three_d: { custom_model_data: 3145 } + + - accessories: + - ninja_headband: { custom_model_data: 3150 } + - steve_mask: { custom_model_data: 3151 } + - alex_mask: { custom_model_data: 3152 } + - snorkel_mask_blue: { custom_model_data: 3153 } + - snorkel_mask_red: { custom_model_data: 3154 } + - googly_eyes: { custom_model_data: 3155 } + + - villager: + - armorer: { custom_model_data: 3160 } + - farmer: { custom_model_data: 3161 } + - nose: { custom_model_data: 3162 } + + - mario: + - mario_cap: { custom_model_data: 3170 } + - luigi_cap: { custom_model_data: 3171 } + - cappy: { custom_model_data: 3172 } + - toad_red: { custom_model_data: 3173 } + - toad_blue: { custom_model_data: 3174 } + - toad_yellow: { custom_model_data: 3175 } + - toad_green: { custom_model_data: 3176 } + - mario: { custom_model_data: 3177 } + - luigi: { custom_model_data: 3178 } + + - halloween: + - wiggly_ghast: { custom_model_data: 7773180 } + - native_american_headband: { custom_model_data: 7773181 } + - jason_mask: { custom_model_data: 7773182 } From 63d0a0fab86ee46ef833e3771bbfae33e224cdc6 Mon Sep 17 00:00:00 2001 From: OraneUtan Date: Tue, 19 May 2020 12:18:16 +0200 Subject: [PATCH 03/58] Added build script that generates the models of the base items --- build/generate_base_item_models.py | 70 +++++++++++++++ .../minecraft/models/item/leather_helmet.json | 86 +------------------ .../assets/minecraft/models/item/stick.json | 85 +----------------- 3 files changed, 72 insertions(+), 169 deletions(-) create mode 100644 build/generate_base_item_models.py diff --git a/build/generate_base_item_models.py b/build/generate_base_item_models.py new file mode 100644 index 0000000..732ff4f --- /dev/null +++ b/build/generate_base_item_models.py @@ -0,0 +1,70 @@ +# Generates the item models which are used as the base for all hats. +# Each model is overwritten with custom hat models depending on the items custom model data. + +import yaml, json +from dataclasses import dataclass + +@dataclass +class Hat: + name: str + category: str + custom_model_data: int + model_path: str + type: str + translation: str + +def load_yaml_file(path): + with open(path) as file: + return yaml.load(file, Loader=yaml.Loader) + +def hats_from_categories(categories): + """ Takes a list of category dicts each with a list of hat dicts and converts it to one list of hats """ + for category_name, category_hats in map(lambda category: list(category.items())[0], categories): + for hat_name, hat_data in map(lambda category_entry: list(category_entry.items())[0], category_hats): + custom_model_data = hat_data['custom_model_data'] + + if category_name == "*": + # Category "*" contains all uncategorized hats -> don't add a category to any paths + model = f"item/hats/{hat_name}" + type = f"hats.hat.type.{hat_name}" + translation = f"item.hats.{hat_name}" + else: + model = f"item/hats/{category_name}/{hat_name}" + type = f"hats.hat.type.{category_name}.{hat_name}" + translation = f"item.hats.{category_name}.{hat_name}" + yield Hat(hat_name, category_name, custom_model_data, model, type, translation) + +def minecraft_item_model_overwrite(custom_model_data, model_path): + """ Creates a custom model overwrite for minecraft item models """ + return { "predicate": { "custom_model_data": custom_model_data }, "model": model_path } + +def minecraft_item_model(base_model, overrides=None): + """ Creates a minecraft item model """ + if overrides: + base_model['overrides'] = overrides + return base_model + +registry = load_yaml_file("hat_registry.yml") +hats = list(hats_from_categories(registry['categories'])) +overrides = [minecraft_item_model_overwrite(hat.custom_model_data, hat.model_path) for hat in hats] + +# Create item model for hats +with open("resourcepack/assets/minecraft/models/item/leather_helmet.json", "w+") as file: + leather_helmet = minecraft_item_model({ + "parent": "item/generated", + "textures": { + "layer0": "item/leather_helmet", + "layer1": "item/leather_helmet_overlay" + } + }, overrides) + json.dump(leather_helmet, file, separators=(',', ':')) + +# Create item model for hats on entities heads +with open("resourcepack/assets/minecraft/models/item/stick.json", "w+") as file: + stick = minecraft_item_model({ + "parent": "item/handheld", + "textures": { + "layer0": "item/stick" + } + }, overrides) + json.dump(stick, file, separators=(',', ':')) \ No newline at end of file diff --git a/resourcepack/assets/minecraft/models/item/leather_helmet.json b/resourcepack/assets/minecraft/models/item/leather_helmet.json index ab69f23..2c28e95 100644 --- a/resourcepack/assets/minecraft/models/item/leather_helmet.json +++ b/resourcepack/assets/minecraft/models/item/leather_helmet.json @@ -1,85 +1 @@ -{ - "parent": "item/generated", - "textures": { - "layer0": "item/leather_helmet", - "layer1": "item/leather_helmet_overlay" - }, - "overrides": [ - { "_comment": "Miscellaneous", - "predicate": {"custom_model_data": 3000}, "model": "item/hats/fez"}, - { "predicate": {"custom_model_data": 3001}, "model": "item/hats/squid"}, - { "predicate": {"custom_model_data": 3002}, "model": "item/hats/arrow"}, - { "predicate": {"custom_model_data": 3003}, "model": "item/hats/frying_pan"}, - - { "_comment": "Tophats", - "predicate": {"custom_model_data": 3100}, "model": "item/hats/tophats/white"}, - { "predicate": {"custom_model_data": 3101}, "model": "item/hats/tophats/orange"}, - { "predicate": {"custom_model_data": 3102}, "model": "item/hats/tophats/magenta"}, - { "predicate": {"custom_model_data": 3103}, "model": "item/hats/tophats/light_blue"}, - { "predicate": {"custom_model_data": 3104}, "model": "item/hats/tophats/yellow"}, - { "predicate": {"custom_model_data": 3105}, "model": "item/hats/tophats/lime"}, - { "predicate": {"custom_model_data": 3106}, "model": "item/hats/tophats/pink"}, - { "predicate": {"custom_model_data": 3107}, "model": "item/hats/tophats/gray"}, - { "predicate": {"custom_model_data": 3108}, "model": "item/hats/tophats/light_gray"}, - { "predicate": {"custom_model_data": 3109}, "model": "item/hats/tophats/cyan"}, - { "predicate": {"custom_model_data": 3110}, "model": "item/hats/tophats/purple"}, - { "predicate": {"custom_model_data": 3111}, "model": "item/hats/tophats/blue"}, - { "predicate": {"custom_model_data": 3112}, "model": "item/hats/tophats/brown"}, - { "predicate": {"custom_model_data": 3113}, "model": "item/hats/tophats/green"}, - { "predicate": {"custom_model_data": 3114}, "model": "item/hats/tophats/red"}, - { "predicate": {"custom_model_data": 3115}, "model": "item/hats/tophats/black"}, - { "predicate": {"custom_model_data": 3116}, "model": "item/hats/tophats/rainbow"}, - { "predicate": {"custom_model_data": 3117}, "model": "item/hats/tophats/black_monocle"}, - - { "_comment": "Cats", - "predicate": {"custom_model_data": 3120}, "model": "item/hats/cats/ocelot"}, - { "predicate": {"custom_model_data": 3121}, "model": "item/hats/cats/tabby"}, - { "predicate": {"custom_model_data": 3122}, "model": "item/hats/cats/tuxedo"}, - { "predicate": {"custom_model_data": 3123}, "model": "item/hats/cats/red"}, - { "predicate": {"custom_model_data": 3124}, "model": "item/hats/cats/siamese"}, - { "predicate": {"custom_model_data": 3125}, "model": "item/hats/cats/british_shorthair"}, - { "predicate": {"custom_model_data": 3126}, "model": "item/hats/cats/calico"}, - { "predicate": {"custom_model_data": 3127}, "model": "item/hats/cats/persian"}, - { "predicate": {"custom_model_data": 3128}, "model": "item/hats/cats/ragdoll"}, - { "predicate": {"custom_model_data": 3129}, "model": "item/hats/cats/white"}, - { "predicate": {"custom_model_data": 3130}, "model": "item/hats/cats/jellie"}, - { "predicate": {"custom_model_data": 3131}, "model": "item/hats/cats/black"}, - - { "_comment": "Glasses", - "predicate": {"custom_model_data": 3140}, "model": "item/hats/glasses/sunglasses"}, - { "predicate": {"custom_model_data": 3141}, "model": "item/hats/glasses/harry_potter"}, - { "predicate": {"custom_model_data": 3142}, "model": "item/hats/glasses/half_rim"}, - { "predicate": {"custom_model_data": 3143}, "model": "item/hats/glasses/rainbow"}, - { "predicate": {"custom_model_data": 3144}, "model": "item/hats/glasses/librarian"}, - { "predicate": {"custom_model_data": 3145}, "model": "item/hats/glasses/three_d"}, - - { "_comment": "Accessories", - "predicate": {"custom_model_data": 3150}, "model": "item/hats/accessories/ninja_headband"}, - { "predicate": {"custom_model_data": 3151}, "model": "item/hats/accessories/steve_mask"}, - { "predicate": {"custom_model_data": 3152}, "model": "item/hats/accessories/alex_mask"}, - { "predicate": {"custom_model_data": 3153}, "model": "item/hats/accessories/snorkel_mask_blue"}, - { "predicate": {"custom_model_data": 3154}, "model": "item/hats/accessories/snorkel_mask_red"}, - { "predicate": {"custom_model_data": 3155}, "model": "item/hats/accessories/googly_eyes"}, - - { "_comment": "Villager related", - "predicate": {"custom_model_data": 3160}, "model": "item/hats/villager/armorer"}, - { "predicate": {"custom_model_data": 3161}, "model": "item/hats/villager/farmer"}, - { "predicate": {"custom_model_data": 3162}, "model": "item/hats/villager/nose"}, - - { "_comment": "Mario", - "predicate": {"custom_model_data": 3170}, "model": "item/hats/mario/mario_cap"}, - { "predicate": {"custom_model_data": 3171}, "model": "item/hats/mario/luigi_cap"}, - { "predicate": {"custom_model_data": 3172}, "model": "item/hats/mario/cappy"}, - { "predicate": {"custom_model_data": 3173}, "model": "item/hats/mario/toad_red"}, - { "predicate": {"custom_model_data": 3174}, "model": "item/hats/mario/toad_blue"}, - { "predicate": {"custom_model_data": 3175}, "model": "item/hats/mario/toad_yellow"}, - { "predicate": {"custom_model_data": 3176}, "model": "item/hats/mario/toad_green"}, - { "predicate": {"custom_model_data": 3177}, "model": "item/hats/mario/mario"}, - { "predicate": {"custom_model_data": 3178}, "model": "item/hats/mario/luigi"}, - - { "_comment": "Halloween", - "predicate": {"custom_model_data": 7773180}, "model": "item/hats/halloween/wiggly_ghast"}, - { "predicate": {"custom_model_data": 7773181}, "model": "item/hats/halloween/native_american_headband"}, - { "predicate": {"custom_model_data": 7773182}, "model": "item/hats/halloween/jason_mask"} - ] -} +{"parent":"item/generated","textures":{"layer0":"item/leather_helmet","layer1":"item/leather_helmet_overlay"},"overrides":[{"predicate":{"custom_model_data":3000},"model":"item/hats/fez"},{"predicate":{"custom_model_data":3001},"model":"item/hats/squid"},{"predicate":{"custom_model_data":3002},"model":"item/hats/arrow"},{"predicate":{"custom_model_data":3003},"model":"item/hats/frying_pan"},{"predicate":{"custom_model_data":3100},"model":"item/hats/tophats/white"},{"predicate":{"custom_model_data":3101},"model":"item/hats/tophats/orange"},{"predicate":{"custom_model_data":3102},"model":"item/hats/tophats/magenta"},{"predicate":{"custom_model_data":3103},"model":"item/hats/tophats/light_blue"},{"predicate":{"custom_model_data":3104},"model":"item/hats/tophats/yellow"},{"predicate":{"custom_model_data":3105},"model":"item/hats/tophats/lime"},{"predicate":{"custom_model_data":3106},"model":"item/hats/tophats/pink"},{"predicate":{"custom_model_data":3107},"model":"item/hats/tophats/gray"},{"predicate":{"custom_model_data":3108},"model":"item/hats/tophats/light_gray"},{"predicate":{"custom_model_data":3109},"model":"item/hats/tophats/cyan"},{"predicate":{"custom_model_data":3110},"model":"item/hats/tophats/purple"},{"predicate":{"custom_model_data":3111},"model":"item/hats/tophats/blue"},{"predicate":{"custom_model_data":3112},"model":"item/hats/tophats/brown"},{"predicate":{"custom_model_data":3113},"model":"item/hats/tophats/green"},{"predicate":{"custom_model_data":3114},"model":"item/hats/tophats/red"},{"predicate":{"custom_model_data":3115},"model":"item/hats/tophats/black"},{"predicate":{"custom_model_data":3116},"model":"item/hats/tophats/rainbow"},{"predicate":{"custom_model_data":3117},"model":"item/hats/tophats/black_monocle"},{"predicate":{"custom_model_data":3120},"model":"item/hats/cats/ocelot"},{"predicate":{"custom_model_data":3121},"model":"item/hats/cats/tabby"},{"predicate":{"custom_model_data":3122},"model":"item/hats/cats/tuxedo"},{"predicate":{"custom_model_data":3123},"model":"item/hats/cats/red"},{"predicate":{"custom_model_data":3124},"model":"item/hats/cats/siamese"},{"predicate":{"custom_model_data":3125},"model":"item/hats/cats/british_shorthair"},{"predicate":{"custom_model_data":3126},"model":"item/hats/cats/calico"},{"predicate":{"custom_model_data":3127},"model":"item/hats/cats/persian"},{"predicate":{"custom_model_data":3128},"model":"item/hats/cats/ragdoll"},{"predicate":{"custom_model_data":3129},"model":"item/hats/cats/white"},{"predicate":{"custom_model_data":3130},"model":"item/hats/cats/jellie"},{"predicate":{"custom_model_data":3131},"model":"item/hats/cats/black"},{"predicate":{"custom_model_data":3140},"model":"item/hats/glasses/sunglasses"},{"predicate":{"custom_model_data":3141},"model":"item/hats/glasses/harry_potter"},{"predicate":{"custom_model_data":3142},"model":"item/hats/glasses/half_rim"},{"predicate":{"custom_model_data":3143},"model":"item/hats/glasses/rainbow"},{"predicate":{"custom_model_data":3144},"model":"item/hats/glasses/librarian"},{"predicate":{"custom_model_data":3145},"model":"item/hats/glasses/three_d"},{"predicate":{"custom_model_data":3150},"model":"item/hats/accessories/ninja_headband"},{"predicate":{"custom_model_data":3151},"model":"item/hats/accessories/steve_mask"},{"predicate":{"custom_model_data":3152},"model":"item/hats/accessories/alex_mask"},{"predicate":{"custom_model_data":3153},"model":"item/hats/accessories/snorkel_mask_blue"},{"predicate":{"custom_model_data":3154},"model":"item/hats/accessories/snorkel_mask_red"},{"predicate":{"custom_model_data":3155},"model":"item/hats/accessories/googly_eyes"},{"predicate":{"custom_model_data":3160},"model":"item/hats/villager/armorer"},{"predicate":{"custom_model_data":3161},"model":"item/hats/villager/farmer"},{"predicate":{"custom_model_data":3162},"model":"item/hats/villager/nose"},{"predicate":{"custom_model_data":3170},"model":"item/hats/mario/mario_cap"},{"predicate":{"custom_model_data":3171},"model":"item/hats/mario/luigi_cap"},{"predicate":{"custom_model_data":3172},"model":"item/hats/mario/cappy"},{"predicate":{"custom_model_data":3173},"model":"item/hats/mario/toad_red"},{"predicate":{"custom_model_data":3174},"model":"item/hats/mario/toad_blue"},{"predicate":{"custom_model_data":3175},"model":"item/hats/mario/toad_yellow"},{"predicate":{"custom_model_data":3176},"model":"item/hats/mario/toad_green"},{"predicate":{"custom_model_data":3177},"model":"item/hats/mario/mario"},{"predicate":{"custom_model_data":3178},"model":"item/hats/mario/luigi"},{"predicate":{"custom_model_data":7773180},"model":"item/hats/halloween/wiggly_ghast"},{"predicate":{"custom_model_data":7773181},"model":"item/hats/halloween/native_american_headband"},{"predicate":{"custom_model_data":7773182},"model":"item/hats/halloween/jason_mask"}]} \ No newline at end of file diff --git a/resourcepack/assets/minecraft/models/item/stick.json b/resourcepack/assets/minecraft/models/item/stick.json index 0a725c6..56a9d7c 100644 --- a/resourcepack/assets/minecraft/models/item/stick.json +++ b/resourcepack/assets/minecraft/models/item/stick.json @@ -1,84 +1 @@ -{ - "parent": "item/handheld", - "textures": { - "layer0": "item/stick" - }, - "overrides": [ - { "_comment": "Miscellaneous", - "predicate": {"custom_model_data": 3000}, "model": "item/hats/fez"}, - { "predicate": {"custom_model_data": 3001}, "model": "item/hats/squid"}, - { "predicate": {"custom_model_data": 3002}, "model": "item/hats/arrow"}, - { "predicate": {"custom_model_data": 3003}, "model": "item/hats/frying_pan"}, - - { "_comment": "Tophats", - "predicate": {"custom_model_data": 3100}, "model": "item/hats/tophats/white"}, - { "predicate": {"custom_model_data": 3101}, "model": "item/hats/tophats/orange"}, - { "predicate": {"custom_model_data": 3102}, "model": "item/hats/tophats/magenta"}, - { "predicate": {"custom_model_data": 3103}, "model": "item/hats/tophats/light_blue"}, - { "predicate": {"custom_model_data": 3104}, "model": "item/hats/tophats/yellow"}, - { "predicate": {"custom_model_data": 3105}, "model": "item/hats/tophats/lime"}, - { "predicate": {"custom_model_data": 3106}, "model": "item/hats/tophats/pink"}, - { "predicate": {"custom_model_data": 3107}, "model": "item/hats/tophats/gray"}, - { "predicate": {"custom_model_data": 3108}, "model": "item/hats/tophats/light_gray"}, - { "predicate": {"custom_model_data": 3109}, "model": "item/hats/tophats/cyan"}, - { "predicate": {"custom_model_data": 3110}, "model": "item/hats/tophats/purple"}, - { "predicate": {"custom_model_data": 3111}, "model": "item/hats/tophats/blue"}, - { "predicate": {"custom_model_data": 3112}, "model": "item/hats/tophats/brown"}, - { "predicate": {"custom_model_data": 3113}, "model": "item/hats/tophats/green"}, - { "predicate": {"custom_model_data": 3114}, "model": "item/hats/tophats/red"}, - { "predicate": {"custom_model_data": 3115}, "model": "item/hats/tophats/black"}, - { "predicate": {"custom_model_data": 3116}, "model": "item/hats/tophats/rainbow"}, - { "predicate": {"custom_model_data": 3117}, "model": "item/hats/tophats/black_monocle"}, - - { "_comment": "Cats", - "predicate": {"custom_model_data": 3120}, "model": "item/hats/cats/ocelot"}, - { "predicate": {"custom_model_data": 3121}, "model": "item/hats/cats/tabby"}, - { "predicate": {"custom_model_data": 3122}, "model": "item/hats/cats/tuxedo"}, - { "predicate": {"custom_model_data": 3123}, "model": "item/hats/cats/red"}, - { "predicate": {"custom_model_data": 3124}, "model": "item/hats/cats/siamese"}, - { "predicate": {"custom_model_data": 3125}, "model": "item/hats/cats/british_shorthair"}, - { "predicate": {"custom_model_data": 3126}, "model": "item/hats/cats/calico"}, - { "predicate": {"custom_model_data": 3127}, "model": "item/hats/cats/persian"}, - { "predicate": {"custom_model_data": 3128}, "model": "item/hats/cats/ragdoll"}, - { "predicate": {"custom_model_data": 3129}, "model": "item/hats/cats/white"}, - { "predicate": {"custom_model_data": 3130}, "model": "item/hats/cats/jellie"}, - { "predicate": {"custom_model_data": 3131}, "model": "item/hats/cats/black"}, - - { "_comment": "Glasses", - "predicate": {"custom_model_data": 3140}, "model": "item/hats/glasses/sunglasses"}, - { "predicate": {"custom_model_data": 3141}, "model": "item/hats/glasses/harry_potter"}, - { "predicate": {"custom_model_data": 3142}, "model": "item/hats/glasses/half_rim"}, - { "predicate": {"custom_model_data": 3143}, "model": "item/hats/glasses/rainbow"}, - { "predicate": {"custom_model_data": 3144}, "model": "item/hats/glasses/librarian"}, - { "predicate": {"custom_model_data": 3145}, "model": "item/hats/glasses/three_d"}, - - { "_comment": "Accessories", - "predicate": {"custom_model_data": 3150}, "model": "item/hats/accessories/ninja_headband"}, - { "predicate": {"custom_model_data": 3151}, "model": "item/hats/accessories/steve_mask"}, - { "predicate": {"custom_model_data": 3152}, "model": "item/hats/accessories/alex_mask"}, - { "predicate": {"custom_model_data": 3153}, "model": "item/hats/accessories/snorkel_mask_blue"}, - { "predicate": {"custom_model_data": 3154}, "model": "item/hats/accessories/snorkel_mask_red"}, - { "predicate": {"custom_model_data": 3155}, "model": "item/hats/accessories/googly_eyes"}, - - { "_comment": "Villager related", - "predicate": {"custom_model_data": 3160}, "model": "item/hats/villager/armorer"}, - { "predicate": {"custom_model_data": 3161}, "model": "item/hats/villager/farmer"}, - { "predicate": {"custom_model_data": 3162}, "model": "item/hats/villager/nose"}, - - { "_comment": "Mario", - "predicate": {"custom_model_data": 3170}, "model": "item/hats/mario/mario_cap"}, - { "predicate": {"custom_model_data": 3171}, "model": "item/hats/mario/luigi_cap"}, - { "predicate": {"custom_model_data": 3172}, "model": "item/hats/mario/cappy"}, - { "predicate": {"custom_model_data": 3173}, "model": "item/hats/mario/toad_red"}, - { "predicate": {"custom_model_data": 3174}, "model": "item/hats/mario/toad_blue"}, - { "predicate": {"custom_model_data": 3175}, "model": "item/hats/mario/toad_yellow"}, - { "predicate": {"custom_model_data": 3176}, "model": "item/hats/mario/toad_green"}, - { "predicate": {"custom_model_data": 3177}, "model": "item/hats/mario/mario"}, - { "predicate": {"custom_model_data": 3178}, "model": "item/hats/mario/luigi"}, - - { "_comment": "Halloween", - "predicate": {"custom_model_data": 7773180}, "model": "item/hats/halloween/wiggly_ghast"}, - { "predicate": {"custom_model_data": 7773181}, "model": "item/hats/halloween/native_american_headband"}, - { "predicate": {"custom_model_data": 7773182}, "model": "item/hats/halloween/jason_mask"} - ] -} +{"parent":"item/handheld","textures":{"layer0":"item/stick"},"overrides":[{"predicate":{"custom_model_data":3000},"model":"item/hats/fez"},{"predicate":{"custom_model_data":3001},"model":"item/hats/squid"},{"predicate":{"custom_model_data":3002},"model":"item/hats/arrow"},{"predicate":{"custom_model_data":3003},"model":"item/hats/frying_pan"},{"predicate":{"custom_model_data":3100},"model":"item/hats/tophats/white"},{"predicate":{"custom_model_data":3101},"model":"item/hats/tophats/orange"},{"predicate":{"custom_model_data":3102},"model":"item/hats/tophats/magenta"},{"predicate":{"custom_model_data":3103},"model":"item/hats/tophats/light_blue"},{"predicate":{"custom_model_data":3104},"model":"item/hats/tophats/yellow"},{"predicate":{"custom_model_data":3105},"model":"item/hats/tophats/lime"},{"predicate":{"custom_model_data":3106},"model":"item/hats/tophats/pink"},{"predicate":{"custom_model_data":3107},"model":"item/hats/tophats/gray"},{"predicate":{"custom_model_data":3108},"model":"item/hats/tophats/light_gray"},{"predicate":{"custom_model_data":3109},"model":"item/hats/tophats/cyan"},{"predicate":{"custom_model_data":3110},"model":"item/hats/tophats/purple"},{"predicate":{"custom_model_data":3111},"model":"item/hats/tophats/blue"},{"predicate":{"custom_model_data":3112},"model":"item/hats/tophats/brown"},{"predicate":{"custom_model_data":3113},"model":"item/hats/tophats/green"},{"predicate":{"custom_model_data":3114},"model":"item/hats/tophats/red"},{"predicate":{"custom_model_data":3115},"model":"item/hats/tophats/black"},{"predicate":{"custom_model_data":3116},"model":"item/hats/tophats/rainbow"},{"predicate":{"custom_model_data":3117},"model":"item/hats/tophats/black_monocle"},{"predicate":{"custom_model_data":3120},"model":"item/hats/cats/ocelot"},{"predicate":{"custom_model_data":3121},"model":"item/hats/cats/tabby"},{"predicate":{"custom_model_data":3122},"model":"item/hats/cats/tuxedo"},{"predicate":{"custom_model_data":3123},"model":"item/hats/cats/red"},{"predicate":{"custom_model_data":3124},"model":"item/hats/cats/siamese"},{"predicate":{"custom_model_data":3125},"model":"item/hats/cats/british_shorthair"},{"predicate":{"custom_model_data":3126},"model":"item/hats/cats/calico"},{"predicate":{"custom_model_data":3127},"model":"item/hats/cats/persian"},{"predicate":{"custom_model_data":3128},"model":"item/hats/cats/ragdoll"},{"predicate":{"custom_model_data":3129},"model":"item/hats/cats/white"},{"predicate":{"custom_model_data":3130},"model":"item/hats/cats/jellie"},{"predicate":{"custom_model_data":3131},"model":"item/hats/cats/black"},{"predicate":{"custom_model_data":3140},"model":"item/hats/glasses/sunglasses"},{"predicate":{"custom_model_data":3141},"model":"item/hats/glasses/harry_potter"},{"predicate":{"custom_model_data":3142},"model":"item/hats/glasses/half_rim"},{"predicate":{"custom_model_data":3143},"model":"item/hats/glasses/rainbow"},{"predicate":{"custom_model_data":3144},"model":"item/hats/glasses/librarian"},{"predicate":{"custom_model_data":3145},"model":"item/hats/glasses/three_d"},{"predicate":{"custom_model_data":3150},"model":"item/hats/accessories/ninja_headband"},{"predicate":{"custom_model_data":3151},"model":"item/hats/accessories/steve_mask"},{"predicate":{"custom_model_data":3152},"model":"item/hats/accessories/alex_mask"},{"predicate":{"custom_model_data":3153},"model":"item/hats/accessories/snorkel_mask_blue"},{"predicate":{"custom_model_data":3154},"model":"item/hats/accessories/snorkel_mask_red"},{"predicate":{"custom_model_data":3155},"model":"item/hats/accessories/googly_eyes"},{"predicate":{"custom_model_data":3160},"model":"item/hats/villager/armorer"},{"predicate":{"custom_model_data":3161},"model":"item/hats/villager/farmer"},{"predicate":{"custom_model_data":3162},"model":"item/hats/villager/nose"},{"predicate":{"custom_model_data":3170},"model":"item/hats/mario/mario_cap"},{"predicate":{"custom_model_data":3171},"model":"item/hats/mario/luigi_cap"},{"predicate":{"custom_model_data":3172},"model":"item/hats/mario/cappy"},{"predicate":{"custom_model_data":3173},"model":"item/hats/mario/toad_red"},{"predicate":{"custom_model_data":3174},"model":"item/hats/mario/toad_blue"},{"predicate":{"custom_model_data":3175},"model":"item/hats/mario/toad_yellow"},{"predicate":{"custom_model_data":3176},"model":"item/hats/mario/toad_green"},{"predicate":{"custom_model_data":3177},"model":"item/hats/mario/mario"},{"predicate":{"custom_model_data":3178},"model":"item/hats/mario/luigi"},{"predicate":{"custom_model_data":7773180},"model":"item/hats/halloween/wiggly_ghast"},{"predicate":{"custom_model_data":7773181},"model":"item/hats/halloween/native_american_headband"},{"predicate":{"custom_model_data":7773182},"model":"item/hats/halloween/jason_mask"}]} \ No newline at end of file From 8d55d7a059bcb25848e52b55032fe4d408602f66 Mon Sep 17 00:00:00 2001 From: OraneUtan Date: Tue, 19 May 2020 12:28:21 +0200 Subject: [PATCH 04/58] Moved registry related code into "registry.py" --- build/generate_base_item_models.py | 36 +++--------------------------- build/registry.py | 36 ++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 33 deletions(-) create mode 100644 build/registry.py diff --git a/build/generate_base_item_models.py b/build/generate_base_item_models.py index 732ff4f..7c83ff8 100644 --- a/build/generate_base_item_models.py +++ b/build/generate_base_item_models.py @@ -2,37 +2,7 @@ # Each model is overwritten with custom hat models depending on the items custom model data. import yaml, json -from dataclasses import dataclass - -@dataclass -class Hat: - name: str - category: str - custom_model_data: int - model_path: str - type: str - translation: str - -def load_yaml_file(path): - with open(path) as file: - return yaml.load(file, Loader=yaml.Loader) - -def hats_from_categories(categories): - """ Takes a list of category dicts each with a list of hat dicts and converts it to one list of hats """ - for category_name, category_hats in map(lambda category: list(category.items())[0], categories): - for hat_name, hat_data in map(lambda category_entry: list(category_entry.items())[0], category_hats): - custom_model_data = hat_data['custom_model_data'] - - if category_name == "*": - # Category "*" contains all uncategorized hats -> don't add a category to any paths - model = f"item/hats/{hat_name}" - type = f"hats.hat.type.{hat_name}" - translation = f"item.hats.{hat_name}" - else: - model = f"item/hats/{category_name}/{hat_name}" - type = f"hats.hat.type.{category_name}.{hat_name}" - translation = f"item.hats.{category_name}.{hat_name}" - yield Hat(hat_name, category_name, custom_model_data, model, type, translation) +from registry import Registry, Hat def minecraft_item_model_overwrite(custom_model_data, model_path): """ Creates a custom model overwrite for minecraft item models """ @@ -44,8 +14,8 @@ def minecraft_item_model(base_model, overrides=None): base_model['overrides'] = overrides return base_model -registry = load_yaml_file("hat_registry.yml") -hats = list(hats_from_categories(registry['categories'])) +registry = Registry() +hats = list(registry.all_hats()) overrides = [minecraft_item_model_overwrite(hat.custom_model_data, hat.model_path) for hat in hats] # Create item model for hats diff --git a/build/registry.py b/build/registry.py new file mode 100644 index 0000000..a79be61 --- /dev/null +++ b/build/registry.py @@ -0,0 +1,36 @@ +import yaml +from dataclasses import dataclass + +class Registry: + def __init__(self): + self.registry = load_yaml_file("hat_registry.yml") + + def all_hats(self): + for category_name, category_hats in map(lambda category: list(category.items())[0], self.registry['categories']): + for hat_name, hat_data in map(lambda category_entry: list(category_entry.items())[0], category_hats): + custom_model_data = hat_data['custom_model_data'] + + if category_name == "*": + # Category "*" contains all uncategorized hats -> don't add a category to any paths + model = f"item/hats/{hat_name}" + type = f"hats.hat.type.{hat_name}" + translation = f"item.hats.{hat_name}" + else: + model = f"item/hats/{category_name}/{hat_name}" + type = f"hats.hat.type.{category_name}.{hat_name}" + translation = f"item.hats.{category_name}.{hat_name}" + yield Hat(hat_name, category_name, custom_model_data, model, type, translation) + +@dataclass +class Hat: + name: str + category: str + custom_model_data: int + model_path: str + type: str + translation: str + + +def load_yaml_file(path): + with open(path) as file: + return yaml.load(file, Loader=yaml.Loader) \ No newline at end of file From 3e6c1c40c0a8a16b654a918390b8a708a00e2c9a Mon Sep 17 00:00:00 2001 From: OraneUtan Date: Tue, 19 May 2020 15:09:48 +0200 Subject: [PATCH 05/58] Added build script that generates "fix_hat" functions Removed old script that did a similar thing --- build/generate_fix_hat.py | 34 ------------------- build/generate_fix_hat_functions.py | 26 ++++++++++++++ .../fix_hat/accessories/alex_mask.mcfunction | 8 ++--- .../accessories/googly_eyes.mcfunction | 8 ++--- .../accessories/ninja_headband.mcfunction | 8 ++--- .../accessories/snorkel_mask_blue.mcfunction | 8 ++--- .../accessories/snorkel_mask_red.mcfunction | 8 ++--- .../fix_hat/accessories/steve_mask.mcfunction | 8 ++--- .../hats/functions/fix_hat/arrow.mcfunction | 8 ++--- .../functions/fix_hat/cats/black.mcfunction | 8 ++--- .../fix_hat/cats/british_shorthair.mcfunction | 8 ++--- .../functions/fix_hat/cats/calico.mcfunction | 8 ++--- .../functions/fix_hat/cats/jellie.mcfunction | 8 ++--- .../functions/fix_hat/cats/ocelot.mcfunction | 8 ++--- .../functions/fix_hat/cats/persian.mcfunction | 8 ++--- .../functions/fix_hat/cats/ragdoll.mcfunction | 8 ++--- .../functions/fix_hat/cats/red.mcfunction | 8 ++--- .../functions/fix_hat/cats/siamese.mcfunction | 8 ++--- .../functions/fix_hat/cats/tabby.mcfunction | 8 ++--- .../functions/fix_hat/cats/tuxedo.mcfunction | 8 ++--- .../functions/fix_hat/cats/white.mcfunction | 8 ++--- .../hats/functions/fix_hat/fez.mcfunction | 8 ++--- .../functions/fix_hat/frying_pan.mcfunction | 8 ++--- .../fix_hat/glasses/half_rim.mcfunction | 8 ++--- .../fix_hat/glasses/harry_potter.mcfunction | 8 ++--- .../fix_hat/glasses/librarian.mcfunction | 8 ++--- .../fix_hat/glasses/rainbow.mcfunction | 8 ++--- .../fix_hat/glasses/sunglasses.mcfunction | 8 ++--- .../fix_hat/glasses/three_d.mcfunction | 8 ++--- .../fix_hat/halloween/jason_mask.mcfunction | 8 ++--- .../native_american_headband.mcfunction | 8 ++--- .../fix_hat/halloween/wiggly_ghast.mcfunction | 8 ++--- .../functions/fix_hat/mario/cappy.mcfunction | 8 ++--- .../functions/fix_hat/mario/luigi.mcfunction | 8 ++--- .../fix_hat/mario/luigi_cap.mcfunction | 8 ++--- .../functions/fix_hat/mario/mario.mcfunction | 8 ++--- .../fix_hat/mario/mario_cap.mcfunction | 8 ++--- .../fix_hat/mario/toad_blue.mcfunction | 8 ++--- .../fix_hat/mario/toad_green.mcfunction | 8 ++--- .../fix_hat/mario/toad_red.mcfunction | 8 ++--- .../fix_hat/mario/toad_yellow.mcfunction | 8 ++--- .../hats/functions/fix_hat/squid.mcfunction | 8 ++--- .../fix_hat/tophats/black.mcfunction | 8 ++--- .../fix_hat/tophats/black_monocle.mcfunction | 8 ++--- .../functions/fix_hat/tophats/blue.mcfunction | 8 ++--- .../fix_hat/tophats/brown.mcfunction | 8 ++--- .../functions/fix_hat/tophats/cyan.mcfunction | 8 ++--- .../functions/fix_hat/tophats/gray.mcfunction | 8 ++--- .../fix_hat/tophats/green.mcfunction | 8 ++--- .../fix_hat/tophats/light_blue.mcfunction | 8 ++--- .../fix_hat/tophats/light_gray.mcfunction | 8 ++--- .../functions/fix_hat/tophats/lime.mcfunction | 8 ++--- .../fix_hat/tophats/magenta.mcfunction | 8 ++--- .../fix_hat/tophats/orange.mcfunction | 8 ++--- .../functions/fix_hat/tophats/pink.mcfunction | 8 ++--- .../fix_hat/tophats/purple.mcfunction | 8 ++--- .../fix_hat/tophats/rainbow.mcfunction | 8 ++--- .../functions/fix_hat/tophats/red.mcfunction | 8 ++--- .../fix_hat/tophats/white.mcfunction | 8 ++--- .../fix_hat/tophats/yellow.mcfunction | 8 ++--- .../fix_hat/villager/armorer.mcfunction | 8 ++--- .../fix_hat/villager/farmer.mcfunction | 8 ++--- .../fix_hat/villager/nose.mcfunction | 8 ++--- 63 files changed, 148 insertions(+), 400 deletions(-) delete mode 100644 build/generate_fix_hat.py create mode 100644 build/generate_fix_hat_functions.py diff --git a/build/generate_fix_hat.py b/build/generate_fix_hat.py deleted file mode 100644 index 2de9b9a..0000000 --- a/build/generate_fix_hat.py +++ /dev/null @@ -1,34 +0,0 @@ -import re -from build.datapack_utils import * - -def extract_custom_model_data(filepath): - with open(filepath, "r") as file: - cmd_id = re.findall("CustomModelData\s*:(\d{1,7})",file.read())[0] - return cmd_id - -pack_name = "hats" -loot_tables_dir = "data/hats/loot_tables/hat" -outdir = "data/hats/functions/fix_hat" - -loot_tables = get_files_in(loot_tables_dir, re_filename="(?!^_).*" , extension=".json") - -for lt in loot_tables: - cmd_id = extract_custom_model_data(lt) - ingame_path = get_ingame_path(lt, "hats") - out_file = outdir + '/' + ingame_path.replace("hats:hat/", "") + ".mcfunction" - - header = "###################################################\n"\ - "# as: Player #\n"\ - "# Descr: Replace #hat item with #hat_on_head item #\n"\ - "###################################################" - - lines = "clear @s minecraft:stick{{Tags:[\"is_hat\"],CustomModelData:{0}}} 1\n"\ - "execute as @s run loot give @s loot {1}".format(cmd_id, ingame_path) - - data = header + '\n\n' + lines - - if not os.path.exists(os.path.split(out_file)[0]): - os.makedirs(os.path.split(out_file)[0]) - - with open(out_file, "w") as file: - file.write(data) diff --git a/build/generate_fix_hat_functions.py b/build/generate_fix_hat_functions.py new file mode 100644 index 0000000..bfdb90d --- /dev/null +++ b/build/generate_fix_hat_functions.py @@ -0,0 +1,26 @@ +import inspect, os +from registry import Registry, Hat + +registry = Registry() +hats = list(registry.all_hats()) +base_item_on_head = "stick" + +for hat in hats: + if hat.category == "*": + rel_path = f"{hat.name}" + else: + rel_path = f"{hat.category}/{hat.name}" + + function_path = f"datapack/data/hats/functions/fix_hat/{rel_path}.mcfunction" + function_content = inspect.cleandoc(f""" + # as: Player, descr: Replace #hat item with equivalent #hat_on_head item + clear @s minecraft:{base_item_on_head}{{CustomModelData:{hat.custom_model_data}, Tags:["is_hat"]}} 1 + execute as @s run loot give @s loot hats:hat/{rel_path} + """) + + parent_dir = os.path.split(function_path)[0] + if not os.path.exists(parent_dir): + os.makedirs(parent_dir) + + with open(function_path, "w") as file: + file.write(function_content) \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/accessories/alex_mask.mcfunction b/datapack/data/hats/functions/fix_hat/accessories/alex_mask.mcfunction index 0406fc5..fcdddcb 100644 --- a/datapack/data/hats/functions/fix_hat/accessories/alex_mask.mcfunction +++ b/datapack/data/hats/functions/fix_hat/accessories/alex_mask.mcfunction @@ -1,7 +1,3 @@ -################################################### -# as: Player # -# Descr: Replace #hat item with #hat_on_head item # -################################################### - -clear @s minecraft:stick{Tags:["is_hat"],CustomModelData:3152} 1 +# as: Player, descr: Replace #hat item with equivalent #hat_on_head item +clear @s minecraft:stick{CustomModelData:3152, Tags:["is_hat"]} 1 execute as @s run loot give @s loot hats:hat/accessories/alex_mask \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/accessories/googly_eyes.mcfunction b/datapack/data/hats/functions/fix_hat/accessories/googly_eyes.mcfunction index 5a50032..2aaad03 100644 --- a/datapack/data/hats/functions/fix_hat/accessories/googly_eyes.mcfunction +++ b/datapack/data/hats/functions/fix_hat/accessories/googly_eyes.mcfunction @@ -1,7 +1,3 @@ -################################################### -# as: Player # -# Descr: Replace #hat item with #hat_on_head item # -################################################### - -clear @s minecraft:stick{Tags:["is_hat"],CustomModelData:3155} 1 +# as: Player, descr: Replace #hat item with equivalent #hat_on_head item +clear @s minecraft:stick{CustomModelData:3155, Tags:["is_hat"]} 1 execute as @s run loot give @s loot hats:hat/accessories/googly_eyes \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/accessories/ninja_headband.mcfunction b/datapack/data/hats/functions/fix_hat/accessories/ninja_headband.mcfunction index aded952..90e4d18 100644 --- a/datapack/data/hats/functions/fix_hat/accessories/ninja_headband.mcfunction +++ b/datapack/data/hats/functions/fix_hat/accessories/ninja_headband.mcfunction @@ -1,7 +1,3 @@ -################################################### -# as: Player # -# Descr: Replace #hat item with #hat_on_head item # -################################################### - -clear @s minecraft:stick{Tags:["is_hat"],CustomModelData:3150} 1 +# as: Player, descr: Replace #hat item with equivalent #hat_on_head item +clear @s minecraft:stick{CustomModelData:3150, Tags:["is_hat"]} 1 execute as @s run loot give @s loot hats:hat/accessories/ninja_headband \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/accessories/snorkel_mask_blue.mcfunction b/datapack/data/hats/functions/fix_hat/accessories/snorkel_mask_blue.mcfunction index 6871b9e..96827a0 100644 --- a/datapack/data/hats/functions/fix_hat/accessories/snorkel_mask_blue.mcfunction +++ b/datapack/data/hats/functions/fix_hat/accessories/snorkel_mask_blue.mcfunction @@ -1,7 +1,3 @@ -################################################### -# as: Player # -# Descr: Replace #hat item with #hat_on_head item # -################################################### - -clear @s minecraft:stick{Tags:["is_hat"],CustomModelData:3153} 1 +# as: Player, descr: Replace #hat item with equivalent #hat_on_head item +clear @s minecraft:stick{CustomModelData:3153, Tags:["is_hat"]} 1 execute as @s run loot give @s loot hats:hat/accessories/snorkel_mask_blue \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/accessories/snorkel_mask_red.mcfunction b/datapack/data/hats/functions/fix_hat/accessories/snorkel_mask_red.mcfunction index 789ddeb..a34b386 100644 --- a/datapack/data/hats/functions/fix_hat/accessories/snorkel_mask_red.mcfunction +++ b/datapack/data/hats/functions/fix_hat/accessories/snorkel_mask_red.mcfunction @@ -1,7 +1,3 @@ -################################################### -# as: Player # -# Descr: Replace #hat item with #hat_on_head item # -################################################### - -clear @s minecraft:stick{Tags:["is_hat"],CustomModelData:3154} 1 +# as: Player, descr: Replace #hat item with equivalent #hat_on_head item +clear @s minecraft:stick{CustomModelData:3154, Tags:["is_hat"]} 1 execute as @s run loot give @s loot hats:hat/accessories/snorkel_mask_red \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/accessories/steve_mask.mcfunction b/datapack/data/hats/functions/fix_hat/accessories/steve_mask.mcfunction index cf56449..c2625d7 100644 --- a/datapack/data/hats/functions/fix_hat/accessories/steve_mask.mcfunction +++ b/datapack/data/hats/functions/fix_hat/accessories/steve_mask.mcfunction @@ -1,7 +1,3 @@ -################################################### -# as: Player # -# Descr: Replace #hat item with #hat_on_head item # -################################################### - -clear @s minecraft:stick{Tags:["is_hat"],CustomModelData:3151} 1 +# as: Player, descr: Replace #hat item with equivalent #hat_on_head item +clear @s minecraft:stick{CustomModelData:3151, Tags:["is_hat"]} 1 execute as @s run loot give @s loot hats:hat/accessories/steve_mask \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/arrow.mcfunction b/datapack/data/hats/functions/fix_hat/arrow.mcfunction index 8534393..590377d 100644 --- a/datapack/data/hats/functions/fix_hat/arrow.mcfunction +++ b/datapack/data/hats/functions/fix_hat/arrow.mcfunction @@ -1,7 +1,3 @@ -################################################### -# as: Player # -# Descr: Replace #hat item with #hat_on_head item # -################################################### - -clear @s minecraft:stick{Tags:["is_hat"],CustomModelData:3002} 1 +# as: Player, descr: Replace #hat item with equivalent #hat_on_head item +clear @s minecraft:stick{CustomModelData:3002, Tags:["is_hat"]} 1 execute as @s run loot give @s loot hats:hat/arrow \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/cats/black.mcfunction b/datapack/data/hats/functions/fix_hat/cats/black.mcfunction index 22783e6..02f540b 100644 --- a/datapack/data/hats/functions/fix_hat/cats/black.mcfunction +++ b/datapack/data/hats/functions/fix_hat/cats/black.mcfunction @@ -1,7 +1,3 @@ -################################################### -# as: Player # -# Descr: Replace #hat item with #hat_on_head item # -################################################### - -clear @s minecraft:stick{Tags:["is_hat"],CustomModelData:3131} 1 +# as: Player, descr: Replace #hat item with equivalent #hat_on_head item +clear @s minecraft:stick{CustomModelData:3131, Tags:["is_hat"]} 1 execute as @s run loot give @s loot hats:hat/cats/black \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/cats/british_shorthair.mcfunction b/datapack/data/hats/functions/fix_hat/cats/british_shorthair.mcfunction index 585d0da..d94eddf 100644 --- a/datapack/data/hats/functions/fix_hat/cats/british_shorthair.mcfunction +++ b/datapack/data/hats/functions/fix_hat/cats/british_shorthair.mcfunction @@ -1,7 +1,3 @@ -################################################### -# as: Player # -# Descr: Replace #hat item with #hat_on_head item # -################################################### - -clear @s minecraft:stick{Tags:["is_hat"],CustomModelData:3125} 1 +# as: Player, descr: Replace #hat item with equivalent #hat_on_head item +clear @s minecraft:stick{CustomModelData:3125, Tags:["is_hat"]} 1 execute as @s run loot give @s loot hats:hat/cats/british_shorthair \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/cats/calico.mcfunction b/datapack/data/hats/functions/fix_hat/cats/calico.mcfunction index 9f1285d..f3f36f4 100644 --- a/datapack/data/hats/functions/fix_hat/cats/calico.mcfunction +++ b/datapack/data/hats/functions/fix_hat/cats/calico.mcfunction @@ -1,7 +1,3 @@ -################################################### -# as: Player # -# Descr: Replace #hat item with #hat_on_head item # -################################################### - -clear @s minecraft:stick{Tags:["is_hat"],CustomModelData:3126} 1 +# as: Player, descr: Replace #hat item with equivalent #hat_on_head item +clear @s minecraft:stick{CustomModelData:3126, Tags:["is_hat"]} 1 execute as @s run loot give @s loot hats:hat/cats/calico \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/cats/jellie.mcfunction b/datapack/data/hats/functions/fix_hat/cats/jellie.mcfunction index 9c88a2a..846351c 100644 --- a/datapack/data/hats/functions/fix_hat/cats/jellie.mcfunction +++ b/datapack/data/hats/functions/fix_hat/cats/jellie.mcfunction @@ -1,7 +1,3 @@ -################################################### -# as: Player # -# Descr: Replace #hat item with #hat_on_head item # -################################################### - -clear @s minecraft:stick{Tags:["is_hat"],CustomModelData:3130} 1 +# as: Player, descr: Replace #hat item with equivalent #hat_on_head item +clear @s minecraft:stick{CustomModelData:3130, Tags:["is_hat"]} 1 execute as @s run loot give @s loot hats:hat/cats/jellie \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/cats/ocelot.mcfunction b/datapack/data/hats/functions/fix_hat/cats/ocelot.mcfunction index 6b47a35..6496cc9 100644 --- a/datapack/data/hats/functions/fix_hat/cats/ocelot.mcfunction +++ b/datapack/data/hats/functions/fix_hat/cats/ocelot.mcfunction @@ -1,7 +1,3 @@ -################################################### -# as: Player # -# Descr: Replace #hat item with #hat_on_head item # -################################################### - -clear @s minecraft:stick{Tags:["is_hat"],CustomModelData:3120} 1 +# as: Player, descr: Replace #hat item with equivalent #hat_on_head item +clear @s minecraft:stick{CustomModelData:3120, Tags:["is_hat"]} 1 execute as @s run loot give @s loot hats:hat/cats/ocelot \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/cats/persian.mcfunction b/datapack/data/hats/functions/fix_hat/cats/persian.mcfunction index 7449222..a787efc 100644 --- a/datapack/data/hats/functions/fix_hat/cats/persian.mcfunction +++ b/datapack/data/hats/functions/fix_hat/cats/persian.mcfunction @@ -1,7 +1,3 @@ -################################################### -# as: Player # -# Descr: Replace #hat item with #hat_on_head item # -################################################### - -clear @s minecraft:stick{Tags:["is_hat"],CustomModelData:3127} 1 +# as: Player, descr: Replace #hat item with equivalent #hat_on_head item +clear @s minecraft:stick{CustomModelData:3127, Tags:["is_hat"]} 1 execute as @s run loot give @s loot hats:hat/cats/persian \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/cats/ragdoll.mcfunction b/datapack/data/hats/functions/fix_hat/cats/ragdoll.mcfunction index 2c011df..80e3e65 100644 --- a/datapack/data/hats/functions/fix_hat/cats/ragdoll.mcfunction +++ b/datapack/data/hats/functions/fix_hat/cats/ragdoll.mcfunction @@ -1,7 +1,3 @@ -################################################### -# as: Player # -# Descr: Replace #hat item with #hat_on_head item # -################################################### - -clear @s minecraft:stick{Tags:["is_hat"],CustomModelData:3128} 1 +# as: Player, descr: Replace #hat item with equivalent #hat_on_head item +clear @s minecraft:stick{CustomModelData:3128, Tags:["is_hat"]} 1 execute as @s run loot give @s loot hats:hat/cats/ragdoll \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/cats/red.mcfunction b/datapack/data/hats/functions/fix_hat/cats/red.mcfunction index 6d74402..d21b970 100644 --- a/datapack/data/hats/functions/fix_hat/cats/red.mcfunction +++ b/datapack/data/hats/functions/fix_hat/cats/red.mcfunction @@ -1,7 +1,3 @@ -################################################### -# as: Player # -# Descr: Replace #hat item with #hat_on_head item # -################################################### - -clear @s minecraft:stick{Tags:["is_hat"],CustomModelData:3123} 1 +# as: Player, descr: Replace #hat item with equivalent #hat_on_head item +clear @s minecraft:stick{CustomModelData:3123, Tags:["is_hat"]} 1 execute as @s run loot give @s loot hats:hat/cats/red \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/cats/siamese.mcfunction b/datapack/data/hats/functions/fix_hat/cats/siamese.mcfunction index 58ed56b..8768e65 100644 --- a/datapack/data/hats/functions/fix_hat/cats/siamese.mcfunction +++ b/datapack/data/hats/functions/fix_hat/cats/siamese.mcfunction @@ -1,7 +1,3 @@ -################################################### -# as: Player # -# Descr: Replace #hat item with #hat_on_head item # -################################################### - -clear @s minecraft:stick{Tags:["is_hat"],CustomModelData:3124} 1 +# as: Player, descr: Replace #hat item with equivalent #hat_on_head item +clear @s minecraft:stick{CustomModelData:3124, Tags:["is_hat"]} 1 execute as @s run loot give @s loot hats:hat/cats/siamese \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/cats/tabby.mcfunction b/datapack/data/hats/functions/fix_hat/cats/tabby.mcfunction index e990ccb..3c255e2 100644 --- a/datapack/data/hats/functions/fix_hat/cats/tabby.mcfunction +++ b/datapack/data/hats/functions/fix_hat/cats/tabby.mcfunction @@ -1,7 +1,3 @@ -################################################### -# as: Player # -# Descr: Replace #hat item with #hat_on_head item # -################################################### - -clear @s minecraft:stick{Tags:["is_hat"],CustomModelData:3121} 1 +# as: Player, descr: Replace #hat item with equivalent #hat_on_head item +clear @s minecraft:stick{CustomModelData:3121, Tags:["is_hat"]} 1 execute as @s run loot give @s loot hats:hat/cats/tabby \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/cats/tuxedo.mcfunction b/datapack/data/hats/functions/fix_hat/cats/tuxedo.mcfunction index 43b133a..b49677b 100644 --- a/datapack/data/hats/functions/fix_hat/cats/tuxedo.mcfunction +++ b/datapack/data/hats/functions/fix_hat/cats/tuxedo.mcfunction @@ -1,7 +1,3 @@ -################################################### -# as: Player # -# Descr: Replace #hat item with #hat_on_head item # -################################################### - -clear @s minecraft:stick{Tags:["is_hat"],CustomModelData:3122} 1 +# as: Player, descr: Replace #hat item with equivalent #hat_on_head item +clear @s minecraft:stick{CustomModelData:3122, Tags:["is_hat"]} 1 execute as @s run loot give @s loot hats:hat/cats/tuxedo \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/cats/white.mcfunction b/datapack/data/hats/functions/fix_hat/cats/white.mcfunction index 7b31422..19c9c64 100644 --- a/datapack/data/hats/functions/fix_hat/cats/white.mcfunction +++ b/datapack/data/hats/functions/fix_hat/cats/white.mcfunction @@ -1,7 +1,3 @@ -################################################### -# as: Player # -# Descr: Replace #hat item with #hat_on_head item # -################################################### - -clear @s minecraft:stick{Tags:["is_hat"],CustomModelData:3129} 1 +# as: Player, descr: Replace #hat item with equivalent #hat_on_head item +clear @s minecraft:stick{CustomModelData:3129, Tags:["is_hat"]} 1 execute as @s run loot give @s loot hats:hat/cats/white \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/fez.mcfunction b/datapack/data/hats/functions/fix_hat/fez.mcfunction index b965868..05b65c1 100644 --- a/datapack/data/hats/functions/fix_hat/fez.mcfunction +++ b/datapack/data/hats/functions/fix_hat/fez.mcfunction @@ -1,7 +1,3 @@ -################################################### -# as: Player # -# Descr: Replace #hat item with #hat_on_head item # -################################################### - -clear @s minecraft:stick{Tags:["is_hat"],CustomModelData:3000} 1 +# as: Player, descr: Replace #hat item with equivalent #hat_on_head item +clear @s minecraft:stick{CustomModelData:3000, Tags:["is_hat"]} 1 execute as @s run loot give @s loot hats:hat/fez \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/frying_pan.mcfunction b/datapack/data/hats/functions/fix_hat/frying_pan.mcfunction index 2f82130..a66f1e2 100644 --- a/datapack/data/hats/functions/fix_hat/frying_pan.mcfunction +++ b/datapack/data/hats/functions/fix_hat/frying_pan.mcfunction @@ -1,7 +1,3 @@ -################################################### -# as: Player # -# Descr: Replace #hat item with #hat_on_head item # -################################################### - -clear @s minecraft:stick{Tags:["is_hat"],CustomModelData:3003} 1 +# as: Player, descr: Replace #hat item with equivalent #hat_on_head item +clear @s minecraft:stick{CustomModelData:3003, Tags:["is_hat"]} 1 execute as @s run loot give @s loot hats:hat/frying_pan \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/glasses/half_rim.mcfunction b/datapack/data/hats/functions/fix_hat/glasses/half_rim.mcfunction index 0be75a8..94ea5b8 100644 --- a/datapack/data/hats/functions/fix_hat/glasses/half_rim.mcfunction +++ b/datapack/data/hats/functions/fix_hat/glasses/half_rim.mcfunction @@ -1,7 +1,3 @@ -################################################### -# as: Player # -# Descr: Replace #hat item with #hat_on_head item # -################################################### - -clear @s minecraft:stick{Tags:["is_hat"],CustomModelData:3142} 1 +# as: Player, descr: Replace #hat item with equivalent #hat_on_head item +clear @s minecraft:stick{CustomModelData:3142, Tags:["is_hat"]} 1 execute as @s run loot give @s loot hats:hat/glasses/half_rim \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/glasses/harry_potter.mcfunction b/datapack/data/hats/functions/fix_hat/glasses/harry_potter.mcfunction index 3f550df..b265ad4 100644 --- a/datapack/data/hats/functions/fix_hat/glasses/harry_potter.mcfunction +++ b/datapack/data/hats/functions/fix_hat/glasses/harry_potter.mcfunction @@ -1,7 +1,3 @@ -################################################### -# as: Player # -# Descr: Replace #hat item with #hat_on_head item # -################################################### - -clear @s minecraft:stick{Tags:["is_hat"],CustomModelData:3141} 1 +# as: Player, descr: Replace #hat item with equivalent #hat_on_head item +clear @s minecraft:stick{CustomModelData:3141, Tags:["is_hat"]} 1 execute as @s run loot give @s loot hats:hat/glasses/harry_potter \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/glasses/librarian.mcfunction b/datapack/data/hats/functions/fix_hat/glasses/librarian.mcfunction index 978ed42..fea1e3c 100644 --- a/datapack/data/hats/functions/fix_hat/glasses/librarian.mcfunction +++ b/datapack/data/hats/functions/fix_hat/glasses/librarian.mcfunction @@ -1,7 +1,3 @@ -################################################### -# as: Player # -# Descr: Replace #hat item with #hat_on_head item # -################################################### - -clear @s minecraft:stick{Tags:["is_hat"],CustomModelData:3144} 1 +# as: Player, descr: Replace #hat item with equivalent #hat_on_head item +clear @s minecraft:stick{CustomModelData:3144, Tags:["is_hat"]} 1 execute as @s run loot give @s loot hats:hat/glasses/librarian \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/glasses/rainbow.mcfunction b/datapack/data/hats/functions/fix_hat/glasses/rainbow.mcfunction index 03bdae0..d9ba8c7 100644 --- a/datapack/data/hats/functions/fix_hat/glasses/rainbow.mcfunction +++ b/datapack/data/hats/functions/fix_hat/glasses/rainbow.mcfunction @@ -1,7 +1,3 @@ -################################################### -# as: Player # -# Descr: Replace #hat item with #hat_on_head item # -################################################### - -clear @s minecraft:stick{Tags:["is_hat"],CustomModelData:3143} 1 +# as: Player, descr: Replace #hat item with equivalent #hat_on_head item +clear @s minecraft:stick{CustomModelData:3143, Tags:["is_hat"]} 1 execute as @s run loot give @s loot hats:hat/glasses/rainbow \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/glasses/sunglasses.mcfunction b/datapack/data/hats/functions/fix_hat/glasses/sunglasses.mcfunction index 082c2cd..83b07de 100644 --- a/datapack/data/hats/functions/fix_hat/glasses/sunglasses.mcfunction +++ b/datapack/data/hats/functions/fix_hat/glasses/sunglasses.mcfunction @@ -1,7 +1,3 @@ -################################################### -# as: Player # -# Descr: Replace #hat item with #hat_on_head item # -################################################### - -clear @s minecraft:stick{Tags:["is_hat"],CustomModelData:3140} 1 +# as: Player, descr: Replace #hat item with equivalent #hat_on_head item +clear @s minecraft:stick{CustomModelData:3140, Tags:["is_hat"]} 1 execute as @s run loot give @s loot hats:hat/glasses/sunglasses \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/glasses/three_d.mcfunction b/datapack/data/hats/functions/fix_hat/glasses/three_d.mcfunction index 5848394..c912bcc 100644 --- a/datapack/data/hats/functions/fix_hat/glasses/three_d.mcfunction +++ b/datapack/data/hats/functions/fix_hat/glasses/three_d.mcfunction @@ -1,7 +1,3 @@ -################################################### -# as: Player # -# Descr: Replace #hat item with #hat_on_head item # -################################################### - -clear @s minecraft:stick{Tags:["is_hat"],CustomModelData:3145} 1 +# as: Player, descr: Replace #hat item with equivalent #hat_on_head item +clear @s minecraft:stick{CustomModelData:3145, Tags:["is_hat"]} 1 execute as @s run loot give @s loot hats:hat/glasses/three_d \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/halloween/jason_mask.mcfunction b/datapack/data/hats/functions/fix_hat/halloween/jason_mask.mcfunction index 5503eb2..727b31e 100644 --- a/datapack/data/hats/functions/fix_hat/halloween/jason_mask.mcfunction +++ b/datapack/data/hats/functions/fix_hat/halloween/jason_mask.mcfunction @@ -1,7 +1,3 @@ -################################################### -# as: Player # -# Descr: Replace #hat item with #hat_on_head item # -################################################### - -clear @s minecraft:stick{Tags:["is_hat"],CustomModelData:7773182} 1 +# as: Player, descr: Replace #hat item with equivalent #hat_on_head item +clear @s minecraft:stick{CustomModelData:7773182, Tags:["is_hat"]} 1 execute as @s run loot give @s loot hats:hat/halloween/jason_mask \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/halloween/native_american_headband.mcfunction b/datapack/data/hats/functions/fix_hat/halloween/native_american_headband.mcfunction index ec6b60a..91687d6 100644 --- a/datapack/data/hats/functions/fix_hat/halloween/native_american_headband.mcfunction +++ b/datapack/data/hats/functions/fix_hat/halloween/native_american_headband.mcfunction @@ -1,7 +1,3 @@ -################################################### -# as: Player # -# Descr: Replace #hat item with #hat_on_head item # -################################################### - -clear @s minecraft:stick{Tags:["is_hat"],CustomModelData:7773181} 1 +# as: Player, descr: Replace #hat item with equivalent #hat_on_head item +clear @s minecraft:stick{CustomModelData:7773181, Tags:["is_hat"]} 1 execute as @s run loot give @s loot hats:hat/halloween/native_american_headband \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/halloween/wiggly_ghast.mcfunction b/datapack/data/hats/functions/fix_hat/halloween/wiggly_ghast.mcfunction index edd2d52..4142f54 100644 --- a/datapack/data/hats/functions/fix_hat/halloween/wiggly_ghast.mcfunction +++ b/datapack/data/hats/functions/fix_hat/halloween/wiggly_ghast.mcfunction @@ -1,7 +1,3 @@ -################################################### -# as: Player # -# Descr: Replace #hat item with #hat_on_head item # -################################################### - -clear @s minecraft:stick{Tags:["is_hat"],CustomModelData:7773180} 1 +# as: Player, descr: Replace #hat item with equivalent #hat_on_head item +clear @s minecraft:stick{CustomModelData:7773180, Tags:["is_hat"]} 1 execute as @s run loot give @s loot hats:hat/halloween/wiggly_ghast \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/mario/cappy.mcfunction b/datapack/data/hats/functions/fix_hat/mario/cappy.mcfunction index 4966034..090dc68 100644 --- a/datapack/data/hats/functions/fix_hat/mario/cappy.mcfunction +++ b/datapack/data/hats/functions/fix_hat/mario/cappy.mcfunction @@ -1,7 +1,3 @@ -################################################### -# as: Player # -# Descr: Replace #hat item with #hat_on_head item # -################################################### - -clear @s minecraft:stick{Tags:["is_hat"],CustomModelData:3172} 1 +# as: Player, descr: Replace #hat item with equivalent #hat_on_head item +clear @s minecraft:stick{CustomModelData:3172, Tags:["is_hat"]} 1 execute as @s run loot give @s loot hats:hat/mario/cappy \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/mario/luigi.mcfunction b/datapack/data/hats/functions/fix_hat/mario/luigi.mcfunction index d00b05d..9c91bbf 100644 --- a/datapack/data/hats/functions/fix_hat/mario/luigi.mcfunction +++ b/datapack/data/hats/functions/fix_hat/mario/luigi.mcfunction @@ -1,7 +1,3 @@ -################################################### -# as: Player # -# Descr: Replace #hat item with #hat_on_head item # -################################################### - -clear @s minecraft:stick{Tags:["is_hat"],CustomModelData:3178} 1 +# as: Player, descr: Replace #hat item with equivalent #hat_on_head item +clear @s minecraft:stick{CustomModelData:3178, Tags:["is_hat"]} 1 execute as @s run loot give @s loot hats:hat/mario/luigi \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/mario/luigi_cap.mcfunction b/datapack/data/hats/functions/fix_hat/mario/luigi_cap.mcfunction index 0351ced..faeba73 100644 --- a/datapack/data/hats/functions/fix_hat/mario/luigi_cap.mcfunction +++ b/datapack/data/hats/functions/fix_hat/mario/luigi_cap.mcfunction @@ -1,7 +1,3 @@ -################################################### -# as: Player # -# Descr: Replace #hat item with #hat_on_head item # -################################################### - -clear @s minecraft:stick{Tags:["is_hat"],CustomModelData:3171} 1 +# as: Player, descr: Replace #hat item with equivalent #hat_on_head item +clear @s minecraft:stick{CustomModelData:3171, Tags:["is_hat"]} 1 execute as @s run loot give @s loot hats:hat/mario/luigi_cap \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/mario/mario.mcfunction b/datapack/data/hats/functions/fix_hat/mario/mario.mcfunction index 3b4c43a..1fa63f2 100644 --- a/datapack/data/hats/functions/fix_hat/mario/mario.mcfunction +++ b/datapack/data/hats/functions/fix_hat/mario/mario.mcfunction @@ -1,7 +1,3 @@ -################################################### -# as: Player # -# Descr: Replace #hat item with #hat_on_head item # -################################################### - -clear @s minecraft:stick{Tags:["is_hat"],CustomModelData:3177} 1 +# as: Player, descr: Replace #hat item with equivalent #hat_on_head item +clear @s minecraft:stick{CustomModelData:3177, Tags:["is_hat"]} 1 execute as @s run loot give @s loot hats:hat/mario/mario \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/mario/mario_cap.mcfunction b/datapack/data/hats/functions/fix_hat/mario/mario_cap.mcfunction index 3038e2f..bb3f5f0 100644 --- a/datapack/data/hats/functions/fix_hat/mario/mario_cap.mcfunction +++ b/datapack/data/hats/functions/fix_hat/mario/mario_cap.mcfunction @@ -1,7 +1,3 @@ -################################################### -# as: Player # -# Descr: Replace #hat item with #hat_on_head item # -################################################### - -clear @s minecraft:stick{Tags:["is_hat"],CustomModelData:3170} 1 +# as: Player, descr: Replace #hat item with equivalent #hat_on_head item +clear @s minecraft:stick{CustomModelData:3170, Tags:["is_hat"]} 1 execute as @s run loot give @s loot hats:hat/mario/mario_cap \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/mario/toad_blue.mcfunction b/datapack/data/hats/functions/fix_hat/mario/toad_blue.mcfunction index 12b9d7c..5e7b304 100644 --- a/datapack/data/hats/functions/fix_hat/mario/toad_blue.mcfunction +++ b/datapack/data/hats/functions/fix_hat/mario/toad_blue.mcfunction @@ -1,7 +1,3 @@ -################################################### -# as: Player # -# Descr: Replace #hat item with #hat_on_head item # -################################################### - -clear @s minecraft:stick{Tags:["is_hat"],CustomModelData:3174} 1 +# as: Player, descr: Replace #hat item with equivalent #hat_on_head item +clear @s minecraft:stick{CustomModelData:3174, Tags:["is_hat"]} 1 execute as @s run loot give @s loot hats:hat/mario/toad_blue \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/mario/toad_green.mcfunction b/datapack/data/hats/functions/fix_hat/mario/toad_green.mcfunction index 381d67a..bf5780b 100644 --- a/datapack/data/hats/functions/fix_hat/mario/toad_green.mcfunction +++ b/datapack/data/hats/functions/fix_hat/mario/toad_green.mcfunction @@ -1,7 +1,3 @@ -################################################### -# as: Player # -# Descr: Replace #hat item with #hat_on_head item # -################################################### - -clear @s minecraft:stick{Tags:["is_hat"],CustomModelData:3176} 1 +# as: Player, descr: Replace #hat item with equivalent #hat_on_head item +clear @s minecraft:stick{CustomModelData:3176, Tags:["is_hat"]} 1 execute as @s run loot give @s loot hats:hat/mario/toad_green \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/mario/toad_red.mcfunction b/datapack/data/hats/functions/fix_hat/mario/toad_red.mcfunction index 898ddeb..2ad6d71 100644 --- a/datapack/data/hats/functions/fix_hat/mario/toad_red.mcfunction +++ b/datapack/data/hats/functions/fix_hat/mario/toad_red.mcfunction @@ -1,7 +1,3 @@ -################################################### -# as: Player # -# Descr: Replace #hat item with #hat_on_head item # -################################################### - -clear @s minecraft:stick{Tags:["is_hat"],CustomModelData:3173} 1 +# as: Player, descr: Replace #hat item with equivalent #hat_on_head item +clear @s minecraft:stick{CustomModelData:3173, Tags:["is_hat"]} 1 execute as @s run loot give @s loot hats:hat/mario/toad_red \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/mario/toad_yellow.mcfunction b/datapack/data/hats/functions/fix_hat/mario/toad_yellow.mcfunction index 59f0b5b..2bd2553 100644 --- a/datapack/data/hats/functions/fix_hat/mario/toad_yellow.mcfunction +++ b/datapack/data/hats/functions/fix_hat/mario/toad_yellow.mcfunction @@ -1,7 +1,3 @@ -################################################### -# as: Player # -# Descr: Replace #hat item with #hat_on_head item # -################################################### - -clear @s minecraft:stick{Tags:["is_hat"],CustomModelData:3175} 1 +# as: Player, descr: Replace #hat item with equivalent #hat_on_head item +clear @s minecraft:stick{CustomModelData:3175, Tags:["is_hat"]} 1 execute as @s run loot give @s loot hats:hat/mario/toad_yellow \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/squid.mcfunction b/datapack/data/hats/functions/fix_hat/squid.mcfunction index 2d728b3..ba5cdec 100644 --- a/datapack/data/hats/functions/fix_hat/squid.mcfunction +++ b/datapack/data/hats/functions/fix_hat/squid.mcfunction @@ -1,7 +1,3 @@ -################################################### -# as: Player # -# Descr: Replace #hat item with #hat_on_head item # -################################################### - -clear @s minecraft:stick{Tags:["is_hat"],CustomModelData:3001} 1 +# as: Player, descr: Replace #hat item with equivalent #hat_on_head item +clear @s minecraft:stick{CustomModelData:3001, Tags:["is_hat"]} 1 execute as @s run loot give @s loot hats:hat/squid \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/tophats/black.mcfunction b/datapack/data/hats/functions/fix_hat/tophats/black.mcfunction index fa6fc21..e6098ef 100644 --- a/datapack/data/hats/functions/fix_hat/tophats/black.mcfunction +++ b/datapack/data/hats/functions/fix_hat/tophats/black.mcfunction @@ -1,7 +1,3 @@ -################################################### -# as: Player # -# Descr: Replace #hat item with #hat_on_head item # -################################################### - -clear @s minecraft:stick{Tags:["is_hat"],CustomModelData:3115} 1 +# as: Player, descr: Replace #hat item with equivalent #hat_on_head item +clear @s minecraft:stick{CustomModelData:3115, Tags:["is_hat"]} 1 execute as @s run loot give @s loot hats:hat/tophats/black \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/tophats/black_monocle.mcfunction b/datapack/data/hats/functions/fix_hat/tophats/black_monocle.mcfunction index 60bc9c6..7795eb3 100644 --- a/datapack/data/hats/functions/fix_hat/tophats/black_monocle.mcfunction +++ b/datapack/data/hats/functions/fix_hat/tophats/black_monocle.mcfunction @@ -1,7 +1,3 @@ -################################################### -# as: Player # -# Descr: Replace #hat item with #hat_on_head item # -################################################### - -clear @s minecraft:stick{Tags:["is_hat"],CustomModelData:3117} 1 +# as: Player, descr: Replace #hat item with equivalent #hat_on_head item +clear @s minecraft:stick{CustomModelData:3117, Tags:["is_hat"]} 1 execute as @s run loot give @s loot hats:hat/tophats/black_monocle \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/tophats/blue.mcfunction b/datapack/data/hats/functions/fix_hat/tophats/blue.mcfunction index cbf275e..6bf0264 100644 --- a/datapack/data/hats/functions/fix_hat/tophats/blue.mcfunction +++ b/datapack/data/hats/functions/fix_hat/tophats/blue.mcfunction @@ -1,7 +1,3 @@ -################################################### -# as: Player # -# Descr: Replace #hat item with #hat_on_head item # -################################################### - -clear @s minecraft:stick{Tags:["is_hat"],CustomModelData:3111} 1 +# as: Player, descr: Replace #hat item with equivalent #hat_on_head item +clear @s minecraft:stick{CustomModelData:3111, Tags:["is_hat"]} 1 execute as @s run loot give @s loot hats:hat/tophats/blue \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/tophats/brown.mcfunction b/datapack/data/hats/functions/fix_hat/tophats/brown.mcfunction index 4b145f5..aede68c 100644 --- a/datapack/data/hats/functions/fix_hat/tophats/brown.mcfunction +++ b/datapack/data/hats/functions/fix_hat/tophats/brown.mcfunction @@ -1,7 +1,3 @@ -################################################### -# as: Player # -# Descr: Replace #hat item with #hat_on_head item # -################################################### - -clear @s minecraft:stick{Tags:["is_hat"],CustomModelData:3112} 1 +# as: Player, descr: Replace #hat item with equivalent #hat_on_head item +clear @s minecraft:stick{CustomModelData:3112, Tags:["is_hat"]} 1 execute as @s run loot give @s loot hats:hat/tophats/brown \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/tophats/cyan.mcfunction b/datapack/data/hats/functions/fix_hat/tophats/cyan.mcfunction index 1bb06ce..83643de 100644 --- a/datapack/data/hats/functions/fix_hat/tophats/cyan.mcfunction +++ b/datapack/data/hats/functions/fix_hat/tophats/cyan.mcfunction @@ -1,7 +1,3 @@ -################################################### -# as: Player # -# Descr: Replace #hat item with #hat_on_head item # -################################################### - -clear @s minecraft:stick{Tags:["is_hat"],CustomModelData:3109} 1 +# as: Player, descr: Replace #hat item with equivalent #hat_on_head item +clear @s minecraft:stick{CustomModelData:3109, Tags:["is_hat"]} 1 execute as @s run loot give @s loot hats:hat/tophats/cyan \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/tophats/gray.mcfunction b/datapack/data/hats/functions/fix_hat/tophats/gray.mcfunction index 7853f9c..fe79337 100644 --- a/datapack/data/hats/functions/fix_hat/tophats/gray.mcfunction +++ b/datapack/data/hats/functions/fix_hat/tophats/gray.mcfunction @@ -1,7 +1,3 @@ -################################################### -# as: Player # -# Descr: Replace #hat item with #hat_on_head item # -################################################### - -clear @s minecraft:stick{Tags:["is_hat"],CustomModelData:3107} 1 +# as: Player, descr: Replace #hat item with equivalent #hat_on_head item +clear @s minecraft:stick{CustomModelData:3107, Tags:["is_hat"]} 1 execute as @s run loot give @s loot hats:hat/tophats/gray \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/tophats/green.mcfunction b/datapack/data/hats/functions/fix_hat/tophats/green.mcfunction index 54dc91c..b9275a4 100644 --- a/datapack/data/hats/functions/fix_hat/tophats/green.mcfunction +++ b/datapack/data/hats/functions/fix_hat/tophats/green.mcfunction @@ -1,7 +1,3 @@ -################################################### -# as: Player # -# Descr: Replace #hat item with #hat_on_head item # -################################################### - -clear @s minecraft:stick{Tags:["is_hat"],CustomModelData:3113} 1 +# as: Player, descr: Replace #hat item with equivalent #hat_on_head item +clear @s minecraft:stick{CustomModelData:3113, Tags:["is_hat"]} 1 execute as @s run loot give @s loot hats:hat/tophats/green \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/tophats/light_blue.mcfunction b/datapack/data/hats/functions/fix_hat/tophats/light_blue.mcfunction index 38f63bb..0a861fc 100644 --- a/datapack/data/hats/functions/fix_hat/tophats/light_blue.mcfunction +++ b/datapack/data/hats/functions/fix_hat/tophats/light_blue.mcfunction @@ -1,7 +1,3 @@ -################################################### -# as: Player # -# Descr: Replace #hat item with #hat_on_head item # -################################################### - -clear @s minecraft:stick{Tags:["is_hat"],CustomModelData:3103} 1 +# as: Player, descr: Replace #hat item with equivalent #hat_on_head item +clear @s minecraft:stick{CustomModelData:3103, Tags:["is_hat"]} 1 execute as @s run loot give @s loot hats:hat/tophats/light_blue \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/tophats/light_gray.mcfunction b/datapack/data/hats/functions/fix_hat/tophats/light_gray.mcfunction index d95e3d8..58975e6 100644 --- a/datapack/data/hats/functions/fix_hat/tophats/light_gray.mcfunction +++ b/datapack/data/hats/functions/fix_hat/tophats/light_gray.mcfunction @@ -1,7 +1,3 @@ -################################################### -# as: Player # -# Descr: Replace #hat item with #hat_on_head item # -################################################### - -clear @s minecraft:stick{Tags:["is_hat"],CustomModelData:3108} 1 +# as: Player, descr: Replace #hat item with equivalent #hat_on_head item +clear @s minecraft:stick{CustomModelData:3108, Tags:["is_hat"]} 1 execute as @s run loot give @s loot hats:hat/tophats/light_gray \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/tophats/lime.mcfunction b/datapack/data/hats/functions/fix_hat/tophats/lime.mcfunction index cf399f1..b6e546b 100644 --- a/datapack/data/hats/functions/fix_hat/tophats/lime.mcfunction +++ b/datapack/data/hats/functions/fix_hat/tophats/lime.mcfunction @@ -1,7 +1,3 @@ -################################################### -# as: Player # -# Descr: Replace #hat item with #hat_on_head item # -################################################### - -clear @s minecraft:stick{Tags:["is_hat"],CustomModelData:3105} 1 +# as: Player, descr: Replace #hat item with equivalent #hat_on_head item +clear @s minecraft:stick{CustomModelData:3105, Tags:["is_hat"]} 1 execute as @s run loot give @s loot hats:hat/tophats/lime \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/tophats/magenta.mcfunction b/datapack/data/hats/functions/fix_hat/tophats/magenta.mcfunction index 75d1a89..c5beabc 100644 --- a/datapack/data/hats/functions/fix_hat/tophats/magenta.mcfunction +++ b/datapack/data/hats/functions/fix_hat/tophats/magenta.mcfunction @@ -1,7 +1,3 @@ -################################################### -# as: Player # -# Descr: Replace #hat item with #hat_on_head item # -################################################### - -clear @s minecraft:stick{Tags:["is_hat"],CustomModelData:3102} 1 +# as: Player, descr: Replace #hat item with equivalent #hat_on_head item +clear @s minecraft:stick{CustomModelData:3102, Tags:["is_hat"]} 1 execute as @s run loot give @s loot hats:hat/tophats/magenta \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/tophats/orange.mcfunction b/datapack/data/hats/functions/fix_hat/tophats/orange.mcfunction index adbea61..0261f3d 100644 --- a/datapack/data/hats/functions/fix_hat/tophats/orange.mcfunction +++ b/datapack/data/hats/functions/fix_hat/tophats/orange.mcfunction @@ -1,7 +1,3 @@ -################################################### -# as: Player # -# Descr: Replace #hat item with #hat_on_head item # -################################################### - -clear @s minecraft:stick{Tags:["is_hat"],CustomModelData:3101} 1 +# as: Player, descr: Replace #hat item with equivalent #hat_on_head item +clear @s minecraft:stick{CustomModelData:3101, Tags:["is_hat"]} 1 execute as @s run loot give @s loot hats:hat/tophats/orange \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/tophats/pink.mcfunction b/datapack/data/hats/functions/fix_hat/tophats/pink.mcfunction index 9c1c4ea..0cf199b 100644 --- a/datapack/data/hats/functions/fix_hat/tophats/pink.mcfunction +++ b/datapack/data/hats/functions/fix_hat/tophats/pink.mcfunction @@ -1,7 +1,3 @@ -################################################### -# as: Player # -# Descr: Replace #hat item with #hat_on_head item # -################################################### - -clear @s minecraft:stick{Tags:["is_hat"],CustomModelData:3106} 1 +# as: Player, descr: Replace #hat item with equivalent #hat_on_head item +clear @s minecraft:stick{CustomModelData:3106, Tags:["is_hat"]} 1 execute as @s run loot give @s loot hats:hat/tophats/pink \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/tophats/purple.mcfunction b/datapack/data/hats/functions/fix_hat/tophats/purple.mcfunction index bedae68..40960a9 100644 --- a/datapack/data/hats/functions/fix_hat/tophats/purple.mcfunction +++ b/datapack/data/hats/functions/fix_hat/tophats/purple.mcfunction @@ -1,7 +1,3 @@ -################################################### -# as: Player # -# Descr: Replace #hat item with #hat_on_head item # -################################################### - -clear @s minecraft:stick{Tags:["is_hat"],CustomModelData:3110} 1 +# as: Player, descr: Replace #hat item with equivalent #hat_on_head item +clear @s minecraft:stick{CustomModelData:3110, Tags:["is_hat"]} 1 execute as @s run loot give @s loot hats:hat/tophats/purple \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/tophats/rainbow.mcfunction b/datapack/data/hats/functions/fix_hat/tophats/rainbow.mcfunction index 4ef2099..56c9c8e 100644 --- a/datapack/data/hats/functions/fix_hat/tophats/rainbow.mcfunction +++ b/datapack/data/hats/functions/fix_hat/tophats/rainbow.mcfunction @@ -1,7 +1,3 @@ -################################################### -# as: Player # -# Descr: Replace #hat item with #hat_on_head item # -################################################### - -clear @s minecraft:stick{Tags:["is_hat"],CustomModelData:3116} 1 +# as: Player, descr: Replace #hat item with equivalent #hat_on_head item +clear @s minecraft:stick{CustomModelData:3116, Tags:["is_hat"]} 1 execute as @s run loot give @s loot hats:hat/tophats/rainbow \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/tophats/red.mcfunction b/datapack/data/hats/functions/fix_hat/tophats/red.mcfunction index ecef3a0..8e66d43 100644 --- a/datapack/data/hats/functions/fix_hat/tophats/red.mcfunction +++ b/datapack/data/hats/functions/fix_hat/tophats/red.mcfunction @@ -1,7 +1,3 @@ -################################################### -# as: Player # -# Descr: Replace #hat item with #hat_on_head item # -################################################### - -clear @s minecraft:stick{Tags:["is_hat"],CustomModelData:3114} 1 +# as: Player, descr: Replace #hat item with equivalent #hat_on_head item +clear @s minecraft:stick{CustomModelData:3114, Tags:["is_hat"]} 1 execute as @s run loot give @s loot hats:hat/tophats/red \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/tophats/white.mcfunction b/datapack/data/hats/functions/fix_hat/tophats/white.mcfunction index 3d522e8..a9d90ce 100644 --- a/datapack/data/hats/functions/fix_hat/tophats/white.mcfunction +++ b/datapack/data/hats/functions/fix_hat/tophats/white.mcfunction @@ -1,7 +1,3 @@ -################################################### -# as: Player # -# Descr: Replace #hat item with #hat_on_head item # -################################################### - -clear @s minecraft:stick{Tags:["is_hat"],CustomModelData:3100} 1 +# as: Player, descr: Replace #hat item with equivalent #hat_on_head item +clear @s minecraft:stick{CustomModelData:3100, Tags:["is_hat"]} 1 execute as @s run loot give @s loot hats:hat/tophats/white \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/tophats/yellow.mcfunction b/datapack/data/hats/functions/fix_hat/tophats/yellow.mcfunction index 24e7b16..225549b 100644 --- a/datapack/data/hats/functions/fix_hat/tophats/yellow.mcfunction +++ b/datapack/data/hats/functions/fix_hat/tophats/yellow.mcfunction @@ -1,7 +1,3 @@ -################################################### -# as: Player # -# Descr: Replace #hat item with #hat_on_head item # -################################################### - -clear @s minecraft:stick{Tags:["is_hat"],CustomModelData:3104} 1 +# as: Player, descr: Replace #hat item with equivalent #hat_on_head item +clear @s minecraft:stick{CustomModelData:3104, Tags:["is_hat"]} 1 execute as @s run loot give @s loot hats:hat/tophats/yellow \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/villager/armorer.mcfunction b/datapack/data/hats/functions/fix_hat/villager/armorer.mcfunction index 875838e..21bb4e5 100644 --- a/datapack/data/hats/functions/fix_hat/villager/armorer.mcfunction +++ b/datapack/data/hats/functions/fix_hat/villager/armorer.mcfunction @@ -1,7 +1,3 @@ -################################################### -# as: Player # -# Descr: Replace #hat item with #hat_on_head item # -################################################### - -clear @s minecraft:stick{Tags:["is_hat"],CustomModelData:3160} 1 +# as: Player, descr: Replace #hat item with equivalent #hat_on_head item +clear @s minecraft:stick{CustomModelData:3160, Tags:["is_hat"]} 1 execute as @s run loot give @s loot hats:hat/villager/armorer \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/villager/farmer.mcfunction b/datapack/data/hats/functions/fix_hat/villager/farmer.mcfunction index ac2bdde..0e78ce0 100644 --- a/datapack/data/hats/functions/fix_hat/villager/farmer.mcfunction +++ b/datapack/data/hats/functions/fix_hat/villager/farmer.mcfunction @@ -1,7 +1,3 @@ -################################################### -# as: Player # -# Descr: Replace #hat item with #hat_on_head item # -################################################### - -clear @s minecraft:stick{Tags:["is_hat"],CustomModelData:3161} 1 +# as: Player, descr: Replace #hat item with equivalent #hat_on_head item +clear @s minecraft:stick{CustomModelData:3161, Tags:["is_hat"]} 1 execute as @s run loot give @s loot hats:hat/villager/farmer \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/villager/nose.mcfunction b/datapack/data/hats/functions/fix_hat/villager/nose.mcfunction index f20d356..350099c 100644 --- a/datapack/data/hats/functions/fix_hat/villager/nose.mcfunction +++ b/datapack/data/hats/functions/fix_hat/villager/nose.mcfunction @@ -1,7 +1,3 @@ -################################################### -# as: Player # -# Descr: Replace #hat item with #hat_on_head item # -################################################### - -clear @s minecraft:stick{Tags:["is_hat"],CustomModelData:3162} 1 +# as: Player, descr: Replace #hat item with equivalent #hat_on_head item +clear @s minecraft:stick{CustomModelData:3162, Tags:["is_hat"]} 1 execute as @s run loot give @s loot hats:hat/villager/nose \ No newline at end of file From d7ab87abd5772ad3068a33b76515e2ee72ad5abd Mon Sep 17 00:00:00 2001 From: OraneUtan Date: Tue, 19 May 2020 15:11:25 +0200 Subject: [PATCH 06/58] Ignoring all python cache files --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 64a830f..8ff6aa4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .datapack build/__pycache__ +*.pyc \ No newline at end of file From e811dc4c514f886e04912e88ec63d0ad9957cb71 Mon Sep 17 00:00:00 2001 From: OraneUtan Date: Tue, 19 May 2020 15:35:55 +0200 Subject: [PATCH 07/58] "generate_fix_hat_functions" now also generates the root function --- build/generate_fix_hat_functions.py | 65 ++++++++++++++----- .../hat_behavior/fix_hat_from_head.mcfunction | 23 +------ 2 files changed, 50 insertions(+), 38 deletions(-) diff --git a/build/generate_fix_hat_functions.py b/build/generate_fix_hat_functions.py index bfdb90d..4e9981c 100644 --- a/build/generate_fix_hat_functions.py +++ b/build/generate_fix_hat_functions.py @@ -1,26 +1,55 @@ import inspect, os from registry import Registry, Hat -registry = Registry() -hats = list(registry.all_hats()) -base_item_on_head = "stick" - -for hat in hats: - if hat.category == "*": - rel_path = f"{hat.name}" - else: - rel_path = f"{hat.category}/{hat.name}" - - function_path = f"datapack/data/hats/functions/fix_hat/{rel_path}.mcfunction" - function_content = inspect.cleandoc(f""" - # as: Player, descr: Replace #hat item with equivalent #hat_on_head item - clear @s minecraft:{base_item_on_head}{{CustomModelData:{hat.custom_model_data}, Tags:["is_hat"]}} 1 - execute as @s run loot give @s loot hats:hat/{rel_path} - """) +def generate_fix_hat_functions(hats): + for hat in hats: + if hat.category == "*": + rel_path = f"{hat.name}" + else: + rel_path = f"{hat.category}/{hat.name}" + + function_path = f"datapack/data/hats/functions/fix_hat/{rel_path}.mcfunction" + function_content = inspect.cleandoc(f""" + # as: Player, descr: Replace #hat item with equivalent #hat_on_head item + clear @s {base_item_on_head}{{CustomModelData:{hat.custom_model_data}, Tags:["is_hat"]}} 1 + execute as @s run loot give @s loot hats:hat/{rel_path} + """) + + parent_dir = os.path.split(function_path)[0] + if not os.path.exists(parent_dir): + os.makedirs(parent_dir) + + with open(function_path, "w") as file: + file.write(function_content) + +def generate_root_function(hats): + function_content = inspect.cleandoc(""" + # as: Player + # descr: When a Player takes of their hat, they have #hat_on_head item in their inventory. + # Replace that item with an equivalent #hat item""") + function_content += "\n" + + for hat in hats: + if hat.category == "*": + rel_path = f"{hat.name}" + else: + rel_path = f"{hat.category}/{hat.name}" + function_content += "\n" + conditional_command = f"execute as @s[nbt={{Inventory:[{{id:\"{base_item_on_head}\",tag:{{Tags:[\"is_hat\"],CustomModelData:{hat.custom_model_data}}}}}]}}] run function hats:fix_hat/{rel_path}" + function_content += conditional_command + + function_path = "datapack/data/hats/functions/hat_behavior/fix_hat_from_head.mcfunction" parent_dir = os.path.split(function_path)[0] if not os.path.exists(parent_dir): os.makedirs(parent_dir) - with open(function_path, "w") as file: - file.write(function_content) \ No newline at end of file + with open(function_path, "w+") as file: + file.write(function_content) + +registry = Registry() +hats = list(registry.all_hats()) +base_item_on_head = "minecraft:stick" + +generate_fix_hat_functions(hats) +generate_root_function(hats) diff --git a/datapack/data/hats/functions/hat_behavior/fix_hat_from_head.mcfunction b/datapack/data/hats/functions/hat_behavior/fix_hat_from_head.mcfunction index aff18c9..bda4fad 100644 --- a/datapack/data/hats/functions/hat_behavior/fix_hat_from_head.mcfunction +++ b/datapack/data/hats/functions/hat_behavior/fix_hat_from_head.mcfunction @@ -1,16 +1,11 @@ -############################################################################### -# as: Player # -# Descr: Replace #hat_on_head item, that the Player took from their own head, # -# with a #hat item # -############################################################################### +# as: Player +# descr: When a Player takes of their hat, they have #hat_on_head item in their inventory. +# Replace that item with an equivalent #hat item -# Miscellaneous execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3000}}]}] run function hats:fix_hat/fez execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3001}}]}] run function hats:fix_hat/squid execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3002}}]}] run function hats:fix_hat/arrow execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3003}}]}] run function hats:fix_hat/frying_pan - -# Tophats execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3100}}]}] run function hats:fix_hat/tophats/white execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3101}}]}] run function hats:fix_hat/tophats/orange execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3102}}]}] run function hats:fix_hat/tophats/magenta @@ -29,8 +24,6 @@ execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomM execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3115}}]}] run function hats:fix_hat/tophats/black execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3116}}]}] run function hats:fix_hat/tophats/rainbow execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3117}}]}] run function hats:fix_hat/tophats/black_monocle - -# Cats execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3120}}]}] run function hats:fix_hat/cats/ocelot execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3121}}]}] run function hats:fix_hat/cats/tabby execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3122}}]}] run function hats:fix_hat/cats/tuxedo @@ -43,29 +36,21 @@ execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomM execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3129}}]}] run function hats:fix_hat/cats/white execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3130}}]}] run function hats:fix_hat/cats/jellie execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3131}}]}] run function hats:fix_hat/cats/black - -# Glasses execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3140}}]}] run function hats:fix_hat/glasses/sunglasses execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3141}}]}] run function hats:fix_hat/glasses/harry_potter execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3142}}]}] run function hats:fix_hat/glasses/half_rim execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3143}}]}] run function hats:fix_hat/glasses/rainbow execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3144}}]}] run function hats:fix_hat/glasses/librarian execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3145}}]}] run function hats:fix_hat/glasses/three_d - -# Accessories execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3150}}]}] run function hats:fix_hat/accessories/ninja_headband execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3151}}]}] run function hats:fix_hat/accessories/steve_mask execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3152}}]}] run function hats:fix_hat/accessories/alex_mask execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3153}}]}] run function hats:fix_hat/accessories/snorkel_mask_blue execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3154}}]}] run function hats:fix_hat/accessories/snorkel_mask_red execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3155}}]}] run function hats:fix_hat/accessories/googly_eyes - -# Villager related execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3160}}]}] run function hats:fix_hat/villager/armorer execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3161}}]}] run function hats:fix_hat/villager/farmer execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3162}}]}] run function hats:fix_hat/villager/nose - -# Mario execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3170}}]}] run function hats:fix_hat/mario/mario_cap execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3171}}]}] run function hats:fix_hat/mario/luigi_cap execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3172}}]}] run function hats:fix_hat/mario/cappy @@ -75,8 +60,6 @@ execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomM execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3176}}]}] run function hats:fix_hat/mario/toad_green execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3177}}]}] run function hats:fix_hat/mario/mario execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3178}}]}] run function hats:fix_hat/mario/luigi - -# Halloween execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:7773180}}]}] run function hats:fix_hat/halloween/wiggly_ghast execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:7773181}}]}] run function hats:fix_hat/halloween/native_american_headband execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:7773182}}]}] run function hats:fix_hat/halloween/jason_mask \ No newline at end of file From 1660d83fe4db85a08901d9e1ccb26b480940e1b9 Mon Sep 17 00:00:00 2001 From: OraneUtan Date: Tue, 19 May 2020 17:46:32 +0200 Subject: [PATCH 08/58] Added build script that generates the loot tables for the hats --- build/generate_hat_loot_tables.py | 56 +++++++++++++++++++ .../data/hats/loot_tables/hat/_hat_base.json | 21 ------- .../hat/accessories/alex_mask.json | 27 +-------- .../hat/accessories/googly_eyes.json | 27 +-------- .../hat/accessories/ninja_headband.json | 27 +-------- .../hat/accessories/snorkel_mask_blue.json | 27 +-------- .../hat/accessories/snorkel_mask_red.json | 27 +-------- .../hat/accessories/steve_mask.json | 27 +-------- datapack/data/hats/loot_tables/hat/arrow.json | 25 +-------- .../data/hats/loot_tables/hat/cats/black.json | 27 +-------- .../hat/cats/british_shorthair.json | 27 +-------- .../hats/loot_tables/hat/cats/calico.json | 27 +-------- .../hats/loot_tables/hat/cats/jellie.json | 27 +-------- .../hats/loot_tables/hat/cats/ocelot.json | 27 +-------- .../hats/loot_tables/hat/cats/persian.json | 27 +-------- .../hats/loot_tables/hat/cats/ragdoll.json | 27 +-------- .../data/hats/loot_tables/hat/cats/red.json | 27 +-------- .../hats/loot_tables/hat/cats/siamese.json | 27 +-------- .../data/hats/loot_tables/hat/cats/tabby.json | 27 +-------- .../hats/loot_tables/hat/cats/tuxedo.json | 27 +-------- .../data/hats/loot_tables/hat/cats/white.json | 27 +-------- datapack/data/hats/loot_tables/hat/fez.json | 25 +-------- .../data/hats/loot_tables/hat/frying_pan.json | 25 +-------- .../loot_tables/hat/glasses/half_rim.json | 27 +-------- .../loot_tables/hat/glasses/harry_potter.json | 27 +-------- .../loot_tables/hat/glasses/librarian.json | 27 +-------- .../hats/loot_tables/hat/glasses/rainbow.json | 27 +-------- .../loot_tables/hat/glasses/sunglasses.json | 27 +-------- .../hats/loot_tables/hat/glasses/three_d.json | 27 +-------- .../loot_tables/hat/halloween/jason_mask.json | 25 +-------- .../halloween/native_american_headband.json | 25 +-------- .../hat/halloween/wiggly_ghast.json | 25 +-------- .../hats/loot_tables/hat/mario/cappy.json | 27 +-------- .../hats/loot_tables/hat/mario/luigi.json | 27 +-------- .../hats/loot_tables/hat/mario/luigi_cap.json | 27 +-------- .../hats/loot_tables/hat/mario/mario.json | 27 +-------- .../hats/loot_tables/hat/mario/mario_cap.json | 27 +-------- .../hats/loot_tables/hat/mario/toad_blue.json | 27 +-------- .../loot_tables/hat/mario/toad_green.json | 27 +-------- .../hats/loot_tables/hat/mario/toad_red.json | 27 +-------- .../loot_tables/hat/mario/toad_yellow.json | 27 +-------- datapack/data/hats/loot_tables/hat/squid.json | 25 +-------- .../hats/loot_tables/hat/tophats/black.json | 27 +-------- .../hat/tophats/black_monocle.json | 27 +-------- .../hats/loot_tables/hat/tophats/blue.json | 27 +-------- .../hats/loot_tables/hat/tophats/brown.json | 27 +-------- .../hats/loot_tables/hat/tophats/cyan.json | 27 +-------- .../hats/loot_tables/hat/tophats/gray.json | 27 +-------- .../hats/loot_tables/hat/tophats/green.json | 27 +-------- .../loot_tables/hat/tophats/light_blue.json | 27 +-------- .../loot_tables/hat/tophats/light_gray.json | 27 +-------- .../hats/loot_tables/hat/tophats/lime.json | 27 +-------- .../hats/loot_tables/hat/tophats/magenta.json | 27 +-------- .../hats/loot_tables/hat/tophats/orange.json | 27 +-------- .../hats/loot_tables/hat/tophats/pink.json | 27 +-------- .../hats/loot_tables/hat/tophats/purple.json | 27 +-------- .../hats/loot_tables/hat/tophats/rainbow.json | 27 +-------- .../hats/loot_tables/hat/tophats/red.json | 27 +-------- .../hats/loot_tables/hat/tophats/white.json | 27 +-------- .../hats/loot_tables/hat/tophats/yellow.json | 27 +-------- .../loot_tables/hat/villager/armorer.json | 27 +-------- .../hats/loot_tables/hat/villager/farmer.json | 27 +-------- .../hats/loot_tables/hat/villager/nose.json | 27 +-------- .../loot_tables/hat_on_head/_hat_base.json | 21 ------- .../hat_on_head/accessories/alex_mask.json | 27 +-------- .../hat_on_head/accessories/googly_eyes.json | 27 +-------- .../accessories/ninja_headband.json | 27 +-------- .../accessories/snorkel_mask_blue.json | 27 +-------- .../accessories/snorkel_mask_red.json | 27 +-------- .../hat_on_head/accessories/steve_mask.json | 27 +-------- .../hats/loot_tables/hat_on_head/arrow.json | 25 +-------- .../loot_tables/hat_on_head/cats/black.json | 27 +-------- .../hat_on_head/cats/british_shorthair.json | 27 +-------- .../loot_tables/hat_on_head/cats/calico.json | 27 +-------- .../loot_tables/hat_on_head/cats/jellie.json | 27 +-------- .../loot_tables/hat_on_head/cats/ocelot.json | 27 +-------- .../loot_tables/hat_on_head/cats/persian.json | 27 +-------- .../loot_tables/hat_on_head/cats/ragdoll.json | 27 +-------- .../loot_tables/hat_on_head/cats/red.json | 27 +-------- .../loot_tables/hat_on_head/cats/siamese.json | 27 +-------- .../loot_tables/hat_on_head/cats/tabby.json | 27 +-------- .../loot_tables/hat_on_head/cats/tuxedo.json | 27 +-------- .../loot_tables/hat_on_head/cats/white.json | 27 +-------- .../hats/loot_tables/hat_on_head/fez.json | 25 +-------- .../loot_tables/hat_on_head/frying_pan.json | 25 +-------- .../hat_on_head/glasses/half_rim.json | 27 +-------- .../hat_on_head/glasses/harry_potter.json | 27 +-------- .../hat_on_head/glasses/librarian.json | 27 +-------- .../hat_on_head/glasses/rainbow.json | 27 +-------- .../hat_on_head/glasses/sunglasses.json | 27 +-------- .../hat_on_head/glasses/three_d.json | 27 +-------- .../hat_on_head/halloween/jason_mask.json | 25 +-------- .../halloween/native_american_headband.json | 25 +-------- .../hat_on_head/halloween/wiggly_ghast.json | 25 +-------- .../loot_tables/hat_on_head/mario/cappy.json | 27 +-------- .../loot_tables/hat_on_head/mario/luigi.json | 27 +-------- .../hat_on_head/mario/luigi_cap.json | 27 +-------- .../loot_tables/hat_on_head/mario/mario.json | 27 +-------- .../hat_on_head/mario/mario_cap.json | 27 +-------- .../hat_on_head/mario/toad_blue.json | 27 +-------- .../hat_on_head/mario/toad_green.json | 27 +-------- .../hat_on_head/mario/toad_red.json | 27 +-------- .../hat_on_head/mario/toad_yellow.json | 27 +-------- .../hats/loot_tables/hat_on_head/squid.json | 25 +-------- .../hat_on_head/tophats/black.json | 27 +-------- .../hat_on_head/tophats/black_monocle.json | 27 +-------- .../loot_tables/hat_on_head/tophats/blue.json | 27 +-------- .../hat_on_head/tophats/brown.json | 27 +-------- .../loot_tables/hat_on_head/tophats/cyan.json | 27 +-------- .../loot_tables/hat_on_head/tophats/gray.json | 27 +-------- .../hat_on_head/tophats/green.json | 27 +-------- .../hat_on_head/tophats/light_blue.json | 27 +-------- .../hat_on_head/tophats/light_gray.json | 27 +-------- .../loot_tables/hat_on_head/tophats/lime.json | 27 +-------- .../hat_on_head/tophats/magenta.json | 27 +-------- .../hat_on_head/tophats/orange.json | 27 +-------- .../loot_tables/hat_on_head/tophats/pink.json | 27 +-------- .../hat_on_head/tophats/purple.json | 27 +-------- .../hat_on_head/tophats/rainbow.json | 27 +-------- .../loot_tables/hat_on_head/tophats/red.json | 27 +-------- .../hat_on_head/tophats/white.json | 27 +-------- .../hat_on_head/tophats/yellow.json | 27 +-------- .../hat_on_head/villager/armorer.json | 27 +-------- .../hat_on_head/villager/farmer.json | 27 +-------- .../hat_on_head/villager/nose.json | 27 +-------- 125 files changed, 178 insertions(+), 3186 deletions(-) create mode 100644 build/generate_hat_loot_tables.py delete mode 100644 datapack/data/hats/loot_tables/hat/_hat_base.json delete mode 100644 datapack/data/hats/loot_tables/hat_on_head/_hat_base.json diff --git a/build/generate_hat_loot_tables.py b/build/generate_hat_loot_tables.py new file mode 100644 index 0000000..f05430d --- /dev/null +++ b/build/generate_hat_loot_tables.py @@ -0,0 +1,56 @@ +import json, os +from registry import Registry, Hat + +def hat_loot_table(hat, base_item): + if hat.category == "*": + translation = f"{hat.name}" + else: + translation = f"{hat.category}.{hat.name}" + + return { + "type": "minecraft:generic", + "pools": [ + { + "functions": [ + { + "function": "minecraft:set_name", + "name": { + "translate": f"item.hats.{translation}.name" + } + }, + { + "function": "set_nbt", + "tag": f'{{CustomModelData:{hat.custom_model_data}, Tags:["is_hat", "hats.hat", "{hat.type}"]}}' + } + ], + "rolls": 1, + "entries": [ + { + "type": "tag", + "name": base_item, + "expand": True + } + ] + } + ] + } + +hats_root_model = "resourcepack/assets/minecraft/models/item/leather_helmet.json" +hats_on_head_root_model = "resourecpack/assets/minecraft/models/item/stick.json" + +registry = Registry() +hats = list(registry.all_hats()) + +for hat in hats: + if hat.category == "*": + rel_path = f"{hat.name}" + else: + rel_path = f"{hat.category}/{hat.name}" + + hat_loot_table_path = f"datapack/data/hats/loot_tables/hat/{rel_path}.json" + with open(hat_loot_table_path, "w+") as file: + json.dump(hat_loot_table(hat, "hats:hat"), file, separators=(',', ':')) + + hat_on_head_loot_table_path = f"datapack/data/hats/loot_tables/hat_on_head/{rel_path}.json" + with open(hat_on_head_loot_table_path, "w+") as file: + json.dump(hat_loot_table(hat, "hats:hat_on_head"), file, separators=(',', ':')) \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat/_hat_base.json b/datapack/data/hats/loot_tables/hat/_hat_base.json deleted file mode 100644 index 1694fdb..0000000 --- a/datapack/data/hats/loot_tables/hat/_hat_base.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "set_nbt", - "tag": "{Tags:[\"is_hat\", \"hats.hat\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "tag", - "name": "hats:hat", - "expand": true - } - ] - } - ] -} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat/accessories/alex_mask.json b/datapack/data/hats/loot_tables/hat/accessories/alex_mask.json index a960911..a319c47 100644 --- a/datapack/data/hats/loot_tables/hat/accessories/alex_mask.json +++ b/datapack/data/hats/loot_tables/hat/accessories/alex_mask.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.accessories.alex_mask.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3152, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.alex_mask\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.accessories.alex_mask.name"}},{"function":"set_nbt","tag":"{CustomModelData:3152, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.accessories.alex_mask\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat/accessories/googly_eyes.json b/datapack/data/hats/loot_tables/hat/accessories/googly_eyes.json index 65457fb..7be1c01 100644 --- a/datapack/data/hats/loot_tables/hat/accessories/googly_eyes.json +++ b/datapack/data/hats/loot_tables/hat/accessories/googly_eyes.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.accessories.googly_eyes.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3155, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.googly_eyes\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.accessories.googly_eyes.name"}},{"function":"set_nbt","tag":"{CustomModelData:3155, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.accessories.googly_eyes\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat/accessories/ninja_headband.json b/datapack/data/hats/loot_tables/hat/accessories/ninja_headband.json index 9f4acb2..be815aa 100644 --- a/datapack/data/hats/loot_tables/hat/accessories/ninja_headband.json +++ b/datapack/data/hats/loot_tables/hat/accessories/ninja_headband.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.accessories.ninja_headband.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3150, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.ninja_headband\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.accessories.ninja_headband.name"}},{"function":"set_nbt","tag":"{CustomModelData:3150, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.accessories.ninja_headband\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat/accessories/snorkel_mask_blue.json b/datapack/data/hats/loot_tables/hat/accessories/snorkel_mask_blue.json index ee4f075..d49406d 100644 --- a/datapack/data/hats/loot_tables/hat/accessories/snorkel_mask_blue.json +++ b/datapack/data/hats/loot_tables/hat/accessories/snorkel_mask_blue.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.accessories.snorkel_mask_blue.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3153, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.snorkel_mask_blue\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.accessories.snorkel_mask_blue.name"}},{"function":"set_nbt","tag":"{CustomModelData:3153, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.accessories.snorkel_mask_blue\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat/accessories/snorkel_mask_red.json b/datapack/data/hats/loot_tables/hat/accessories/snorkel_mask_red.json index 2405789..02c67d6 100644 --- a/datapack/data/hats/loot_tables/hat/accessories/snorkel_mask_red.json +++ b/datapack/data/hats/loot_tables/hat/accessories/snorkel_mask_red.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.accessories.snorkel_mask_red.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3154, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.snorkel_mask_red\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.accessories.snorkel_mask_red.name"}},{"function":"set_nbt","tag":"{CustomModelData:3154, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.accessories.snorkel_mask_red\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat/accessories/steve_mask.json b/datapack/data/hats/loot_tables/hat/accessories/steve_mask.json index d2f1e4c..d49e3a3 100644 --- a/datapack/data/hats/loot_tables/hat/accessories/steve_mask.json +++ b/datapack/data/hats/loot_tables/hat/accessories/steve_mask.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.accessories.steve_mask.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3151, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.steve_mask\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.accessories.steve_mask.name"}},{"function":"set_nbt","tag":"{CustomModelData:3151, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.accessories.steve_mask\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat/arrow.json b/datapack/data/hats/loot_tables/hat/arrow.json index ca2402a..4e6e02a 100644 --- a/datapack/data/hats/loot_tables/hat/arrow.json +++ b/datapack/data/hats/loot_tables/hat/arrow.json @@ -1,24 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": {"translate": "item.hats.arrow.name"} - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3002, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.arrow_prop\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.arrow.name"}},{"function":"set_nbt","tag":"{CustomModelData:3002, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.arrow\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat/cats/black.json b/datapack/data/hats/loot_tables/hat/cats/black.json index 0c4507d..fcddee3 100644 --- a/datapack/data/hats/loot_tables/hat/cats/black.json +++ b/datapack/data/hats/loot_tables/hat/cats/black.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.cats.black.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3131, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.cat_black\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.cats.black.name"}},{"function":"set_nbt","tag":"{CustomModelData:3131, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.cats.black\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat/cats/british_shorthair.json b/datapack/data/hats/loot_tables/hat/cats/british_shorthair.json index 7e139e2..787de41 100644 --- a/datapack/data/hats/loot_tables/hat/cats/british_shorthair.json +++ b/datapack/data/hats/loot_tables/hat/cats/british_shorthair.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.cats.british_shorthair.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3125, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.cat_british_shorthair\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.cats.british_shorthair.name"}},{"function":"set_nbt","tag":"{CustomModelData:3125, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.cats.british_shorthair\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat/cats/calico.json b/datapack/data/hats/loot_tables/hat/cats/calico.json index 5dd23f0..c435bed 100644 --- a/datapack/data/hats/loot_tables/hat/cats/calico.json +++ b/datapack/data/hats/loot_tables/hat/cats/calico.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.cats.calico.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3126, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.cat_calico\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.cats.calico.name"}},{"function":"set_nbt","tag":"{CustomModelData:3126, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.cats.calico\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat/cats/jellie.json b/datapack/data/hats/loot_tables/hat/cats/jellie.json index 9a02093..e6dab52 100644 --- a/datapack/data/hats/loot_tables/hat/cats/jellie.json +++ b/datapack/data/hats/loot_tables/hat/cats/jellie.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.cats.jellie.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3130, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.cat_jellie\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.cats.jellie.name"}},{"function":"set_nbt","tag":"{CustomModelData:3130, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.cats.jellie\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat/cats/ocelot.json b/datapack/data/hats/loot_tables/hat/cats/ocelot.json index d84ff93..52f7abc 100644 --- a/datapack/data/hats/loot_tables/hat/cats/ocelot.json +++ b/datapack/data/hats/loot_tables/hat/cats/ocelot.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.cats.ocelot.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3120, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.cat_ocelot\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.cats.ocelot.name"}},{"function":"set_nbt","tag":"{CustomModelData:3120, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.cats.ocelot\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat/cats/persian.json b/datapack/data/hats/loot_tables/hat/cats/persian.json index 1eec624..dd981c3 100644 --- a/datapack/data/hats/loot_tables/hat/cats/persian.json +++ b/datapack/data/hats/loot_tables/hat/cats/persian.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.cats.persian.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3127, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.cat_persian\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.cats.persian.name"}},{"function":"set_nbt","tag":"{CustomModelData:3127, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.cats.persian\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat/cats/ragdoll.json b/datapack/data/hats/loot_tables/hat/cats/ragdoll.json index 7b2b0d5..cdbe930 100644 --- a/datapack/data/hats/loot_tables/hat/cats/ragdoll.json +++ b/datapack/data/hats/loot_tables/hat/cats/ragdoll.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.cats.ragdoll.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3128, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.cat_ragdoll\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.cats.ragdoll.name"}},{"function":"set_nbt","tag":"{CustomModelData:3128, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.cats.ragdoll\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat/cats/red.json b/datapack/data/hats/loot_tables/hat/cats/red.json index 8691088..6ee8b38 100644 --- a/datapack/data/hats/loot_tables/hat/cats/red.json +++ b/datapack/data/hats/loot_tables/hat/cats/red.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.cats.red.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3123, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.cat_red\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.cats.red.name"}},{"function":"set_nbt","tag":"{CustomModelData:3123, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.cats.red\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat/cats/siamese.json b/datapack/data/hats/loot_tables/hat/cats/siamese.json index 0ec94ea..6b25ce8 100644 --- a/datapack/data/hats/loot_tables/hat/cats/siamese.json +++ b/datapack/data/hats/loot_tables/hat/cats/siamese.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.cats.siamese.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3124, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.cat_siamese\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.cats.siamese.name"}},{"function":"set_nbt","tag":"{CustomModelData:3124, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.cats.siamese\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat/cats/tabby.json b/datapack/data/hats/loot_tables/hat/cats/tabby.json index 8065e0d..d6b706f 100644 --- a/datapack/data/hats/loot_tables/hat/cats/tabby.json +++ b/datapack/data/hats/loot_tables/hat/cats/tabby.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.cats.tabby.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3121, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.cat_tabby\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.cats.tabby.name"}},{"function":"set_nbt","tag":"{CustomModelData:3121, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.cats.tabby\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat/cats/tuxedo.json b/datapack/data/hats/loot_tables/hat/cats/tuxedo.json index 129197d..6786485 100644 --- a/datapack/data/hats/loot_tables/hat/cats/tuxedo.json +++ b/datapack/data/hats/loot_tables/hat/cats/tuxedo.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.cats.tuxedo.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3122, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.cat_tuxedo\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.cats.tuxedo.name"}},{"function":"set_nbt","tag":"{CustomModelData:3122, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.cats.tuxedo\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat/cats/white.json b/datapack/data/hats/loot_tables/hat/cats/white.json index f9bcd82..4b8db76 100644 --- a/datapack/data/hats/loot_tables/hat/cats/white.json +++ b/datapack/data/hats/loot_tables/hat/cats/white.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.cats.white.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3129, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.cat_white\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.cats.white.name"}},{"function":"set_nbt","tag":"{CustomModelData:3129, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.cats.white\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat/fez.json b/datapack/data/hats/loot_tables/hat/fez.json index dfc1690..a537190 100644 --- a/datapack/data/hats/loot_tables/hat/fez.json +++ b/datapack/data/hats/loot_tables/hat/fez.json @@ -1,24 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": {"translate": "item.hats.fez.name"} - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3000, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.fez\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.fez.name"}},{"function":"set_nbt","tag":"{CustomModelData:3000, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.fez\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat/frying_pan.json b/datapack/data/hats/loot_tables/hat/frying_pan.json index e1bf13b..b3f0800 100644 --- a/datapack/data/hats/loot_tables/hat/frying_pan.json +++ b/datapack/data/hats/loot_tables/hat/frying_pan.json @@ -1,24 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": {"translate": "item.hats.frying_pan.name"} - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3003, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.frying_pan\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.frying_pan.name"}},{"function":"set_nbt","tag":"{CustomModelData:3003, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.frying_pan\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat/glasses/half_rim.json b/datapack/data/hats/loot_tables/hat/glasses/half_rim.json index 11e1bbe..003c5a5 100644 --- a/datapack/data/hats/loot_tables/hat/glasses/half_rim.json +++ b/datapack/data/hats/loot_tables/hat/glasses/half_rim.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.glasses.half_rim.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3142, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.half_rim_glasses\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.glasses.half_rim.name"}},{"function":"set_nbt","tag":"{CustomModelData:3142, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.glasses.half_rim\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat/glasses/harry_potter.json b/datapack/data/hats/loot_tables/hat/glasses/harry_potter.json index 94d6063..9613ebc 100644 --- a/datapack/data/hats/loot_tables/hat/glasses/harry_potter.json +++ b/datapack/data/hats/loot_tables/hat/glasses/harry_potter.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.glasses.harry_potter.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3141, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.harry_potter_glasses\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.glasses.harry_potter.name"}},{"function":"set_nbt","tag":"{CustomModelData:3141, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.glasses.harry_potter\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat/glasses/librarian.json b/datapack/data/hats/loot_tables/hat/glasses/librarian.json index 1b10fcd..55b85eb 100644 --- a/datapack/data/hats/loot_tables/hat/glasses/librarian.json +++ b/datapack/data/hats/loot_tables/hat/glasses/librarian.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.glasses.librarian.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3144, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.librarian_glasses\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.glasses.librarian.name"}},{"function":"set_nbt","tag":"{CustomModelData:3144, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.glasses.librarian\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat/glasses/rainbow.json b/datapack/data/hats/loot_tables/hat/glasses/rainbow.json index 210e9ee..bb98bae 100644 --- a/datapack/data/hats/loot_tables/hat/glasses/rainbow.json +++ b/datapack/data/hats/loot_tables/hat/glasses/rainbow.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.glasses.rainbow.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3143, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.rainbow_glasses\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.glasses.rainbow.name"}},{"function":"set_nbt","tag":"{CustomModelData:3143, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.glasses.rainbow\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat/glasses/sunglasses.json b/datapack/data/hats/loot_tables/hat/glasses/sunglasses.json index a18bc1f..2be0144 100644 --- a/datapack/data/hats/loot_tables/hat/glasses/sunglasses.json +++ b/datapack/data/hats/loot_tables/hat/glasses/sunglasses.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.glasses.sunglasses.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3140, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.sunglasses\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.glasses.sunglasses.name"}},{"function":"set_nbt","tag":"{CustomModelData:3140, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.glasses.sunglasses\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat/glasses/three_d.json b/datapack/data/hats/loot_tables/hat/glasses/three_d.json index 3669a92..128f402 100644 --- a/datapack/data/hats/loot_tables/hat/glasses/three_d.json +++ b/datapack/data/hats/loot_tables/hat/glasses/three_d.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.glasses.three_d.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3145, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.three_d_glasses\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.glasses.three_d.name"}},{"function":"set_nbt","tag":"{CustomModelData:3145, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.glasses.three_d\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat/halloween/jason_mask.json b/datapack/data/hats/loot_tables/hat/halloween/jason_mask.json index e53459e..ea2ff43 100644 --- a/datapack/data/hats/loot_tables/hat/halloween/jason_mask.json +++ b/datapack/data/hats/loot_tables/hat/halloween/jason_mask.json @@ -1,24 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": {"translate": "item.hats.halloween.jason_mask.name"} - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:7773182, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.jason_mask\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.halloween.jason_mask.name"}},{"function":"set_nbt","tag":"{CustomModelData:7773182, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.halloween.jason_mask\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat/halloween/native_american_headband.json b/datapack/data/hats/loot_tables/hat/halloween/native_american_headband.json index 5879233..2aaaf3b 100644 --- a/datapack/data/hats/loot_tables/hat/halloween/native_american_headband.json +++ b/datapack/data/hats/loot_tables/hat/halloween/native_american_headband.json @@ -1,24 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": {"translate": "item.hats.halloween.native_american_headband.name"} - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:7773181, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.native_american_headband\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.halloween.native_american_headband.name"}},{"function":"set_nbt","tag":"{CustomModelData:7773181, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.halloween.native_american_headband\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat/halloween/wiggly_ghast.json b/datapack/data/hats/loot_tables/hat/halloween/wiggly_ghast.json index 9077b0b..0cbfcdd 100644 --- a/datapack/data/hats/loot_tables/hat/halloween/wiggly_ghast.json +++ b/datapack/data/hats/loot_tables/hat/halloween/wiggly_ghast.json @@ -1,24 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": {"translate": "item.hats.halloween.wiggly_ghast.name"} - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:7773180, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.wiggly_ghast\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.halloween.wiggly_ghast.name"}},{"function":"set_nbt","tag":"{CustomModelData:7773180, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.halloween.wiggly_ghast\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat/mario/cappy.json b/datapack/data/hats/loot_tables/hat/mario/cappy.json index afa78b5..1437afa 100644 --- a/datapack/data/hats/loot_tables/hat/mario/cappy.json +++ b/datapack/data/hats/loot_tables/hat/mario/cappy.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.mario.cappy.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3172, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.cappy\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.mario.cappy.name"}},{"function":"set_nbt","tag":"{CustomModelData:3172, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.mario.cappy\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat/mario/luigi.json b/datapack/data/hats/loot_tables/hat/mario/luigi.json index 319c98f..87dd5f1 100644 --- a/datapack/data/hats/loot_tables/hat/mario/luigi.json +++ b/datapack/data/hats/loot_tables/hat/mario/luigi.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.mario.luigi.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3178, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.luigi\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.mario.luigi.name"}},{"function":"set_nbt","tag":"{CustomModelData:3178, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.mario.luigi\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat/mario/luigi_cap.json b/datapack/data/hats/loot_tables/hat/mario/luigi_cap.json index 0706e6b..6bbaa67 100644 --- a/datapack/data/hats/loot_tables/hat/mario/luigi_cap.json +++ b/datapack/data/hats/loot_tables/hat/mario/luigi_cap.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.mario.luigi_cap.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3171, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.luigi_cap\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.mario.luigi_cap.name"}},{"function":"set_nbt","tag":"{CustomModelData:3171, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.mario.luigi_cap\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat/mario/mario.json b/datapack/data/hats/loot_tables/hat/mario/mario.json index 9318f7b..e0e8a8c 100644 --- a/datapack/data/hats/loot_tables/hat/mario/mario.json +++ b/datapack/data/hats/loot_tables/hat/mario/mario.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.mario.mario.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3177, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.mario\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.mario.mario.name"}},{"function":"set_nbt","tag":"{CustomModelData:3177, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.mario.mario\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat/mario/mario_cap.json b/datapack/data/hats/loot_tables/hat/mario/mario_cap.json index 17b4c64..7c17030 100644 --- a/datapack/data/hats/loot_tables/hat/mario/mario_cap.json +++ b/datapack/data/hats/loot_tables/hat/mario/mario_cap.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.mario.mario_cap.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3170, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.mario_cap\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.mario.mario_cap.name"}},{"function":"set_nbt","tag":"{CustomModelData:3170, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.mario.mario_cap\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat/mario/toad_blue.json b/datapack/data/hats/loot_tables/hat/mario/toad_blue.json index e156193..18bbee3 100644 --- a/datapack/data/hats/loot_tables/hat/mario/toad_blue.json +++ b/datapack/data/hats/loot_tables/hat/mario/toad_blue.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.mario.toad_blue.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3174, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.toad_blue\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.mario.toad_blue.name"}},{"function":"set_nbt","tag":"{CustomModelData:3174, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.mario.toad_blue\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat/mario/toad_green.json b/datapack/data/hats/loot_tables/hat/mario/toad_green.json index e0ed251..a9b65a7 100644 --- a/datapack/data/hats/loot_tables/hat/mario/toad_green.json +++ b/datapack/data/hats/loot_tables/hat/mario/toad_green.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.mario.toad_green.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3176, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.toad_green\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.mario.toad_green.name"}},{"function":"set_nbt","tag":"{CustomModelData:3176, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.mario.toad_green\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat/mario/toad_red.json b/datapack/data/hats/loot_tables/hat/mario/toad_red.json index 221b9dd..9958a99 100644 --- a/datapack/data/hats/loot_tables/hat/mario/toad_red.json +++ b/datapack/data/hats/loot_tables/hat/mario/toad_red.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.mario.toad_red.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3173, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.toad_red\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.mario.toad_red.name"}},{"function":"set_nbt","tag":"{CustomModelData:3173, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.mario.toad_red\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat/mario/toad_yellow.json b/datapack/data/hats/loot_tables/hat/mario/toad_yellow.json index 4000539..ccadce7 100644 --- a/datapack/data/hats/loot_tables/hat/mario/toad_yellow.json +++ b/datapack/data/hats/loot_tables/hat/mario/toad_yellow.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.mario.toad_yellow.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3175, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.toad_yellow\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.mario.toad_yellow.name"}},{"function":"set_nbt","tag":"{CustomModelData:3175, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.mario.toad_yellow\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat/squid.json b/datapack/data/hats/loot_tables/hat/squid.json index 0a9fbb0..c3b17c8 100644 --- a/datapack/data/hats/loot_tables/hat/squid.json +++ b/datapack/data/hats/loot_tables/hat/squid.json @@ -1,24 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": {"translate": "item.hats.squid.name"} - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3001, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.squid\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.squid.name"}},{"function":"set_nbt","tag":"{CustomModelData:3001, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.squid\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat/tophats/black.json b/datapack/data/hats/loot_tables/hat/tophats/black.json index 8c843ac..8c4b6ca 100644 --- a/datapack/data/hats/loot_tables/hat/tophats/black.json +++ b/datapack/data/hats/loot_tables/hat/tophats/black.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.tophats.black.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3115, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.tophat_black\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.tophats.black.name"}},{"function":"set_nbt","tag":"{CustomModelData:3115, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.tophats.black\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat/tophats/black_monocle.json b/datapack/data/hats/loot_tables/hat/tophats/black_monocle.json index 11a73f1..68a55ca 100644 --- a/datapack/data/hats/loot_tables/hat/tophats/black_monocle.json +++ b/datapack/data/hats/loot_tables/hat/tophats/black_monocle.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.tophats.black_monocle.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3117, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.tophat_black_monocle\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.tophats.black_monocle.name"}},{"function":"set_nbt","tag":"{CustomModelData:3117, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.tophats.black_monocle\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat/tophats/blue.json b/datapack/data/hats/loot_tables/hat/tophats/blue.json index bf9fd5e..e00ec3c 100644 --- a/datapack/data/hats/loot_tables/hat/tophats/blue.json +++ b/datapack/data/hats/loot_tables/hat/tophats/blue.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.tophats.blue.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3111, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.tophat_blue\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.tophats.blue.name"}},{"function":"set_nbt","tag":"{CustomModelData:3111, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.tophats.blue\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat/tophats/brown.json b/datapack/data/hats/loot_tables/hat/tophats/brown.json index 018e788..52c3031 100644 --- a/datapack/data/hats/loot_tables/hat/tophats/brown.json +++ b/datapack/data/hats/loot_tables/hat/tophats/brown.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.tophats.brown.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3112, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.tophat_brown\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.tophats.brown.name"}},{"function":"set_nbt","tag":"{CustomModelData:3112, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.tophats.brown\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat/tophats/cyan.json b/datapack/data/hats/loot_tables/hat/tophats/cyan.json index 9a1e0bb..d480f02 100644 --- a/datapack/data/hats/loot_tables/hat/tophats/cyan.json +++ b/datapack/data/hats/loot_tables/hat/tophats/cyan.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.tophats.cyan.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3109, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.tophat_cyan\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.tophats.cyan.name"}},{"function":"set_nbt","tag":"{CustomModelData:3109, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.tophats.cyan\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat/tophats/gray.json b/datapack/data/hats/loot_tables/hat/tophats/gray.json index da9bdc1..b333634 100644 --- a/datapack/data/hats/loot_tables/hat/tophats/gray.json +++ b/datapack/data/hats/loot_tables/hat/tophats/gray.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.tophats.gray.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3107, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.tophat_gray\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.tophats.gray.name"}},{"function":"set_nbt","tag":"{CustomModelData:3107, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.tophats.gray\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat/tophats/green.json b/datapack/data/hats/loot_tables/hat/tophats/green.json index d31122c..06b5822 100644 --- a/datapack/data/hats/loot_tables/hat/tophats/green.json +++ b/datapack/data/hats/loot_tables/hat/tophats/green.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.tophats.green.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3113, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.tophat_green\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.tophats.green.name"}},{"function":"set_nbt","tag":"{CustomModelData:3113, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.tophats.green\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat/tophats/light_blue.json b/datapack/data/hats/loot_tables/hat/tophats/light_blue.json index b447132..b688ae9 100644 --- a/datapack/data/hats/loot_tables/hat/tophats/light_blue.json +++ b/datapack/data/hats/loot_tables/hat/tophats/light_blue.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.tophats.light_blue.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3103, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.tophat_light_blue\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.tophats.light_blue.name"}},{"function":"set_nbt","tag":"{CustomModelData:3103, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.tophats.light_blue\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat/tophats/light_gray.json b/datapack/data/hats/loot_tables/hat/tophats/light_gray.json index dba7a97..def9bf0 100644 --- a/datapack/data/hats/loot_tables/hat/tophats/light_gray.json +++ b/datapack/data/hats/loot_tables/hat/tophats/light_gray.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.tophats.light_gray.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3108, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.tophat_light_gray\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.tophats.light_gray.name"}},{"function":"set_nbt","tag":"{CustomModelData:3108, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.tophats.light_gray\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat/tophats/lime.json b/datapack/data/hats/loot_tables/hat/tophats/lime.json index 1601f8f..c6ab9f5 100644 --- a/datapack/data/hats/loot_tables/hat/tophats/lime.json +++ b/datapack/data/hats/loot_tables/hat/tophats/lime.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.tophats.lime.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3105, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.tophat_lime\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.tophats.lime.name"}},{"function":"set_nbt","tag":"{CustomModelData:3105, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.tophats.lime\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat/tophats/magenta.json b/datapack/data/hats/loot_tables/hat/tophats/magenta.json index 5493168..cbe8e72 100644 --- a/datapack/data/hats/loot_tables/hat/tophats/magenta.json +++ b/datapack/data/hats/loot_tables/hat/tophats/magenta.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.tophats.magenta.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3102, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.tophat_magenta\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.tophats.magenta.name"}},{"function":"set_nbt","tag":"{CustomModelData:3102, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.tophats.magenta\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat/tophats/orange.json b/datapack/data/hats/loot_tables/hat/tophats/orange.json index 57adf1b..bf9c512 100644 --- a/datapack/data/hats/loot_tables/hat/tophats/orange.json +++ b/datapack/data/hats/loot_tables/hat/tophats/orange.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.tophats.orange.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3101, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.tophat_orange\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.tophats.orange.name"}},{"function":"set_nbt","tag":"{CustomModelData:3101, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.tophats.orange\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat/tophats/pink.json b/datapack/data/hats/loot_tables/hat/tophats/pink.json index e8764c2..bcca135 100644 --- a/datapack/data/hats/loot_tables/hat/tophats/pink.json +++ b/datapack/data/hats/loot_tables/hat/tophats/pink.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.tophats.pink.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3106, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.tophat_pink\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.tophats.pink.name"}},{"function":"set_nbt","tag":"{CustomModelData:3106, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.tophats.pink\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat/tophats/purple.json b/datapack/data/hats/loot_tables/hat/tophats/purple.json index 5ba2546..e76ab6a 100644 --- a/datapack/data/hats/loot_tables/hat/tophats/purple.json +++ b/datapack/data/hats/loot_tables/hat/tophats/purple.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.tophats.purple.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3110, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.tophat_purple\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.tophats.purple.name"}},{"function":"set_nbt","tag":"{CustomModelData:3110, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.tophats.purple\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat/tophats/rainbow.json b/datapack/data/hats/loot_tables/hat/tophats/rainbow.json index f0bd970..dbecbea 100644 --- a/datapack/data/hats/loot_tables/hat/tophats/rainbow.json +++ b/datapack/data/hats/loot_tables/hat/tophats/rainbow.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.tophats.rainbow.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3116, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.tophat_rainbow\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.tophats.rainbow.name"}},{"function":"set_nbt","tag":"{CustomModelData:3116, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.tophats.rainbow\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat/tophats/red.json b/datapack/data/hats/loot_tables/hat/tophats/red.json index c100dac..f6e968b 100644 --- a/datapack/data/hats/loot_tables/hat/tophats/red.json +++ b/datapack/data/hats/loot_tables/hat/tophats/red.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.tophats.red.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3114, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.tophat_red\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.tophats.red.name"}},{"function":"set_nbt","tag":"{CustomModelData:3114, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.tophats.red\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat/tophats/white.json b/datapack/data/hats/loot_tables/hat/tophats/white.json index bb6fea2..d457a2e 100644 --- a/datapack/data/hats/loot_tables/hat/tophats/white.json +++ b/datapack/data/hats/loot_tables/hat/tophats/white.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.tophats.white.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3100, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.tophat_white\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.tophats.white.name"}},{"function":"set_nbt","tag":"{CustomModelData:3100, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.tophats.white\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat/tophats/yellow.json b/datapack/data/hats/loot_tables/hat/tophats/yellow.json index 67924d2..428fbab 100644 --- a/datapack/data/hats/loot_tables/hat/tophats/yellow.json +++ b/datapack/data/hats/loot_tables/hat/tophats/yellow.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.tophats.yellow.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3104, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.tophat_yellow\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.tophats.yellow.name"}},{"function":"set_nbt","tag":"{CustomModelData:3104, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.tophats.yellow\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat/villager/armorer.json b/datapack/data/hats/loot_tables/hat/villager/armorer.json index 84ccba5..6244411 100644 --- a/datapack/data/hats/loot_tables/hat/villager/armorer.json +++ b/datapack/data/hats/loot_tables/hat/villager/armorer.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.villager.armorer.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3160, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.armorer_mask\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.villager.armorer.name"}},{"function":"set_nbt","tag":"{CustomModelData:3160, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.villager.armorer\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat/villager/farmer.json b/datapack/data/hats/loot_tables/hat/villager/farmer.json index 395af45..5845512 100644 --- a/datapack/data/hats/loot_tables/hat/villager/farmer.json +++ b/datapack/data/hats/loot_tables/hat/villager/farmer.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.villager.farmer.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3161, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.farmer_strawhat\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.villager.farmer.name"}},{"function":"set_nbt","tag":"{CustomModelData:3161, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.villager.farmer\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat/villager/nose.json b/datapack/data/hats/loot_tables/hat/villager/nose.json index 9e5420a..33c5c43 100644 --- a/datapack/data/hats/loot_tables/hat/villager/nose.json +++ b/datapack/data/hats/loot_tables/hat/villager/nose.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.villager.nose.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3162, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.villager_nose\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.villager.nose.name"}},{"function":"set_nbt","tag":"{CustomModelData:3162, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.villager.nose\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat_on_head/_hat_base.json b/datapack/data/hats/loot_tables/hat_on_head/_hat_base.json deleted file mode 100644 index 51a86a5..0000000 --- a/datapack/data/hats/loot_tables/hat_on_head/_hat_base.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "set_nbt", - "tag": "{Tags:[\"is_hat\", \"hats.hat\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "tag", - "name": "hats:hat_on_head", - "expand": true - } - ] - } - ] -} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat_on_head/accessories/alex_mask.json b/datapack/data/hats/loot_tables/hat_on_head/accessories/alex_mask.json index 0e25051..d190c45 100644 --- a/datapack/data/hats/loot_tables/hat_on_head/accessories/alex_mask.json +++ b/datapack/data/hats/loot_tables/hat_on_head/accessories/alex_mask.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.accessories.alex_mask.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3152, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.alex_mask\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.accessories.alex_mask.name"}},{"function":"set_nbt","tag":"{CustomModelData:3152, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.accessories.alex_mask\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat_on_head","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat_on_head/accessories/googly_eyes.json b/datapack/data/hats/loot_tables/hat_on_head/accessories/googly_eyes.json index 2f0c955..3780996 100644 --- a/datapack/data/hats/loot_tables/hat_on_head/accessories/googly_eyes.json +++ b/datapack/data/hats/loot_tables/hat_on_head/accessories/googly_eyes.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.accessories.googly_eyes.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3155, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.googly_eyes\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.accessories.googly_eyes.name"}},{"function":"set_nbt","tag":"{CustomModelData:3155, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.accessories.googly_eyes\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat_on_head","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat_on_head/accessories/ninja_headband.json b/datapack/data/hats/loot_tables/hat_on_head/accessories/ninja_headband.json index f12c145..6c0e087 100644 --- a/datapack/data/hats/loot_tables/hat_on_head/accessories/ninja_headband.json +++ b/datapack/data/hats/loot_tables/hat_on_head/accessories/ninja_headband.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.accessories.ninja_headband.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3150, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.ninja_headband\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.accessories.ninja_headband.name"}},{"function":"set_nbt","tag":"{CustomModelData:3150, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.accessories.ninja_headband\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat_on_head","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat_on_head/accessories/snorkel_mask_blue.json b/datapack/data/hats/loot_tables/hat_on_head/accessories/snorkel_mask_blue.json index 24768dd..0a5bb7e 100644 --- a/datapack/data/hats/loot_tables/hat_on_head/accessories/snorkel_mask_blue.json +++ b/datapack/data/hats/loot_tables/hat_on_head/accessories/snorkel_mask_blue.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.accessories.snorkel_mask_blue.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3153, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.snorkel_mask_blue\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.accessories.snorkel_mask_blue.name"}},{"function":"set_nbt","tag":"{CustomModelData:3153, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.accessories.snorkel_mask_blue\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat_on_head","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat_on_head/accessories/snorkel_mask_red.json b/datapack/data/hats/loot_tables/hat_on_head/accessories/snorkel_mask_red.json index 8f03ff2..5f0b0d6 100644 --- a/datapack/data/hats/loot_tables/hat_on_head/accessories/snorkel_mask_red.json +++ b/datapack/data/hats/loot_tables/hat_on_head/accessories/snorkel_mask_red.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.accessories.snorkel_mask_red.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3154, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.snorkel_mask_red\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.accessories.snorkel_mask_red.name"}},{"function":"set_nbt","tag":"{CustomModelData:3154, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.accessories.snorkel_mask_red\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat_on_head","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat_on_head/accessories/steve_mask.json b/datapack/data/hats/loot_tables/hat_on_head/accessories/steve_mask.json index 55523a8..0ac8e69 100644 --- a/datapack/data/hats/loot_tables/hat_on_head/accessories/steve_mask.json +++ b/datapack/data/hats/loot_tables/hat_on_head/accessories/steve_mask.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.accessories.steve_mask.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3151, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.steve_mask\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.accessories.steve_mask.name"}},{"function":"set_nbt","tag":"{CustomModelData:3151, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.accessories.steve_mask\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat_on_head","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat_on_head/arrow.json b/datapack/data/hats/loot_tables/hat_on_head/arrow.json index 91bd174..8cfdaa5 100644 --- a/datapack/data/hats/loot_tables/hat_on_head/arrow.json +++ b/datapack/data/hats/loot_tables/hat_on_head/arrow.json @@ -1,24 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": {"translate": "item.hats.arrow.name"} - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3002, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.arrow_prop\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.arrow.name"}},{"function":"set_nbt","tag":"{CustomModelData:3002, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.arrow\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat_on_head","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat_on_head/cats/black.json b/datapack/data/hats/loot_tables/hat_on_head/cats/black.json index b2eef3e..292011d 100644 --- a/datapack/data/hats/loot_tables/hat_on_head/cats/black.json +++ b/datapack/data/hats/loot_tables/hat_on_head/cats/black.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.cats.black.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3131, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.cat_black\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.cats.black.name"}},{"function":"set_nbt","tag":"{CustomModelData:3131, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.cats.black\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat_on_head","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat_on_head/cats/british_shorthair.json b/datapack/data/hats/loot_tables/hat_on_head/cats/british_shorthair.json index a6b981a..fddacb3 100644 --- a/datapack/data/hats/loot_tables/hat_on_head/cats/british_shorthair.json +++ b/datapack/data/hats/loot_tables/hat_on_head/cats/british_shorthair.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.cats.british_shorthair.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3125, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.cat_british_shorthair\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.cats.british_shorthair.name"}},{"function":"set_nbt","tag":"{CustomModelData:3125, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.cats.british_shorthair\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat_on_head","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat_on_head/cats/calico.json b/datapack/data/hats/loot_tables/hat_on_head/cats/calico.json index 69bb017..5b00b1f 100644 --- a/datapack/data/hats/loot_tables/hat_on_head/cats/calico.json +++ b/datapack/data/hats/loot_tables/hat_on_head/cats/calico.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.cats.calico.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3126, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.cat_calico\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.cats.calico.name"}},{"function":"set_nbt","tag":"{CustomModelData:3126, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.cats.calico\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat_on_head","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat_on_head/cats/jellie.json b/datapack/data/hats/loot_tables/hat_on_head/cats/jellie.json index 346ced8..e16df81 100644 --- a/datapack/data/hats/loot_tables/hat_on_head/cats/jellie.json +++ b/datapack/data/hats/loot_tables/hat_on_head/cats/jellie.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.cats.jellie.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3130, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.cat_jellie\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.cats.jellie.name"}},{"function":"set_nbt","tag":"{CustomModelData:3130, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.cats.jellie\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat_on_head","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat_on_head/cats/ocelot.json b/datapack/data/hats/loot_tables/hat_on_head/cats/ocelot.json index d342181..ad9ad90 100644 --- a/datapack/data/hats/loot_tables/hat_on_head/cats/ocelot.json +++ b/datapack/data/hats/loot_tables/hat_on_head/cats/ocelot.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.cats.ocelot.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3120, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.cat_ocelot\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.cats.ocelot.name"}},{"function":"set_nbt","tag":"{CustomModelData:3120, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.cats.ocelot\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat_on_head","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat_on_head/cats/persian.json b/datapack/data/hats/loot_tables/hat_on_head/cats/persian.json index 379b07e..80248d5 100644 --- a/datapack/data/hats/loot_tables/hat_on_head/cats/persian.json +++ b/datapack/data/hats/loot_tables/hat_on_head/cats/persian.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.cats.persian.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3127, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.cat_persian\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.cats.persian.name"}},{"function":"set_nbt","tag":"{CustomModelData:3127, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.cats.persian\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat_on_head","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat_on_head/cats/ragdoll.json b/datapack/data/hats/loot_tables/hat_on_head/cats/ragdoll.json index a9cb42c..2e6b1ca 100644 --- a/datapack/data/hats/loot_tables/hat_on_head/cats/ragdoll.json +++ b/datapack/data/hats/loot_tables/hat_on_head/cats/ragdoll.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.cats.ragdoll.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3128, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.cat_ragdoll\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.cats.ragdoll.name"}},{"function":"set_nbt","tag":"{CustomModelData:3128, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.cats.ragdoll\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat_on_head","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat_on_head/cats/red.json b/datapack/data/hats/loot_tables/hat_on_head/cats/red.json index aaecde6..e3cf9f8 100644 --- a/datapack/data/hats/loot_tables/hat_on_head/cats/red.json +++ b/datapack/data/hats/loot_tables/hat_on_head/cats/red.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.cats.red.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3123, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.cat_red\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.cats.red.name"}},{"function":"set_nbt","tag":"{CustomModelData:3123, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.cats.red\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat_on_head","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat_on_head/cats/siamese.json b/datapack/data/hats/loot_tables/hat_on_head/cats/siamese.json index e126433..9afcc84 100644 --- a/datapack/data/hats/loot_tables/hat_on_head/cats/siamese.json +++ b/datapack/data/hats/loot_tables/hat_on_head/cats/siamese.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.cats.siamese.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3124, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.cat_siamese\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.cats.siamese.name"}},{"function":"set_nbt","tag":"{CustomModelData:3124, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.cats.siamese\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat_on_head","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat_on_head/cats/tabby.json b/datapack/data/hats/loot_tables/hat_on_head/cats/tabby.json index ac95a71..9d76b72 100644 --- a/datapack/data/hats/loot_tables/hat_on_head/cats/tabby.json +++ b/datapack/data/hats/loot_tables/hat_on_head/cats/tabby.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.cats.tabby.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3121, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.cat_tabby\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.cats.tabby.name"}},{"function":"set_nbt","tag":"{CustomModelData:3121, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.cats.tabby\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat_on_head","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat_on_head/cats/tuxedo.json b/datapack/data/hats/loot_tables/hat_on_head/cats/tuxedo.json index 1ddfe6d..80ba4eb 100644 --- a/datapack/data/hats/loot_tables/hat_on_head/cats/tuxedo.json +++ b/datapack/data/hats/loot_tables/hat_on_head/cats/tuxedo.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.cats.tuxedo.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3122, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.cat_tuxedo\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.cats.tuxedo.name"}},{"function":"set_nbt","tag":"{CustomModelData:3122, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.cats.tuxedo\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat_on_head","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat_on_head/cats/white.json b/datapack/data/hats/loot_tables/hat_on_head/cats/white.json index b91a847..c35e87f 100644 --- a/datapack/data/hats/loot_tables/hat_on_head/cats/white.json +++ b/datapack/data/hats/loot_tables/hat_on_head/cats/white.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.cats.white.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3129, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.cat_white\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.cats.white.name"}},{"function":"set_nbt","tag":"{CustomModelData:3129, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.cats.white\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat_on_head","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat_on_head/fez.json b/datapack/data/hats/loot_tables/hat_on_head/fez.json index 52f097e..0d2a8fa 100644 --- a/datapack/data/hats/loot_tables/hat_on_head/fez.json +++ b/datapack/data/hats/loot_tables/hat_on_head/fez.json @@ -1,24 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": {"translate": "item.hats.fez.name"} - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3000, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.fez\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.fez.name"}},{"function":"set_nbt","tag":"{CustomModelData:3000, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.fez\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat_on_head","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat_on_head/frying_pan.json b/datapack/data/hats/loot_tables/hat_on_head/frying_pan.json index 8e11dc7..4421e32 100644 --- a/datapack/data/hats/loot_tables/hat_on_head/frying_pan.json +++ b/datapack/data/hats/loot_tables/hat_on_head/frying_pan.json @@ -1,24 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": {"translate": "item.hats.frying_pan.name"} - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3003, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.frying_pan\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.frying_pan.name"}},{"function":"set_nbt","tag":"{CustomModelData:3003, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.frying_pan\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat_on_head","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat_on_head/glasses/half_rim.json b/datapack/data/hats/loot_tables/hat_on_head/glasses/half_rim.json index da9881b..d327620 100644 --- a/datapack/data/hats/loot_tables/hat_on_head/glasses/half_rim.json +++ b/datapack/data/hats/loot_tables/hat_on_head/glasses/half_rim.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.glasses.half_rim.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3142, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.half_rim_glasses\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.glasses.half_rim.name"}},{"function":"set_nbt","tag":"{CustomModelData:3142, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.glasses.half_rim\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat_on_head","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat_on_head/glasses/harry_potter.json b/datapack/data/hats/loot_tables/hat_on_head/glasses/harry_potter.json index 21215fd..735215a 100644 --- a/datapack/data/hats/loot_tables/hat_on_head/glasses/harry_potter.json +++ b/datapack/data/hats/loot_tables/hat_on_head/glasses/harry_potter.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.glasses.harry_potter.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3141, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.harry_potter_glasses\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.glasses.harry_potter.name"}},{"function":"set_nbt","tag":"{CustomModelData:3141, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.glasses.harry_potter\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat_on_head","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat_on_head/glasses/librarian.json b/datapack/data/hats/loot_tables/hat_on_head/glasses/librarian.json index 5e09b17..d3ce46c 100644 --- a/datapack/data/hats/loot_tables/hat_on_head/glasses/librarian.json +++ b/datapack/data/hats/loot_tables/hat_on_head/glasses/librarian.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.glasses.librarian.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3144, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.librarian_glasses\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.glasses.librarian.name"}},{"function":"set_nbt","tag":"{CustomModelData:3144, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.glasses.librarian\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat_on_head","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat_on_head/glasses/rainbow.json b/datapack/data/hats/loot_tables/hat_on_head/glasses/rainbow.json index 3648237..0a9544f 100644 --- a/datapack/data/hats/loot_tables/hat_on_head/glasses/rainbow.json +++ b/datapack/data/hats/loot_tables/hat_on_head/glasses/rainbow.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.glasses.rainbow.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3143, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.rainbow_glasses\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.glasses.rainbow.name"}},{"function":"set_nbt","tag":"{CustomModelData:3143, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.glasses.rainbow\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat_on_head","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat_on_head/glasses/sunglasses.json b/datapack/data/hats/loot_tables/hat_on_head/glasses/sunglasses.json index 830f79e..2def5ab 100644 --- a/datapack/data/hats/loot_tables/hat_on_head/glasses/sunglasses.json +++ b/datapack/data/hats/loot_tables/hat_on_head/glasses/sunglasses.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.glasses.sunglasses.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3140, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.sunglasses\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.glasses.sunglasses.name"}},{"function":"set_nbt","tag":"{CustomModelData:3140, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.glasses.sunglasses\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat_on_head","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat_on_head/glasses/three_d.json b/datapack/data/hats/loot_tables/hat_on_head/glasses/three_d.json index ba9175c..f6673de 100644 --- a/datapack/data/hats/loot_tables/hat_on_head/glasses/three_d.json +++ b/datapack/data/hats/loot_tables/hat_on_head/glasses/three_d.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.glasses.three_d.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3145, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.three_d_glasses\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.glasses.three_d.name"}},{"function":"set_nbt","tag":"{CustomModelData:3145, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.glasses.three_d\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat_on_head","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat_on_head/halloween/jason_mask.json b/datapack/data/hats/loot_tables/hat_on_head/halloween/jason_mask.json index 82ba12f..6074519 100644 --- a/datapack/data/hats/loot_tables/hat_on_head/halloween/jason_mask.json +++ b/datapack/data/hats/loot_tables/hat_on_head/halloween/jason_mask.json @@ -1,24 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": {"translate": "item.hats.halloween.jason_mask.name"} - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:7773182, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.jason_mask\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.halloween.jason_mask.name"}},{"function":"set_nbt","tag":"{CustomModelData:7773182, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.halloween.jason_mask\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat_on_head","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat_on_head/halloween/native_american_headband.json b/datapack/data/hats/loot_tables/hat_on_head/halloween/native_american_headband.json index 9461aef..d955fa3 100644 --- a/datapack/data/hats/loot_tables/hat_on_head/halloween/native_american_headband.json +++ b/datapack/data/hats/loot_tables/hat_on_head/halloween/native_american_headband.json @@ -1,24 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": {"translate": "item.hats.halloween.native_american_headband.name"} - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:7773181, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.native_american_headband\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.halloween.native_american_headband.name"}},{"function":"set_nbt","tag":"{CustomModelData:7773181, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.halloween.native_american_headband\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat_on_head","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat_on_head/halloween/wiggly_ghast.json b/datapack/data/hats/loot_tables/hat_on_head/halloween/wiggly_ghast.json index 866cea9..58e76a0 100644 --- a/datapack/data/hats/loot_tables/hat_on_head/halloween/wiggly_ghast.json +++ b/datapack/data/hats/loot_tables/hat_on_head/halloween/wiggly_ghast.json @@ -1,24 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": {"translate": "item.hats.halloween.wiggly_ghast.name"} - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:7773180, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.wiggly_ghast\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.halloween.wiggly_ghast.name"}},{"function":"set_nbt","tag":"{CustomModelData:7773180, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.halloween.wiggly_ghast\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat_on_head","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat_on_head/mario/cappy.json b/datapack/data/hats/loot_tables/hat_on_head/mario/cappy.json index 694514f..9f8d957 100644 --- a/datapack/data/hats/loot_tables/hat_on_head/mario/cappy.json +++ b/datapack/data/hats/loot_tables/hat_on_head/mario/cappy.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.mario.cappy.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3172, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.cappy\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.mario.cappy.name"}},{"function":"set_nbt","tag":"{CustomModelData:3172, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.mario.cappy\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat_on_head","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat_on_head/mario/luigi.json b/datapack/data/hats/loot_tables/hat_on_head/mario/luigi.json index f93653b..76b3f51 100644 --- a/datapack/data/hats/loot_tables/hat_on_head/mario/luigi.json +++ b/datapack/data/hats/loot_tables/hat_on_head/mario/luigi.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.mario.luigi.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3178, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.luigi\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.mario.luigi.name"}},{"function":"set_nbt","tag":"{CustomModelData:3178, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.mario.luigi\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat_on_head","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat_on_head/mario/luigi_cap.json b/datapack/data/hats/loot_tables/hat_on_head/mario/luigi_cap.json index e448fb4..ce983d9 100644 --- a/datapack/data/hats/loot_tables/hat_on_head/mario/luigi_cap.json +++ b/datapack/data/hats/loot_tables/hat_on_head/mario/luigi_cap.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.mario.luigi_cap.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3171, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.luigi_cap\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.mario.luigi_cap.name"}},{"function":"set_nbt","tag":"{CustomModelData:3171, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.mario.luigi_cap\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat_on_head","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat_on_head/mario/mario.json b/datapack/data/hats/loot_tables/hat_on_head/mario/mario.json index c63393a..73aac71 100644 --- a/datapack/data/hats/loot_tables/hat_on_head/mario/mario.json +++ b/datapack/data/hats/loot_tables/hat_on_head/mario/mario.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.mario.mario.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3177, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.mario\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.mario.mario.name"}},{"function":"set_nbt","tag":"{CustomModelData:3177, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.mario.mario\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat_on_head","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat_on_head/mario/mario_cap.json b/datapack/data/hats/loot_tables/hat_on_head/mario/mario_cap.json index 51e618c..abe1d5b 100644 --- a/datapack/data/hats/loot_tables/hat_on_head/mario/mario_cap.json +++ b/datapack/data/hats/loot_tables/hat_on_head/mario/mario_cap.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.mario.mario_cap.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3170, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.mario_cap\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.mario.mario_cap.name"}},{"function":"set_nbt","tag":"{CustomModelData:3170, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.mario.mario_cap\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat_on_head","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat_on_head/mario/toad_blue.json b/datapack/data/hats/loot_tables/hat_on_head/mario/toad_blue.json index 99fbd02..5f799d0 100644 --- a/datapack/data/hats/loot_tables/hat_on_head/mario/toad_blue.json +++ b/datapack/data/hats/loot_tables/hat_on_head/mario/toad_blue.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.mario.toad_blue.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3174, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.toad_blue\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.mario.toad_blue.name"}},{"function":"set_nbt","tag":"{CustomModelData:3174, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.mario.toad_blue\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat_on_head","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat_on_head/mario/toad_green.json b/datapack/data/hats/loot_tables/hat_on_head/mario/toad_green.json index 388db12..9bdcd9f 100644 --- a/datapack/data/hats/loot_tables/hat_on_head/mario/toad_green.json +++ b/datapack/data/hats/loot_tables/hat_on_head/mario/toad_green.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.mario.toad_green.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3176, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.toad_green\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.mario.toad_green.name"}},{"function":"set_nbt","tag":"{CustomModelData:3176, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.mario.toad_green\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat_on_head","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat_on_head/mario/toad_red.json b/datapack/data/hats/loot_tables/hat_on_head/mario/toad_red.json index e54f414..4cd9776 100644 --- a/datapack/data/hats/loot_tables/hat_on_head/mario/toad_red.json +++ b/datapack/data/hats/loot_tables/hat_on_head/mario/toad_red.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.mario.toad_red.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3173, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.toad_red\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.mario.toad_red.name"}},{"function":"set_nbt","tag":"{CustomModelData:3173, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.mario.toad_red\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat_on_head","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat_on_head/mario/toad_yellow.json b/datapack/data/hats/loot_tables/hat_on_head/mario/toad_yellow.json index e269533..72987a5 100644 --- a/datapack/data/hats/loot_tables/hat_on_head/mario/toad_yellow.json +++ b/datapack/data/hats/loot_tables/hat_on_head/mario/toad_yellow.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.mario.toad_yellow.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3175, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.toad_yellow\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.mario.toad_yellow.name"}},{"function":"set_nbt","tag":"{CustomModelData:3175, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.mario.toad_yellow\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat_on_head","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat_on_head/squid.json b/datapack/data/hats/loot_tables/hat_on_head/squid.json index 40f3951..f5d6d1f 100644 --- a/datapack/data/hats/loot_tables/hat_on_head/squid.json +++ b/datapack/data/hats/loot_tables/hat_on_head/squid.json @@ -1,24 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": {"translate": "item.hats.squid.name"} - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3001, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.squid\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.squid.name"}},{"function":"set_nbt","tag":"{CustomModelData:3001, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.squid\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat_on_head","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat_on_head/tophats/black.json b/datapack/data/hats/loot_tables/hat_on_head/tophats/black.json index 7798eb4..bf06009 100644 --- a/datapack/data/hats/loot_tables/hat_on_head/tophats/black.json +++ b/datapack/data/hats/loot_tables/hat_on_head/tophats/black.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.tophats.black.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3115, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.tophat_black\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.tophats.black.name"}},{"function":"set_nbt","tag":"{CustomModelData:3115, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.tophats.black\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat_on_head","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat_on_head/tophats/black_monocle.json b/datapack/data/hats/loot_tables/hat_on_head/tophats/black_monocle.json index cddbe7d..daa0277 100644 --- a/datapack/data/hats/loot_tables/hat_on_head/tophats/black_monocle.json +++ b/datapack/data/hats/loot_tables/hat_on_head/tophats/black_monocle.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.tophats.black_monocle.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3117, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.tophat_black_monocle\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.tophats.black_monocle.name"}},{"function":"set_nbt","tag":"{CustomModelData:3117, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.tophats.black_monocle\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat_on_head","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat_on_head/tophats/blue.json b/datapack/data/hats/loot_tables/hat_on_head/tophats/blue.json index ca9b494..f0fb123 100644 --- a/datapack/data/hats/loot_tables/hat_on_head/tophats/blue.json +++ b/datapack/data/hats/loot_tables/hat_on_head/tophats/blue.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.tophats.blue.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3111, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.tophat_blue\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.tophats.blue.name"}},{"function":"set_nbt","tag":"{CustomModelData:3111, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.tophats.blue\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat_on_head","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat_on_head/tophats/brown.json b/datapack/data/hats/loot_tables/hat_on_head/tophats/brown.json index 9f1c5ac..efa81d6 100644 --- a/datapack/data/hats/loot_tables/hat_on_head/tophats/brown.json +++ b/datapack/data/hats/loot_tables/hat_on_head/tophats/brown.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.tophats.brown.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3112, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.tophat_brown\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.tophats.brown.name"}},{"function":"set_nbt","tag":"{CustomModelData:3112, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.tophats.brown\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat_on_head","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat_on_head/tophats/cyan.json b/datapack/data/hats/loot_tables/hat_on_head/tophats/cyan.json index 2756290..a92b3ce 100644 --- a/datapack/data/hats/loot_tables/hat_on_head/tophats/cyan.json +++ b/datapack/data/hats/loot_tables/hat_on_head/tophats/cyan.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.tophats.cyan.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3109, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.tophat_cyan\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.tophats.cyan.name"}},{"function":"set_nbt","tag":"{CustomModelData:3109, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.tophats.cyan\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat_on_head","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat_on_head/tophats/gray.json b/datapack/data/hats/loot_tables/hat_on_head/tophats/gray.json index 22d57e4..275e88d 100644 --- a/datapack/data/hats/loot_tables/hat_on_head/tophats/gray.json +++ b/datapack/data/hats/loot_tables/hat_on_head/tophats/gray.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.tophats.gray.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3107, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.tophat_gray\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.tophats.gray.name"}},{"function":"set_nbt","tag":"{CustomModelData:3107, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.tophats.gray\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat_on_head","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat_on_head/tophats/green.json b/datapack/data/hats/loot_tables/hat_on_head/tophats/green.json index a0aff3d..b034ac1 100644 --- a/datapack/data/hats/loot_tables/hat_on_head/tophats/green.json +++ b/datapack/data/hats/loot_tables/hat_on_head/tophats/green.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.tophats.green.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3113, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.tophat_green\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.tophats.green.name"}},{"function":"set_nbt","tag":"{CustomModelData:3113, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.tophats.green\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat_on_head","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat_on_head/tophats/light_blue.json b/datapack/data/hats/loot_tables/hat_on_head/tophats/light_blue.json index 83572b6..a65b911 100644 --- a/datapack/data/hats/loot_tables/hat_on_head/tophats/light_blue.json +++ b/datapack/data/hats/loot_tables/hat_on_head/tophats/light_blue.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.tophats.light_blue.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3103, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.tophat_light_blue\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.tophats.light_blue.name"}},{"function":"set_nbt","tag":"{CustomModelData:3103, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.tophats.light_blue\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat_on_head","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat_on_head/tophats/light_gray.json b/datapack/data/hats/loot_tables/hat_on_head/tophats/light_gray.json index 73650b9..9ead2e3 100644 --- a/datapack/data/hats/loot_tables/hat_on_head/tophats/light_gray.json +++ b/datapack/data/hats/loot_tables/hat_on_head/tophats/light_gray.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.tophats.light_gray.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3108, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.tophat_light_gray\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.tophats.light_gray.name"}},{"function":"set_nbt","tag":"{CustomModelData:3108, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.tophats.light_gray\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat_on_head","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat_on_head/tophats/lime.json b/datapack/data/hats/loot_tables/hat_on_head/tophats/lime.json index 2dc1b8c..5237b27 100644 --- a/datapack/data/hats/loot_tables/hat_on_head/tophats/lime.json +++ b/datapack/data/hats/loot_tables/hat_on_head/tophats/lime.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.tophats.lime.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3105, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.tophat_lime\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.tophats.lime.name"}},{"function":"set_nbt","tag":"{CustomModelData:3105, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.tophats.lime\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat_on_head","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat_on_head/tophats/magenta.json b/datapack/data/hats/loot_tables/hat_on_head/tophats/magenta.json index 400d4f5..7ab46a3 100644 --- a/datapack/data/hats/loot_tables/hat_on_head/tophats/magenta.json +++ b/datapack/data/hats/loot_tables/hat_on_head/tophats/magenta.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.tophats.magenta.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3102, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.tophat_magenta\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.tophats.magenta.name"}},{"function":"set_nbt","tag":"{CustomModelData:3102, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.tophats.magenta\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat_on_head","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat_on_head/tophats/orange.json b/datapack/data/hats/loot_tables/hat_on_head/tophats/orange.json index d57dd1d..08ff5f9 100644 --- a/datapack/data/hats/loot_tables/hat_on_head/tophats/orange.json +++ b/datapack/data/hats/loot_tables/hat_on_head/tophats/orange.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.tophats.orange.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3101, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.tophat_orange\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.tophats.orange.name"}},{"function":"set_nbt","tag":"{CustomModelData:3101, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.tophats.orange\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat_on_head","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat_on_head/tophats/pink.json b/datapack/data/hats/loot_tables/hat_on_head/tophats/pink.json index 660047a..fc25104 100644 --- a/datapack/data/hats/loot_tables/hat_on_head/tophats/pink.json +++ b/datapack/data/hats/loot_tables/hat_on_head/tophats/pink.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.tophats.pink.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3106, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.tophat_pink\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.tophats.pink.name"}},{"function":"set_nbt","tag":"{CustomModelData:3106, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.tophats.pink\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat_on_head","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat_on_head/tophats/purple.json b/datapack/data/hats/loot_tables/hat_on_head/tophats/purple.json index 93ded79..a3a90f3 100644 --- a/datapack/data/hats/loot_tables/hat_on_head/tophats/purple.json +++ b/datapack/data/hats/loot_tables/hat_on_head/tophats/purple.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.tophats.purple.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3110, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.tophat_purple\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.tophats.purple.name"}},{"function":"set_nbt","tag":"{CustomModelData:3110, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.tophats.purple\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat_on_head","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat_on_head/tophats/rainbow.json b/datapack/data/hats/loot_tables/hat_on_head/tophats/rainbow.json index 61aff90..39b5ac6 100644 --- a/datapack/data/hats/loot_tables/hat_on_head/tophats/rainbow.json +++ b/datapack/data/hats/loot_tables/hat_on_head/tophats/rainbow.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.tophats.rainbow.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3116, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.tophat_rainbow\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.tophats.rainbow.name"}},{"function":"set_nbt","tag":"{CustomModelData:3116, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.tophats.rainbow\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat_on_head","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat_on_head/tophats/red.json b/datapack/data/hats/loot_tables/hat_on_head/tophats/red.json index 94d16d9..1e145d6 100644 --- a/datapack/data/hats/loot_tables/hat_on_head/tophats/red.json +++ b/datapack/data/hats/loot_tables/hat_on_head/tophats/red.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.tophats.red.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3114, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.tophat_red\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.tophats.red.name"}},{"function":"set_nbt","tag":"{CustomModelData:3114, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.tophats.red\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat_on_head","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat_on_head/tophats/white.json b/datapack/data/hats/loot_tables/hat_on_head/tophats/white.json index 3a4316a..e955881 100644 --- a/datapack/data/hats/loot_tables/hat_on_head/tophats/white.json +++ b/datapack/data/hats/loot_tables/hat_on_head/tophats/white.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.tophats.white.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3100, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.tophat_white\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.tophats.white.name"}},{"function":"set_nbt","tag":"{CustomModelData:3100, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.tophats.white\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat_on_head","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat_on_head/tophats/yellow.json b/datapack/data/hats/loot_tables/hat_on_head/tophats/yellow.json index 513e47d..6c691c8 100644 --- a/datapack/data/hats/loot_tables/hat_on_head/tophats/yellow.json +++ b/datapack/data/hats/loot_tables/hat_on_head/tophats/yellow.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.tophats.yellow.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3104, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.tophat_yellow\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.tophats.yellow.name"}},{"function":"set_nbt","tag":"{CustomModelData:3104, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.tophats.yellow\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat_on_head","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat_on_head/villager/armorer.json b/datapack/data/hats/loot_tables/hat_on_head/villager/armorer.json index dce3a04..b51b2f8 100644 --- a/datapack/data/hats/loot_tables/hat_on_head/villager/armorer.json +++ b/datapack/data/hats/loot_tables/hat_on_head/villager/armorer.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.villager.armorer.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3160, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.armorer_mask\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.villager.armorer.name"}},{"function":"set_nbt","tag":"{CustomModelData:3160, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.villager.armorer\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat_on_head","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat_on_head/villager/farmer.json b/datapack/data/hats/loot_tables/hat_on_head/villager/farmer.json index a2c45cd..b170d66 100644 --- a/datapack/data/hats/loot_tables/hat_on_head/villager/farmer.json +++ b/datapack/data/hats/loot_tables/hat_on_head/villager/farmer.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.villager.farmer.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3161, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.farmer_strawhat\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.villager.farmer.name"}},{"function":"set_nbt","tag":"{CustomModelData:3161, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.villager.farmer\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat_on_head","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat_on_head/villager/nose.json b/datapack/data/hats/loot_tables/hat_on_head/villager/nose.json index bd46add..278143b 100644 --- a/datapack/data/hats/loot_tables/hat_on_head/villager/nose.json +++ b/datapack/data/hats/loot_tables/hat_on_head/villager/nose.json @@ -1,26 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": "item.hats.villager.nose.name" - } - }, - { - "function": "set_nbt", - "tag": "{CustomModelData:3162, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.villager_nose\"]}" - } - ], - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/_hat_base" - } - ] - } - ] -} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.villager.nose.name"}},{"function":"set_nbt","tag":"{CustomModelData:3162, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.villager.nose\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat_on_head","expand":true}]}]} \ No newline at end of file From 9aeab66c3facb89a0440ef8459b1f4a9fb494187 Mon Sep 17 00:00:00 2001 From: OraneUtan Date: Tue, 19 May 2020 17:49:33 +0200 Subject: [PATCH 09/58] Removed unnecessary build scripts --- build/minecraft/loot_table.py | 67 ----------------------------------- build/minecraft/utils.py | 16 --------- build/utils.py | 19 ---------- 3 files changed, 102 deletions(-) delete mode 100644 build/minecraft/loot_table.py delete mode 100644 build/minecraft/utils.py delete mode 100644 build/utils.py diff --git a/build/minecraft/loot_table.py b/build/minecraft/loot_table.py deleted file mode 100644 index 29500dd..0000000 --- a/build/minecraft/loot_table.py +++ /dev/null @@ -1,67 +0,0 @@ -import json - -class TableType: - EMPTY = "minecraft:empty" - ENTITY = "minecraft:entity" - BLOCK = "minecraft:block" - CHEST = "minecraft:chest" - FISHING = "minecraft:fishing" - ADVANCEMENT_REWARD = "minecraft:advancement_reward" - GENERIC = "minecraft:generic" - -class EntryType: - ITEM = "minecraft:item" - TAG = "minecraft:tag" - LOOT_TABLE = "minecraft:loot_table" - GROUP = "minecraft:group" - ALTERNATIVES = "minecraft:alternatives" - SEQUENCE = "minecraft:sequence" - DYNAMIC = "minecraft:dynamic" - EMPTY = "minecraft:empty" - -def loot_table(type=None, pools=None): - loot_table = json.loads("{}") - if type: - loot_table['type'] = type - if pools: - loot_table['pools'] = pools - return loot_table - -def entry(entry=None, conditions=None, type=None, name=None, children=None, expand=None, functions=None, weight=None, quality=None): - if not entry: - entry = json.loads("{}") - if conditions: - entry['conditions'] = conditions - if type: - entry['type'] = type - if name: - entry['name'] = name - if children: - entry['children'] = children - if expand: - entry['expand'] = expand - if functions: - entry['functions'] = functions - if weight: - entry['weight'] = weight - if quality: - entry['quality'] = quality - return entry - -def pool(conditions=None, rolls=None, bonus_rolls=None, entries=None): - pool = json.loads("{}") - if conditions: - pool['conditions'] = conditions - if rolls: - pool['rolls'] = rolls - if bonus_rolls: - pool['bonus_rolls'] = bonus_rolls - if entries: - pool['entries'] = entries - return pool - -def generate_all_entries(entries): - return list(map((lambda e: pool(entries=[e], rolls=1)), entries)) - -def generate_random_entry(entries): - return [pool(rolls=1, entries=entries)] \ No newline at end of file diff --git a/build/minecraft/utils.py b/build/minecraft/utils.py deleted file mode 100644 index e1d5434..0000000 --- a/build/minecraft/utils.py +++ /dev/null @@ -1,16 +0,0 @@ -import os, json, re, itertools -from functools import reduce - -def get_mc_name(path, basedir): - segments = os.path.normpath(path).split(os.path.sep) - for segment in segments: - segments = segments[1:] - if segment == basedir: - break - return os.path.splitext(reduce((lambda a,b: a+'/'+b), segments))[0] - -def get_ingame_path(path, pack_name): - """ Get ingame path of resource """ - path_segments = os.path.splitext(os.path.normpath(path))[0].split(os.path.sep) - ingame_path_segments = path_segments[path_segments.index(pack_name):] - return ingame_path_segments[0] + ':' + reduce((lambda a,b: a + '/' + b), ingame_path_segments[2:]) \ No newline at end of file diff --git a/build/utils.py b/build/utils.py deleted file mode 100644 index db3796f..0000000 --- a/build/utils.py +++ /dev/null @@ -1,19 +0,0 @@ -import os, re - -def get_files_in(path, re_filename=None, extension=None): - """Returns and filters files contained in a folder recursively""" - listOfFiles = list() - for (dirpath, dirnames, filenames) in os.walk(path): - for filename in filenames: - if re_filename and not re.match(re_filename, filename): - continue - listOfFiles.append(os.path.join(dirpath, filename)) - - if extension: - listOfFiles = [file for file in listOfFiles if os.path.splitext(file)[1] == extension] - - return listOfFiles - -def filename_from_path(path): - """ Extracts the filename without the extension from a path """ - return os.path.splitext(os.path.basename(path))[0] \ No newline at end of file From 6801d51432e8221a3fbaf30e5b0d08f94be9640a Mon Sep 17 00:00:00 2001 From: OraneUtan Date: Tue, 19 May 2020 23:50:52 +0200 Subject: [PATCH 10/58] Added method "categories" to the Registry --- build/registry.py | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/build/registry.py b/build/registry.py index a79be61..7e4a191 100644 --- a/build/registry.py +++ b/build/registry.py @@ -7,19 +7,28 @@ def __init__(self): def all_hats(self): for category_name, category_hats in map(lambda category: list(category.items())[0], self.registry['categories']): - for hat_name, hat_data in map(lambda category_entry: list(category_entry.items())[0], category_hats): - custom_model_data = hat_data['custom_model_data'] - - if category_name == "*": - # Category "*" contains all uncategorized hats -> don't add a category to any paths - model = f"item/hats/{hat_name}" - type = f"hats.hat.type.{hat_name}" - translation = f"item.hats.{hat_name}" - else: - model = f"item/hats/{category_name}/{hat_name}" - type = f"hats.hat.type.{category_name}.{hat_name}" - translation = f"item.hats.{category_name}.{hat_name}" - yield Hat(hat_name, category_name, custom_model_data, model, type, translation) + for hat in self._parse_hats(category_name, category_hats): + yield hat + + def categories(self): + for category_name, category_hats in map(lambda category: list(category.items())[0], self.registry['categories']): + hats = list(self._parse_hats(category_name, category_hats)) + yield (category_name, hats) + + def _parse_hats(self, category_name, json_hats): + for hat_name, hat_data in map(lambda category_entry: list(category_entry.items())[0], json_hats): + custom_model_data = hat_data['custom_model_data'] + + if category_name == "*": + # Category "*" contains all uncategorized hats -> don't add a category to any paths + model = f"item/hats/{hat_name}" + type = f"hats.hat.type.{hat_name}" + translation = f"item.hats.{hat_name}" + else: + model = f"item/hats/{category_name}/{hat_name}" + type = f"hats.hat.type.{category_name}.{hat_name}" + translation = f"item.hats.{category_name}.{hat_name}" + yield Hat(hat_name, category_name, custom_model_data, model, type, translation) @dataclass class Hat: From 2583e2a5ff6086ec5937c283dcaa64b8cbda8876 Mon Sep 17 00:00:00 2001 From: OraneUtan Date: Tue, 19 May 2020 23:52:01 +0200 Subject: [PATCH 11/58] Added build script that generates the "_all" and "_rand" loot tables" --- build/generate_special_hat_loot_tables.py | 74 ++++++++ .../loot_tables/hat/accessories/_all.json | 60 +------ .../loot_tables/hat/accessories/_rand.json | 35 +--- .../data/hats/loot_tables/hat/cats/_all.json | 114 +----------- .../data/hats/loot_tables/hat/cats/_rand.json | 59 +----- .../hats/loot_tables/hat/glasses/_all.json | 60 +------ .../hats/loot_tables/hat/glasses/_rand.json | 35 +--- .../hats/loot_tables/hat/halloween/_all.json | 1 + .../hats/loot_tables/hat/halloween/_rand.json | 1 + .../data/hats/loot_tables/hat/mario/_all.json | 87 +-------- .../hats/loot_tables/hat/mario/_rand.json | 47 +---- .../hats/loot_tables/hat/tophats/_all.json | 168 +----------------- .../hats/loot_tables/hat/tophats/_rand.json | 83 +-------- .../hats/loot_tables/hat/villager/_all.json | 33 +--- .../hats/loot_tables/hat/villager/_rand.json | 23 +-- 15 files changed, 88 insertions(+), 792 deletions(-) create mode 100644 build/generate_special_hat_loot_tables.py create mode 100644 datapack/data/hats/loot_tables/hat/halloween/_all.json create mode 100644 datapack/data/hats/loot_tables/hat/halloween/_rand.json diff --git a/build/generate_special_hat_loot_tables.py b/build/generate_special_hat_loot_tables.py new file mode 100644 index 0000000..bee5f62 --- /dev/null +++ b/build/generate_special_hat_loot_tables.py @@ -0,0 +1,74 @@ +import os, json +from registry import Registry, Hat + +def generate_loot_table_all_for_category(category_name, category_hats): + pools = [] + for hat in category_hats: + if hat.category == "*": + rel_path = f"{hat.name}" + else: + rel_path = f"{hat.category}/{hat.name}" + + hat_pool = { + "rolls": 1, + "entries": [ + { + "type": "minecraft:loot_table", + "name": f"hats:hat/{rel_path}" + } + ] + } + pools.append(hat_pool) + + loot_table_all = { + "type": "minecraft:generic", + "pools": pools + } + + loot_table_all_path = f"datapack/data/hats/loot_tables/hat/{category_name}/_all.json" + parent_dir = os.path.split(loot_table_all_path)[0] + if not os.path.exists(parent_dir): + os.makedirs(parent_dir) + + with open(loot_table_all_path, "w+") as file: + json.dump(loot_table_all, file) + +def generate_loot_table_rand_for_category(category_name, category_hats): + entries = [] + for hat in category_hats: + if hat.category == "*": + rel_path = f"{hat.name}" + else: + rel_path = f"{hat.category}/{hat.name}" + + hat_entry = { + "type": "minecraft:loot_table", + "name": f"hats:hat/{rel_path}" + } + + entries.append(hat_entry) + + loot_table_rand = { + "type": "minecraft:generic", + "pools": [ + { + "rolls": 1, + "entries": entries + } + ] + } + + loot_table_rand_path = f"datapack/data/hats/loot_tables/hat/{category_name}/_rand.json" + parent_dir = os.path.split(loot_table_rand_path)[0] + if not os.path.exists(parent_dir): + os.makedirs(parent_dir) + + with open(loot_table_rand_path, "w+") as file: + json.dump(loot_table_rand, file) + +registry = Registry() + +for category_name, category_hats in registry.categories(): + if category_name != "*": + generate_loot_table_all_for_category(category_name, category_hats) + generate_loot_table_rand_for_category(category_name, category_hats) \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat/accessories/_all.json b/datapack/data/hats/loot_tables/hat/accessories/_all.json index 6968213..50cab90 100644 --- a/datapack/data/hats/loot_tables/hat/accessories/_all.json +++ b/datapack/data/hats/loot_tables/hat/accessories/_all.json @@ -1,59 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/accessories/alex_mask" - } - ] - }, - { - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/accessories/googly_eyes" - } - ] - }, - { - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/accessories/ninja_headband" - } - ] - }, - { - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/accessories/snorkel_mask_blue" - } - ] - }, - { - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/accessories/snorkel_mask_red" - } - ] - }, - { - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/accessories/steve_mask" - } - ] - } - ] -} \ No newline at end of file +{"type": "minecraft:generic", "pools": [{"rolls": 1, "entries": [{"type": "minecraft:loot_table", "name": "hats:hat/accessories/ninja_headband"}]}, {"rolls": 1, "entries": [{"type": "minecraft:loot_table", "name": "hats:hat/accessories/steve_mask"}]}, {"rolls": 1, "entries": [{"type": "minecraft:loot_table", "name": "hats:hat/accessories/alex_mask"}]}, {"rolls": 1, "entries": [{"type": "minecraft:loot_table", "name": "hats:hat/accessories/snorkel_mask_blue"}]}, {"rolls": 1, "entries": [{"type": "minecraft:loot_table", "name": "hats:hat/accessories/snorkel_mask_red"}]}, {"rolls": 1, "entries": [{"type": "minecraft:loot_table", "name": "hats:hat/accessories/googly_eyes"}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat/accessories/_rand.json b/datapack/data/hats/loot_tables/hat/accessories/_rand.json index bb24a9a..409d5c7 100644 --- a/datapack/data/hats/loot_tables/hat/accessories/_rand.json +++ b/datapack/data/hats/loot_tables/hat/accessories/_rand.json @@ -1,34 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/accessories/alex_mask" - }, - { - "type": "minecraft:loot_table", - "name": "hats:hat/accessories/googly_eyes" - }, - { - "type": "minecraft:loot_table", - "name": "hats:hat/accessories/ninja_headband" - }, - { - "type": "minecraft:loot_table", - "name": "hats:hat/accessories/snorkel_mask_blue" - }, - { - "type": "minecraft:loot_table", - "name": "hats:hat/accessories/snorkel_mask_red" - }, - { - "type": "minecraft:loot_table", - "name": "hats:hat/accessories/steve_mask" - } - ] - } - ] -} \ No newline at end of file +{"type": "minecraft:generic", "pools": [{"rolls": 1, "entries": [{"type": "minecraft:loot_table", "name": "hats:hat/accessories/ninja_headband"}, {"type": "minecraft:loot_table", "name": "hats:hat/accessories/steve_mask"}, {"type": "minecraft:loot_table", "name": "hats:hat/accessories/alex_mask"}, {"type": "minecraft:loot_table", "name": "hats:hat/accessories/snorkel_mask_blue"}, {"type": "minecraft:loot_table", "name": "hats:hat/accessories/snorkel_mask_red"}, {"type": "minecraft:loot_table", "name": "hats:hat/accessories/googly_eyes"}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat/cats/_all.json b/datapack/data/hats/loot_tables/hat/cats/_all.json index c2f3f66..1db67c3 100644 --- a/datapack/data/hats/loot_tables/hat/cats/_all.json +++ b/datapack/data/hats/loot_tables/hat/cats/_all.json @@ -1,113 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/cats/black" - } - ] - }, - { - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/cats/british_shorthair" - } - ] - }, - { - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/cats/calico" - } - ] - }, - { - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/cats/jellie" - } - ] - }, - { - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/cats/ocelot" - } - ] - }, - { - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/cats/persian" - } - ] - }, - { - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/cats/ragdoll" - } - ] - }, - { - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/cats/red" - } - ] - }, - { - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/cats/siamese" - } - ] - }, - { - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/cats/tabby" - } - ] - }, - { - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/cats/tuxedo" - } - ] - }, - { - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/cats/white" - } - ] - } - ] -} \ No newline at end of file +{"type": "minecraft:generic", "pools": [{"rolls": 1, "entries": [{"type": "minecraft:loot_table", "name": "hats:hat/cats/ocelot"}]}, {"rolls": 1, "entries": [{"type": "minecraft:loot_table", "name": "hats:hat/cats/tabby"}]}, {"rolls": 1, "entries": [{"type": "minecraft:loot_table", "name": "hats:hat/cats/tuxedo"}]}, {"rolls": 1, "entries": [{"type": "minecraft:loot_table", "name": "hats:hat/cats/red"}]}, {"rolls": 1, "entries": [{"type": "minecraft:loot_table", "name": "hats:hat/cats/siamese"}]}, {"rolls": 1, "entries": [{"type": "minecraft:loot_table", "name": "hats:hat/cats/british_shorthair"}]}, {"rolls": 1, "entries": [{"type": "minecraft:loot_table", "name": "hats:hat/cats/calico"}]}, {"rolls": 1, "entries": [{"type": "minecraft:loot_table", "name": "hats:hat/cats/persian"}]}, {"rolls": 1, "entries": [{"type": "minecraft:loot_table", "name": "hats:hat/cats/ragdoll"}]}, {"rolls": 1, "entries": [{"type": "minecraft:loot_table", "name": "hats:hat/cats/white"}]}, {"rolls": 1, "entries": [{"type": "minecraft:loot_table", "name": "hats:hat/cats/jellie"}]}, {"rolls": 1, "entries": [{"type": "minecraft:loot_table", "name": "hats:hat/cats/black"}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat/cats/_rand.json b/datapack/data/hats/loot_tables/hat/cats/_rand.json index 9a0f34f..aaeadb7 100644 --- a/datapack/data/hats/loot_tables/hat/cats/_rand.json +++ b/datapack/data/hats/loot_tables/hat/cats/_rand.json @@ -1,58 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/cats/black" - }, - { - "type": "minecraft:loot_table", - "name": "hats:hat/cats/british_shorthair" - }, - { - "type": "minecraft:loot_table", - "name": "hats:hat/cats/calico" - }, - { - "type": "minecraft:loot_table", - "name": "hats:hat/cats/jellie" - }, - { - "type": "minecraft:loot_table", - "name": "hats:hat/cats/ocelot" - }, - { - "type": "minecraft:loot_table", - "name": "hats:hat/cats/persian" - }, - { - "type": "minecraft:loot_table", - "name": "hats:hat/cats/ragdoll" - }, - { - "type": "minecraft:loot_table", - "name": "hats:hat/cats/red" - }, - { - "type": "minecraft:loot_table", - "name": "hats:hat/cats/siamese" - }, - { - "type": "minecraft:loot_table", - "name": "hats:hat/cats/tabby" - }, - { - "type": "minecraft:loot_table", - "name": "hats:hat/cats/tuxedo" - }, - { - "type": "minecraft:loot_table", - "name": "hats:hat/cats/white" - } - ] - } - ] -} \ No newline at end of file +{"type": "minecraft:generic", "pools": [{"rolls": 1, "entries": [{"type": "minecraft:loot_table", "name": "hats:hat/cats/ocelot"}, {"type": "minecraft:loot_table", "name": "hats:hat/cats/tabby"}, {"type": "minecraft:loot_table", "name": "hats:hat/cats/tuxedo"}, {"type": "minecraft:loot_table", "name": "hats:hat/cats/red"}, {"type": "minecraft:loot_table", "name": "hats:hat/cats/siamese"}, {"type": "minecraft:loot_table", "name": "hats:hat/cats/british_shorthair"}, {"type": "minecraft:loot_table", "name": "hats:hat/cats/calico"}, {"type": "minecraft:loot_table", "name": "hats:hat/cats/persian"}, {"type": "minecraft:loot_table", "name": "hats:hat/cats/ragdoll"}, {"type": "minecraft:loot_table", "name": "hats:hat/cats/white"}, {"type": "minecraft:loot_table", "name": "hats:hat/cats/jellie"}, {"type": "minecraft:loot_table", "name": "hats:hat/cats/black"}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat/glasses/_all.json b/datapack/data/hats/loot_tables/hat/glasses/_all.json index 432ccf1..e32e0d8 100644 --- a/datapack/data/hats/loot_tables/hat/glasses/_all.json +++ b/datapack/data/hats/loot_tables/hat/glasses/_all.json @@ -1,59 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/glasses/half_rim" - } - ] - }, - { - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/glasses/harry_potter" - } - ] - }, - { - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/glasses/librarian" - } - ] - }, - { - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/glasses/rainbow" - } - ] - }, - { - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/glasses/sunglasses" - } - ] - }, - { - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/glasses/three_d" - } - ] - } - ] -} \ No newline at end of file +{"type": "minecraft:generic", "pools": [{"rolls": 1, "entries": [{"type": "minecraft:loot_table", "name": "hats:hat/glasses/sunglasses"}]}, {"rolls": 1, "entries": [{"type": "minecraft:loot_table", "name": "hats:hat/glasses/harry_potter"}]}, {"rolls": 1, "entries": [{"type": "minecraft:loot_table", "name": "hats:hat/glasses/half_rim"}]}, {"rolls": 1, "entries": [{"type": "minecraft:loot_table", "name": "hats:hat/glasses/rainbow"}]}, {"rolls": 1, "entries": [{"type": "minecraft:loot_table", "name": "hats:hat/glasses/librarian"}]}, {"rolls": 1, "entries": [{"type": "minecraft:loot_table", "name": "hats:hat/glasses/three_d"}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat/glasses/_rand.json b/datapack/data/hats/loot_tables/hat/glasses/_rand.json index c112d50..f57d746 100644 --- a/datapack/data/hats/loot_tables/hat/glasses/_rand.json +++ b/datapack/data/hats/loot_tables/hat/glasses/_rand.json @@ -1,34 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/glasses/half_rim" - }, - { - "type": "minecraft:loot_table", - "name": "hats:hat/glasses/harry_potter" - }, - { - "type": "minecraft:loot_table", - "name": "hats:hat/glasses/librarian" - }, - { - "type": "minecraft:loot_table", - "name": "hats:hat/glasses/rainbow" - }, - { - "type": "minecraft:loot_table", - "name": "hats:hat/glasses/sunglasses" - }, - { - "type": "minecraft:loot_table", - "name": "hats:hat/glasses/three_d" - } - ] - } - ] -} \ No newline at end of file +{"type": "minecraft:generic", "pools": [{"rolls": 1, "entries": [{"type": "minecraft:loot_table", "name": "hats:hat/glasses/sunglasses"}, {"type": "minecraft:loot_table", "name": "hats:hat/glasses/harry_potter"}, {"type": "minecraft:loot_table", "name": "hats:hat/glasses/half_rim"}, {"type": "minecraft:loot_table", "name": "hats:hat/glasses/rainbow"}, {"type": "minecraft:loot_table", "name": "hats:hat/glasses/librarian"}, {"type": "minecraft:loot_table", "name": "hats:hat/glasses/three_d"}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat/halloween/_all.json b/datapack/data/hats/loot_tables/hat/halloween/_all.json new file mode 100644 index 0000000..8ba5f7b --- /dev/null +++ b/datapack/data/hats/loot_tables/hat/halloween/_all.json @@ -0,0 +1 @@ +{"type": "minecraft:generic", "pools": [{"rolls": 1, "entries": [{"type": "minecraft:loot_table", "name": "hats:hat/halloween/wiggly_ghast"}]}, {"rolls": 1, "entries": [{"type": "minecraft:loot_table", "name": "hats:hat/halloween/native_american_headband"}]}, {"rolls": 1, "entries": [{"type": "minecraft:loot_table", "name": "hats:hat/halloween/jason_mask"}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat/halloween/_rand.json b/datapack/data/hats/loot_tables/hat/halloween/_rand.json new file mode 100644 index 0000000..f41b974 --- /dev/null +++ b/datapack/data/hats/loot_tables/hat/halloween/_rand.json @@ -0,0 +1 @@ +{"type": "minecraft:generic", "pools": [{"rolls": 1, "entries": [{"type": "minecraft:loot_table", "name": "hats:hat/halloween/wiggly_ghast"}, {"type": "minecraft:loot_table", "name": "hats:hat/halloween/native_american_headband"}, {"type": "minecraft:loot_table", "name": "hats:hat/halloween/jason_mask"}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat/mario/_all.json b/datapack/data/hats/loot_tables/hat/mario/_all.json index e07c32c..262fa3b 100644 --- a/datapack/data/hats/loot_tables/hat/mario/_all.json +++ b/datapack/data/hats/loot_tables/hat/mario/_all.json @@ -1,86 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/mario/cappy" - } - ] - }, - { - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/mario/luigi" - } - ] - }, - { - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/mario/luigi_cap" - } - ] - }, - { - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/mario/mario" - } - ] - }, - { - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/mario/mario_cap" - } - ] - }, - { - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/mario/toad_blue" - } - ] - }, - { - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/mario/toad_green" - } - ] - }, - { - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/mario/toad_red" - } - ] - }, - { - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/mario/toad_yellow" - } - ] - } - ] -} \ No newline at end of file +{"type": "minecraft:generic", "pools": [{"rolls": 1, "entries": [{"type": "minecraft:loot_table", "name": "hats:hat/mario/mario_cap"}]}, {"rolls": 1, "entries": [{"type": "minecraft:loot_table", "name": "hats:hat/mario/luigi_cap"}]}, {"rolls": 1, "entries": [{"type": "minecraft:loot_table", "name": "hats:hat/mario/cappy"}]}, {"rolls": 1, "entries": [{"type": "minecraft:loot_table", "name": "hats:hat/mario/toad_red"}]}, {"rolls": 1, "entries": [{"type": "minecraft:loot_table", "name": "hats:hat/mario/toad_blue"}]}, {"rolls": 1, "entries": [{"type": "minecraft:loot_table", "name": "hats:hat/mario/toad_yellow"}]}, {"rolls": 1, "entries": [{"type": "minecraft:loot_table", "name": "hats:hat/mario/toad_green"}]}, {"rolls": 1, "entries": [{"type": "minecraft:loot_table", "name": "hats:hat/mario/mario"}]}, {"rolls": 1, "entries": [{"type": "minecraft:loot_table", "name": "hats:hat/mario/luigi"}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat/mario/_rand.json b/datapack/data/hats/loot_tables/hat/mario/_rand.json index a99db82..8c70840 100644 --- a/datapack/data/hats/loot_tables/hat/mario/_rand.json +++ b/datapack/data/hats/loot_tables/hat/mario/_rand.json @@ -1,46 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/mario/cappy" - }, - { - "type": "minecraft:loot_table", - "name": "hats:hat/mario/luigi" - }, - { - "type": "minecraft:loot_table", - "name": "hats:hat/mario/luigi_cap" - }, - { - "type": "minecraft:loot_table", - "name": "hats:hat/mario/mario" - }, - { - "type": "minecraft:loot_table", - "name": "hats:hat/mario/mario_cap" - }, - { - "type": "minecraft:loot_table", - "name": "hats:hat/mario/toad_blue" - }, - { - "type": "minecraft:loot_table", - "name": "hats:hat/mario/toad_green" - }, - { - "type": "minecraft:loot_table", - "name": "hats:hat/mario/toad_red" - }, - { - "type": "minecraft:loot_table", - "name": "hats:hat/mario/toad_yellow" - } - ] - } - ] -} \ No newline at end of file +{"type": "minecraft:generic", "pools": [{"rolls": 1, "entries": [{"type": "minecraft:loot_table", "name": "hats:hat/mario/mario_cap"}, {"type": "minecraft:loot_table", "name": "hats:hat/mario/luigi_cap"}, {"type": "minecraft:loot_table", "name": "hats:hat/mario/cappy"}, {"type": "minecraft:loot_table", "name": "hats:hat/mario/toad_red"}, {"type": "minecraft:loot_table", "name": "hats:hat/mario/toad_blue"}, {"type": "minecraft:loot_table", "name": "hats:hat/mario/toad_yellow"}, {"type": "minecraft:loot_table", "name": "hats:hat/mario/toad_green"}, {"type": "minecraft:loot_table", "name": "hats:hat/mario/mario"}, {"type": "minecraft:loot_table", "name": "hats:hat/mario/luigi"}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat/tophats/_all.json b/datapack/data/hats/loot_tables/hat/tophats/_all.json index 4ccf4f8..9bb0bec 100644 --- a/datapack/data/hats/loot_tables/hat/tophats/_all.json +++ b/datapack/data/hats/loot_tables/hat/tophats/_all.json @@ -1,167 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/tophats/black" - } - ] - }, - { - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/tophats/black_monocle" - } - ] - }, - { - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/tophats/blue" - } - ] - }, - { - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/tophats/brown" - } - ] - }, - { - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/tophats/cyan" - } - ] - }, - { - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/tophats/gray" - } - ] - }, - { - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/tophats/green" - } - ] - }, - { - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/tophats/light_blue" - } - ] - }, - { - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/tophats/light_gray" - } - ] - }, - { - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/tophats/lime" - } - ] - }, - { - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/tophats/magenta" - } - ] - }, - { - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/tophats/orange" - } - ] - }, - { - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/tophats/pink" - } - ] - }, - { - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/tophats/purple" - } - ] - }, - { - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/tophats/rainbow" - } - ] - }, - { - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/tophats/red" - } - ] - }, - { - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/tophats/white" - } - ] - }, - { - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/tophats/yellow" - } - ] - } - ] -} \ No newline at end of file +{"type": "minecraft:generic", "pools": [{"rolls": 1, "entries": [{"type": "minecraft:loot_table", "name": "hats:hat/tophats/white"}]}, {"rolls": 1, "entries": [{"type": "minecraft:loot_table", "name": "hats:hat/tophats/orange"}]}, {"rolls": 1, "entries": [{"type": "minecraft:loot_table", "name": "hats:hat/tophats/magenta"}]}, {"rolls": 1, "entries": [{"type": "minecraft:loot_table", "name": "hats:hat/tophats/light_blue"}]}, {"rolls": 1, "entries": [{"type": "minecraft:loot_table", "name": "hats:hat/tophats/yellow"}]}, {"rolls": 1, "entries": [{"type": "minecraft:loot_table", "name": "hats:hat/tophats/lime"}]}, {"rolls": 1, "entries": [{"type": "minecraft:loot_table", "name": "hats:hat/tophats/pink"}]}, {"rolls": 1, "entries": [{"type": "minecraft:loot_table", "name": "hats:hat/tophats/gray"}]}, {"rolls": 1, "entries": [{"type": "minecraft:loot_table", "name": "hats:hat/tophats/light_gray"}]}, {"rolls": 1, "entries": [{"type": "minecraft:loot_table", "name": "hats:hat/tophats/cyan"}]}, {"rolls": 1, "entries": [{"type": "minecraft:loot_table", "name": "hats:hat/tophats/purple"}]}, {"rolls": 1, "entries": [{"type": "minecraft:loot_table", "name": "hats:hat/tophats/blue"}]}, {"rolls": 1, "entries": [{"type": "minecraft:loot_table", "name": "hats:hat/tophats/brown"}]}, {"rolls": 1, "entries": [{"type": "minecraft:loot_table", "name": "hats:hat/tophats/green"}]}, {"rolls": 1, "entries": [{"type": "minecraft:loot_table", "name": "hats:hat/tophats/red"}]}, {"rolls": 1, "entries": [{"type": "minecraft:loot_table", "name": "hats:hat/tophats/black"}]}, {"rolls": 1, "entries": [{"type": "minecraft:loot_table", "name": "hats:hat/tophats/rainbow"}]}, {"rolls": 1, "entries": [{"type": "minecraft:loot_table", "name": "hats:hat/tophats/black_monocle"}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat/tophats/_rand.json b/datapack/data/hats/loot_tables/hat/tophats/_rand.json index d0cb78d..45217d0 100644 --- a/datapack/data/hats/loot_tables/hat/tophats/_rand.json +++ b/datapack/data/hats/loot_tables/hat/tophats/_rand.json @@ -1,82 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/tophats/black" - }, - { - "type": "minecraft:loot_table", - "name": "hats:hat/tophats/black_monocle" - }, - { - "type": "minecraft:loot_table", - "name": "hats:hat/tophats/blue" - }, - { - "type": "minecraft:loot_table", - "name": "hats:hat/tophats/brown" - }, - { - "type": "minecraft:loot_table", - "name": "hats:hat/tophats/cyan" - }, - { - "type": "minecraft:loot_table", - "name": "hats:hat/tophats/gray" - }, - { - "type": "minecraft:loot_table", - "name": "hats:hat/tophats/green" - }, - { - "type": "minecraft:loot_table", - "name": "hats:hat/tophats/light_blue" - }, - { - "type": "minecraft:loot_table", - "name": "hats:hat/tophats/light_gray" - }, - { - "type": "minecraft:loot_table", - "name": "hats:hat/tophats/lime" - }, - { - "type": "minecraft:loot_table", - "name": "hats:hat/tophats/magenta" - }, - { - "type": "minecraft:loot_table", - "name": "hats:hat/tophats/orange" - }, - { - "type": "minecraft:loot_table", - "name": "hats:hat/tophats/pink" - }, - { - "type": "minecraft:loot_table", - "name": "hats:hat/tophats/purple" - }, - { - "type": "minecraft:loot_table", - "name": "hats:hat/tophats/rainbow" - }, - { - "type": "minecraft:loot_table", - "name": "hats:hat/tophats/red" - }, - { - "type": "minecraft:loot_table", - "name": "hats:hat/tophats/white" - }, - { - "type": "minecraft:loot_table", - "name": "hats:hat/tophats/yellow" - } - ] - } - ] -} \ No newline at end of file +{"type": "minecraft:generic", "pools": [{"rolls": 1, "entries": [{"type": "minecraft:loot_table", "name": "hats:hat/tophats/white"}, {"type": "minecraft:loot_table", "name": "hats:hat/tophats/orange"}, {"type": "minecraft:loot_table", "name": "hats:hat/tophats/magenta"}, {"type": "minecraft:loot_table", "name": "hats:hat/tophats/light_blue"}, {"type": "minecraft:loot_table", "name": "hats:hat/tophats/yellow"}, {"type": "minecraft:loot_table", "name": "hats:hat/tophats/lime"}, {"type": "minecraft:loot_table", "name": "hats:hat/tophats/pink"}, {"type": "minecraft:loot_table", "name": "hats:hat/tophats/gray"}, {"type": "minecraft:loot_table", "name": "hats:hat/tophats/light_gray"}, {"type": "minecraft:loot_table", "name": "hats:hat/tophats/cyan"}, {"type": "minecraft:loot_table", "name": "hats:hat/tophats/purple"}, {"type": "minecraft:loot_table", "name": "hats:hat/tophats/blue"}, {"type": "minecraft:loot_table", "name": "hats:hat/tophats/brown"}, {"type": "minecraft:loot_table", "name": "hats:hat/tophats/green"}, {"type": "minecraft:loot_table", "name": "hats:hat/tophats/red"}, {"type": "minecraft:loot_table", "name": "hats:hat/tophats/black"}, {"type": "minecraft:loot_table", "name": "hats:hat/tophats/rainbow"}, {"type": "minecraft:loot_table", "name": "hats:hat/tophats/black_monocle"}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat/villager/_all.json b/datapack/data/hats/loot_tables/hat/villager/_all.json index a465f72..ce460b0 100644 --- a/datapack/data/hats/loot_tables/hat/villager/_all.json +++ b/datapack/data/hats/loot_tables/hat/villager/_all.json @@ -1,32 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/villager/armorer" - } - ] - }, - { - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/villager/farmer" - } - ] - }, - { - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/villager/nose" - } - ] - } - ] -} \ No newline at end of file +{"type": "minecraft:generic", "pools": [{"rolls": 1, "entries": [{"type": "minecraft:loot_table", "name": "hats:hat/villager/armorer"}]}, {"rolls": 1, "entries": [{"type": "minecraft:loot_table", "name": "hats:hat/villager/farmer"}]}, {"rolls": 1, "entries": [{"type": "minecraft:loot_table", "name": "hats:hat/villager/nose"}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat/villager/_rand.json b/datapack/data/hats/loot_tables/hat/villager/_rand.json index e8c171a..c948d0c 100644 --- a/datapack/data/hats/loot_tables/hat/villager/_rand.json +++ b/datapack/data/hats/loot_tables/hat/villager/_rand.json @@ -1,22 +1 @@ -{ - "type": "minecraft:generic", - "pools": [ - { - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat/villager/armorer" - }, - { - "type": "minecraft:loot_table", - "name": "hats:hat/villager/farmer" - }, - { - "type": "minecraft:loot_table", - "name": "hats:hat/villager/nose" - } - ] - } - ] -} \ No newline at end of file +{"type": "minecraft:generic", "pools": [{"rolls": 1, "entries": [{"type": "minecraft:loot_table", "name": "hats:hat/villager/armorer"}, {"type": "minecraft:loot_table", "name": "hats:hat/villager/farmer"}, {"type": "minecraft:loot_table", "name": "hats:hat/villager/nose"}]}]} \ No newline at end of file From 2c3edc501d0404396b626da705eda882a6090e7e Mon Sep 17 00:00:00 2001 From: OraneUtan Date: Thu, 21 May 2020 16:41:00 +0200 Subject: [PATCH 12/58] Players are now equipped with hats via the shulkerbox method --- .../equip_player_with_correct_hat.mcfunction | 93 ++++--------------- .../blocks/yellow_shulker_box.json | 67 +++++++++++++ 2 files changed, 84 insertions(+), 76 deletions(-) create mode 100644 datapack/data/minecraft/loot_tables/blocks/yellow_shulker_box.json diff --git a/datapack/data/hats/functions/hat_behavior/equip_player_with_correct_hat.mcfunction b/datapack/data/hats/functions/hat_behavior/equip_player_with_correct_hat.mcfunction index 68d4200..6cdafcd 100644 --- a/datapack/data/hats/functions/hat_behavior/equip_player_with_correct_hat.mcfunction +++ b/datapack/data/hats/functions/hat_behavior/equip_player_with_correct_hat.mcfunction @@ -3,79 +3,20 @@ # Descr: Replace the #hat on the Players head with an #hat_on_head # #################################################################### -# Miscellaneous -execute as @s[nbt={Inventory:[{Slot:103b,tag:{CustomModelData:3000}}]}] run loot replace entity @s armor.head loot hats:hat_on_head/fez -execute as @s[nbt={Inventory:[{Slot:103b,tag:{CustomModelData:3001}}]}] run loot replace entity @s armor.head loot hats:hat_on_head/squid -execute as @s[nbt={Inventory:[{Slot:103b,tag:{CustomModelData:3002}}]}] run loot replace entity @s armor.head loot hats:hat_on_head/arrow -execute as @s[nbt={Inventory:[{Slot:103b,tag:{CustomModelData:3003}}]}] run loot replace entity @s armor.head loot hats:hat_on_head/frying_pan - -# Tophats -execute as @s[nbt={Inventory:[{Slot:103b,tag:{CustomModelData:3100}}]}] run loot replace entity @s armor.head loot hats:hat_on_head/tophats/white -execute as @s[nbt={Inventory:[{Slot:103b,tag:{CustomModelData:3101}}]}] run loot replace entity @s armor.head loot hats:hat_on_head/tophats/orange -execute as @s[nbt={Inventory:[{Slot:103b,tag:{CustomModelData:3102}}]}] run loot replace entity @s armor.head loot hats:hat_on_head/tophats/magenta -execute as @s[nbt={Inventory:[{Slot:103b,tag:{CustomModelData:3103}}]}] run loot replace entity @s armor.head loot hats:hat_on_head/tophats/light_blue -execute as @s[nbt={Inventory:[{Slot:103b,tag:{CustomModelData:3104}}]}] run loot replace entity @s armor.head loot hats:hat_on_head/tophats/yellow -execute as @s[nbt={Inventory:[{Slot:103b,tag:{CustomModelData:3105}}]}] run loot replace entity @s armor.head loot hats:hat_on_head/tophats/lime -execute as @s[nbt={Inventory:[{Slot:103b,tag:{CustomModelData:3106}}]}] run loot replace entity @s armor.head loot hats:hat_on_head/tophats/pink -execute as @s[nbt={Inventory:[{Slot:103b,tag:{CustomModelData:3107}}]}] run loot replace entity @s armor.head loot hats:hat_on_head/tophats/gray -execute as @s[nbt={Inventory:[{Slot:103b,tag:{CustomModelData:3108}}]}] run loot replace entity @s armor.head loot hats:hat_on_head/tophats/light_gray -execute as @s[nbt={Inventory:[{Slot:103b,tag:{CustomModelData:3109}}]}] run loot replace entity @s armor.head loot hats:hat_on_head/tophats/cyan -execute as @s[nbt={Inventory:[{Slot:103b,tag:{CustomModelData:3110}}]}] run loot replace entity @s armor.head loot hats:hat_on_head/tophats/purple -execute as @s[nbt={Inventory:[{Slot:103b,tag:{CustomModelData:3111}}]}] run loot replace entity @s armor.head loot hats:hat_on_head/tophats/blue -execute as @s[nbt={Inventory:[{Slot:103b,tag:{CustomModelData:3112}}]}] run loot replace entity @s armor.head loot hats:hat_on_head/tophats/brown -execute as @s[nbt={Inventory:[{Slot:103b,tag:{CustomModelData:3113}}]}] run loot replace entity @s armor.head loot hats:hat_on_head/tophats/green -execute as @s[nbt={Inventory:[{Slot:103b,tag:{CustomModelData:3114}}]}] run loot replace entity @s armor.head loot hats:hat_on_head/tophats/red -execute as @s[nbt={Inventory:[{Slot:103b,tag:{CustomModelData:3115}}]}] run loot replace entity @s armor.head loot hats:hat_on_head/tophats/black -execute as @s[nbt={Inventory:[{Slot:103b,tag:{CustomModelData:3116}}]}] run loot replace entity @s armor.head loot hats:hat_on_head/tophats/rainbow -execute as @s[nbt={Inventory:[{Slot:103b,tag:{CustomModelData:3117}}]}] run loot replace entity @s armor.head loot hats:hat_on_head/tophats/black_monocle - -# Cats -execute as @s[nbt={Inventory:[{Slot:103b,tag:{CustomModelData:3120}}]}] run loot replace entity @s armor.head loot hats:hat_on_head/cats/ocelot -execute as @s[nbt={Inventory:[{Slot:103b,tag:{CustomModelData:3121}}]}] run loot replace entity @s armor.head loot hats:hat_on_head/cats/tabby -execute as @s[nbt={Inventory:[{Slot:103b,tag:{CustomModelData:3122}}]}] run loot replace entity @s armor.head loot hats:hat_on_head/cats/tuxedo -execute as @s[nbt={Inventory:[{Slot:103b,tag:{CustomModelData:3123}}]}] run loot replace entity @s armor.head loot hats:hat_on_head/cats/red -execute as @s[nbt={Inventory:[{Slot:103b,tag:{CustomModelData:3124}}]}] run loot replace entity @s armor.head loot hats:hat_on_head/cats/siamese -execute as @s[nbt={Inventory:[{Slot:103b,tag:{CustomModelData:3125}}]}] run loot replace entity @s armor.head loot hats:hat_on_head/cats/british_shorthair -execute as @s[nbt={Inventory:[{Slot:103b,tag:{CustomModelData:3126}}]}] run loot replace entity @s armor.head loot hats:hat_on_head/cats/calico -execute as @s[nbt={Inventory:[{Slot:103b,tag:{CustomModelData:3127}}]}] run loot replace entity @s armor.head loot hats:hat_on_head/cats/persian -execute as @s[nbt={Inventory:[{Slot:103b,tag:{CustomModelData:3128}}]}] run loot replace entity @s armor.head loot hats:hat_on_head/cats/ragdoll -execute as @s[nbt={Inventory:[{Slot:103b,tag:{CustomModelData:3129}}]}] run loot replace entity @s armor.head loot hats:hat_on_head/cats/white -execute as @s[nbt={Inventory:[{Slot:103b,tag:{CustomModelData:3130}}]}] run loot replace entity @s armor.head loot hats:hat_on_head/cats/jellie -execute as @s[nbt={Inventory:[{Slot:103b,tag:{CustomModelData:3131}}]}] run loot replace entity @s armor.head loot hats:hat_on_head/cats/black - -# Glasses -execute as @s[nbt={Inventory:[{Slot:103b,tag:{CustomModelData:3140}}]}] run loot replace entity @s armor.head loot hats:hat_on_head/glasses/sunglasses -execute as @s[nbt={Inventory:[{Slot:103b,tag:{CustomModelData:3141}}]}] run loot replace entity @s armor.head loot hats:hat_on_head/glasses/harry_potter -execute as @s[nbt={Inventory:[{Slot:103b,tag:{CustomModelData:3142}}]}] run loot replace entity @s armor.head loot hats:hat_on_head/glasses/half_rim -execute as @s[nbt={Inventory:[{Slot:103b,tag:{CustomModelData:3143}}]}] run loot replace entity @s armor.head loot hats:hat_on_head/glasses/rainbow -execute as @s[nbt={Inventory:[{Slot:103b,tag:{CustomModelData:3144}}]}] run loot replace entity @s armor.head loot hats:hat_on_head/glasses/librarian -execute as @s[nbt={Inventory:[{Slot:103b,tag:{CustomModelData:3145}}]}] run loot replace entity @s armor.head loot hats:hat_on_head/glasses/three_d - -# Accessories -execute as @s[nbt={Inventory:[{Slot:103b,tag:{CustomModelData:3150}}]}] run loot replace entity @s armor.head loot hats:hat_on_head/accessories/ninja_headband -execute as @s[nbt={Inventory:[{Slot:103b,tag:{CustomModelData:3151}}]}] run loot replace entity @s armor.head loot hats:hat_on_head/accessories/steve_mask -execute as @s[nbt={Inventory:[{Slot:103b,tag:{CustomModelData:3152}}]}] run loot replace entity @s armor.head loot hats:hat_on_head/accessories/alex_mask -execute as @s[nbt={Inventory:[{Slot:103b,tag:{CustomModelData:3153}}]}] run loot replace entity @s armor.head loot hats:hat_on_head/accessories/snorkel_mask_blue -execute as @s[nbt={Inventory:[{Slot:103b,tag:{CustomModelData:3154}}]}] run loot replace entity @s armor.head loot hats:hat_on_head/accessories/snorkel_mask_red -execute as @s[nbt={Inventory:[{Slot:103b,tag:{CustomModelData:3155}}]}] run loot replace entity @s armor.head loot hats:hat_on_head/accessories/googly_eyes - -# Villager related -execute as @s[nbt={Inventory:[{Slot:103b,tag:{CustomModelData:3160}}]}] run loot replace entity @s armor.head loot hats:hat_on_head/villager/armorer -execute as @s[nbt={Inventory:[{Slot:103b,tag:{CustomModelData:3161}}]}] run loot replace entity @s armor.head loot hats:hat_on_head/villager/farmer -execute as @s[nbt={Inventory:[{Slot:103b,tag:{CustomModelData:3162}}]}] run loot replace entity @s armor.head loot hats:hat_on_head/villager/nose - -# Mario -execute as @s[nbt={Inventory:[{Slot:103b,tag:{CustomModelData:3170}}]}] run loot replace entity @s armor.head loot hats:hat_on_head/mario/mario_cap -execute as @s[nbt={Inventory:[{Slot:103b,tag:{CustomModelData:3171}}]}] run loot replace entity @s armor.head loot hats:hat_on_head/mario/luigi_cap -execute as @s[nbt={Inventory:[{Slot:103b,tag:{CustomModelData:3172}}]}] run loot replace entity @s armor.head loot hats:hat_on_head/mario/cappy -execute as @s[nbt={Inventory:[{Slot:103b,tag:{CustomModelData:3173}}]}] run loot replace entity @s armor.head loot hats:hat_on_head/mario/toad_red -execute as @s[nbt={Inventory:[{Slot:103b,tag:{CustomModelData:3174}}]}] run loot replace entity @s armor.head loot hats:hat_on_head/mario/toad_blue -execute as @s[nbt={Inventory:[{Slot:103b,tag:{CustomModelData:3175}}]}] run loot replace entity @s armor.head loot hats:hat_on_head/mario/toad_yellow -execute as @s[nbt={Inventory:[{Slot:103b,tag:{CustomModelData:3176}}]}] run loot replace entity @s armor.head loot hats:hat_on_head/mario/toad_green -execute as @s[nbt={Inventory:[{Slot:103b,tag:{CustomModelData:3177}}]}] run loot replace entity @s armor.head loot hats:hat_on_head/mario/mario -execute as @s[nbt={Inventory:[{Slot:103b,tag:{CustomModelData:3178}}]}] run loot replace entity @s armor.head loot hats:hat_on_head/mario/luigi - -# Halloween -execute as @s[nbt={Inventory:[{Slot:103b,tag:{CustomModelData:7773180}}]}] run loot replace entity @s armor.head loot hats:hat_on_head/halloween/wiggly_ghast -execute as @s[nbt={Inventory:[{Slot:103b,tag:{CustomModelData:7773181}}]}] run loot replace entity @s armor.head loot hats:hat_on_head/halloween/native_american_headband -execute as @s[nbt={Inventory:[{Slot:103b,tag:{CustomModelData:7773182}}]}] run loot replace entity @s armor.head loot hats:hat_on_head/halloween/jason_mask \ No newline at end of file +# Get hat +data modify storage hats buffer.all set from entity @s Inventory +data modify storage minecraft:hats buffer.armor set value [] +data modify storage minecraft:hats buffer.armor append from storage minecraft:hats buffer.all[{Slot:103b}] + +# Modify hat +data modify storage minecraft:hats buffer.armor[0].id set value "minecraft:stick" +data modify storage minecraft:hats buffer.armor[0].Slot set value 0b + +# Replace Player helmet with modified hat +setblock ~ 255 ~20 minecraft:yellow_shulker_box +data modify block ~ 255 ~20 Items set from storage minecraft:hats buffer.armor +loot replace entity @s armor.head 1 mine ~ 255 ~20 minecraft:diamond_pickaxe{drop_contents:1b} + +# Clean up +setblock ~ 255 ~20 minecraft:air +data remove storage minecraft:hats buffer \ No newline at end of file diff --git a/datapack/data/minecraft/loot_tables/blocks/yellow_shulker_box.json b/datapack/data/minecraft/loot_tables/blocks/yellow_shulker_box.json new file mode 100644 index 0000000..90c8a40 --- /dev/null +++ b/datapack/data/minecraft/loot_tables/blocks/yellow_shulker_box.json @@ -0,0 +1,67 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:alternatives", + "children": [ + { + "type": "minecraft:dynamic", + "name": "minecraft:contents", + "conditions": [ + { + "condition": "minecraft:match_tool", + "predicate": { + "nbt": "{drop_contents: 1b}" + } + } + ] + }, + { + "type": "minecraft:item", + "functions": [ + { + "function": "minecraft:copy_name", + "source": "block_entity" + }, + { + "function": "minecraft:copy_nbt", + "source": "block_entity", + "ops": [ + { + "source": "Lock", + "target": "BlockEntityTag.Lock", + "op": "replace" + }, + { + "source": "LootTable", + "target": "BlockEntityTag.LootTable", + "op": "replace" + }, + { + "source": "LootTableSeed", + "target": "BlockEntityTag.LootTableSeed", + "op": "replace" + } + ] + }, + { + "function": "minecraft:set_contents", + "entries": [ + { + "type": "minecraft:dynamic", + "name": "minecraft:contents" + } + ] + } + ], + "name": "minecraft:yellow_shulker_box" + } + ] + } + ] + } + ] +} \ No newline at end of file From df26dff40e49a76183d4ed05f9be1ede74653aec Mon Sep 17 00:00:00 2001 From: OraneUtan Date: Thu, 21 May 2020 17:42:29 +0200 Subject: [PATCH 13/58] Fixing hat on Players head is now triggered by an advancement --- .../triggers/received_normal_hat.json | 34 +++++++++++++++++++ .../equip_player_with_correct_hat.mcfunction | 8 ++--- datapack/data/hats/functions/tick.mcfunction | 2 -- .../triggers/received_normal_hat.mcfunction | 12 +++++++ ...d_equip_player_with_correct_hat.mcfunction | 6 ++++ 5 files changed, 56 insertions(+), 6 deletions(-) create mode 100644 datapack/data/hats/advancements/triggers/received_normal_hat.json create mode 100644 datapack/data/hats/functions/triggers/received_normal_hat.mcfunction create mode 100644 datapack/data/hats/functions/triggers/scheduled_equip_player_with_correct_hat.mcfunction diff --git a/datapack/data/hats/advancements/triggers/received_normal_hat.json b/datapack/data/hats/advancements/triggers/received_normal_hat.json new file mode 100644 index 0000000..aff9c54 --- /dev/null +++ b/datapack/data/hats/advancements/triggers/received_normal_hat.json @@ -0,0 +1,34 @@ +{ + "parent" : "hats:root", + "display" : { + "icon": { + "item": "minecraft:air" + }, + "title" : { + "translate": "" + }, + "description" : { + "translate": "" + }, + "show_toast": false, + "announce_to_chat": false, + "hidden": true + }, + "criteria" : { + "received_normal_hat" : { + "trigger" : "minecraft:inventory_changed", + "conditions" : { + "items": [ + { + "item": "minecraft:leather_helmet", + "nbt": "{Tags:[\"is_hat\"]}" + } + ] + } + } + }, + "requirements" : [["received_normal_hat"]], + "rewards": { + "function": "hats:triggers/received_normal_hat" + } +} \ No newline at end of file diff --git a/datapack/data/hats/functions/hat_behavior/equip_player_with_correct_hat.mcfunction b/datapack/data/hats/functions/hat_behavior/equip_player_with_correct_hat.mcfunction index 6cdafcd..54a8486 100644 --- a/datapack/data/hats/functions/hat_behavior/equip_player_with_correct_hat.mcfunction +++ b/datapack/data/hats/functions/hat_behavior/equip_player_with_correct_hat.mcfunction @@ -13,10 +13,10 @@ data modify storage minecraft:hats buffer.armor[0].id set value "minecraft:stick data modify storage minecraft:hats buffer.armor[0].Slot set value 0b # Replace Player helmet with modified hat -setblock ~ 255 ~20 minecraft:yellow_shulker_box -data modify block ~ 255 ~20 Items set from storage minecraft:hats buffer.armor -loot replace entity @s armor.head 1 mine ~ 255 ~20 minecraft:diamond_pickaxe{drop_contents:1b} +setblock ~ 0 ~ minecraft:yellow_shulker_box +data modify block ~ 0 ~ Items set from storage minecraft:hats buffer.armor +loot replace entity @s armor.head 1 mine ~ 0 ~ minecraft:diamond_pickaxe{drop_contents:1b} # Clean up -setblock ~ 255 ~20 minecraft:air +setblock ~ 0 ~ minecraft:air data remove storage minecraft:hats buffer \ No newline at end of file diff --git a/datapack/data/hats/functions/tick.mcfunction b/datapack/data/hats/functions/tick.mcfunction index d094637..a86db9a 100644 --- a/datapack/data/hats/functions/tick.mcfunction +++ b/datapack/data/hats/functions/tick.mcfunction @@ -9,8 +9,6 @@ # the following code replaces them with an item that can # #----------------------------------------------------------------------# -# Replace helmet on players head -execute as @a[nbt={Inventory:[{Slot:103b,id:"minecraft:leather_helmet",tag:{Tags:["is_hat"]}}]}] run function hats:hat_behavior/equip_player_with_correct_hat # Replace helmet on armorstand execute as @e[type=minecraft:armor_stand,nbt={ArmorItems:[{},{},{},{id:"minecraft:leather_helmet",tag:{Tags:["is_hat"]}}]}] run function hats:hat_behavior/equip_armorstand_with_correct_hat diff --git a/datapack/data/hats/functions/triggers/received_normal_hat.mcfunction b/datapack/data/hats/functions/triggers/received_normal_hat.mcfunction new file mode 100644 index 0000000..628f99d --- /dev/null +++ b/datapack/data/hats/functions/triggers/received_normal_hat.mcfunction @@ -0,0 +1,12 @@ +#################################################################### +# as: Player getting advancement # +# Descr: Called by advancement when the players inventory # +# contains a hat. If the hat is on the players head, # +# replace it with a HOH-hat # +#################################################################### + +# Check if the hat is on the players hat. If so, schedule to fix it +execute if entity @s[nbt={Inventory:[{Slot:103b,id:"minecraft:leather_helmet",tag:{Tags:["is_hat"]}}]}] run schedule function hats:triggers/scheduled_equip_player_with_correct_hat 1t + +# Reset trigger +advancement revoke @s only hats:triggers/received_normal_hat \ No newline at end of file diff --git a/datapack/data/hats/functions/triggers/scheduled_equip_player_with_correct_hat.mcfunction b/datapack/data/hats/functions/triggers/scheduled_equip_player_with_correct_hat.mcfunction new file mode 100644 index 0000000..44d5984 --- /dev/null +++ b/datapack/data/hats/functions/triggers/scheduled_equip_player_with_correct_hat.mcfunction @@ -0,0 +1,6 @@ +#################################################################### +# as: World # +# Descr: Fix hats on players that need fixing # +#################################################################### + +execute as @a[nbt={Inventory:[{Slot:103b,id:"minecraft:leather_helmet",tag:{Tags:["is_hat"]}}]}] run function hats:hat_behavior/equip_player_with_correct_hat \ No newline at end of file From df294ddc4607ffcbbbd156f284c926777c0e7527 Mon Sep 17 00:00:00 2001 From: OraneUtan Date: Fri, 22 May 2020 10:29:09 +0200 Subject: [PATCH 14/58] Stick hats are now fixed using the shulkerbox method Removed all old "hats:fix_hat/..." functions, as they are all replaced by the new method. Added "fix_hats_in_players_inventory", which now contains all the logic --- .../fix_hat/accessories/alex_mask.mcfunction | 3 - .../accessories/googly_eyes.mcfunction | 3 - .../accessories/ninja_headband.mcfunction | 3 - .../accessories/snorkel_mask_blue.mcfunction | 3 - .../accessories/snorkel_mask_red.mcfunction | 3 - .../fix_hat/accessories/steve_mask.mcfunction | 3 - .../hats/functions/fix_hat/arrow.mcfunction | 3 - .../functions/fix_hat/cats/black.mcfunction | 3 - .../fix_hat/cats/british_shorthair.mcfunction | 3 - .../functions/fix_hat/cats/calico.mcfunction | 3 - .../functions/fix_hat/cats/jellie.mcfunction | 3 - .../functions/fix_hat/cats/ocelot.mcfunction | 3 - .../functions/fix_hat/cats/persian.mcfunction | 3 - .../functions/fix_hat/cats/ragdoll.mcfunction | 3 - .../functions/fix_hat/cats/red.mcfunction | 3 - .../functions/fix_hat/cats/siamese.mcfunction | 3 - .../functions/fix_hat/cats/tabby.mcfunction | 3 - .../functions/fix_hat/cats/tuxedo.mcfunction | 3 - .../functions/fix_hat/cats/white.mcfunction | 3 - .../hats/functions/fix_hat/fez.mcfunction | 3 - .../functions/fix_hat/frying_pan.mcfunction | 3 - .../fix_hat/glasses/half_rim.mcfunction | 3 - .../fix_hat/glasses/harry_potter.mcfunction | 3 - .../fix_hat/glasses/librarian.mcfunction | 3 - .../fix_hat/glasses/rainbow.mcfunction | 3 - .../fix_hat/glasses/sunglasses.mcfunction | 3 - .../fix_hat/glasses/three_d.mcfunction | 3 - .../fix_hat/halloween/jason_mask.mcfunction | 3 - .../native_american_headband.mcfunction | 3 - .../fix_hat/halloween/wiggly_ghast.mcfunction | 3 - .../functions/fix_hat/mario/cappy.mcfunction | 3 - .../functions/fix_hat/mario/luigi.mcfunction | 3 - .../fix_hat/mario/luigi_cap.mcfunction | 3 - .../functions/fix_hat/mario/mario.mcfunction | 3 - .../fix_hat/mario/mario_cap.mcfunction | 3 - .../fix_hat/mario/toad_blue.mcfunction | 3 - .../fix_hat/mario/toad_green.mcfunction | 3 - .../fix_hat/mario/toad_red.mcfunction | 3 - .../fix_hat/mario/toad_yellow.mcfunction | 3 - .../hats/functions/fix_hat/squid.mcfunction | 3 - .../fix_hat/tophats/black.mcfunction | 3 - .../fix_hat/tophats/black_monocle.mcfunction | 3 - .../functions/fix_hat/tophats/blue.mcfunction | 3 - .../fix_hat/tophats/brown.mcfunction | 3 - .../functions/fix_hat/tophats/cyan.mcfunction | 3 - .../functions/fix_hat/tophats/gray.mcfunction | 3 - .../fix_hat/tophats/green.mcfunction | 3 - .../fix_hat/tophats/light_blue.mcfunction | 3 - .../fix_hat/tophats/light_gray.mcfunction | 3 - .../functions/fix_hat/tophats/lime.mcfunction | 3 - .../fix_hat/tophats/magenta.mcfunction | 3 - .../fix_hat/tophats/orange.mcfunction | 3 - .../functions/fix_hat/tophats/pink.mcfunction | 3 - .../fix_hat/tophats/purple.mcfunction | 3 - .../fix_hat/tophats/rainbow.mcfunction | 3 - .../functions/fix_hat/tophats/red.mcfunction | 3 - .../fix_hat/tophats/white.mcfunction | 3 - .../fix_hat/tophats/yellow.mcfunction | 3 - .../fix_hat/villager/armorer.mcfunction | 3 - .../fix_hat/villager/farmer.mcfunction | 3 - .../fix_hat/villager/nose.mcfunction | 3 - .../hat_behavior/fix_hat_from_head.mcfunction | 65 ------------- ...stick_hats_in_players_inventory.mcfunction | 97 +++++++++++++++++++ 63 files changed, 97 insertions(+), 248 deletions(-) delete mode 100644 datapack/data/hats/functions/fix_hat/accessories/alex_mask.mcfunction delete mode 100644 datapack/data/hats/functions/fix_hat/accessories/googly_eyes.mcfunction delete mode 100644 datapack/data/hats/functions/fix_hat/accessories/ninja_headband.mcfunction delete mode 100644 datapack/data/hats/functions/fix_hat/accessories/snorkel_mask_blue.mcfunction delete mode 100644 datapack/data/hats/functions/fix_hat/accessories/snorkel_mask_red.mcfunction delete mode 100644 datapack/data/hats/functions/fix_hat/accessories/steve_mask.mcfunction delete mode 100644 datapack/data/hats/functions/fix_hat/arrow.mcfunction delete mode 100644 datapack/data/hats/functions/fix_hat/cats/black.mcfunction delete mode 100644 datapack/data/hats/functions/fix_hat/cats/british_shorthair.mcfunction delete mode 100644 datapack/data/hats/functions/fix_hat/cats/calico.mcfunction delete mode 100644 datapack/data/hats/functions/fix_hat/cats/jellie.mcfunction delete mode 100644 datapack/data/hats/functions/fix_hat/cats/ocelot.mcfunction delete mode 100644 datapack/data/hats/functions/fix_hat/cats/persian.mcfunction delete mode 100644 datapack/data/hats/functions/fix_hat/cats/ragdoll.mcfunction delete mode 100644 datapack/data/hats/functions/fix_hat/cats/red.mcfunction delete mode 100644 datapack/data/hats/functions/fix_hat/cats/siamese.mcfunction delete mode 100644 datapack/data/hats/functions/fix_hat/cats/tabby.mcfunction delete mode 100644 datapack/data/hats/functions/fix_hat/cats/tuxedo.mcfunction delete mode 100644 datapack/data/hats/functions/fix_hat/cats/white.mcfunction delete mode 100644 datapack/data/hats/functions/fix_hat/fez.mcfunction delete mode 100644 datapack/data/hats/functions/fix_hat/frying_pan.mcfunction delete mode 100644 datapack/data/hats/functions/fix_hat/glasses/half_rim.mcfunction delete mode 100644 datapack/data/hats/functions/fix_hat/glasses/harry_potter.mcfunction delete mode 100644 datapack/data/hats/functions/fix_hat/glasses/librarian.mcfunction delete mode 100644 datapack/data/hats/functions/fix_hat/glasses/rainbow.mcfunction delete mode 100644 datapack/data/hats/functions/fix_hat/glasses/sunglasses.mcfunction delete mode 100644 datapack/data/hats/functions/fix_hat/glasses/three_d.mcfunction delete mode 100644 datapack/data/hats/functions/fix_hat/halloween/jason_mask.mcfunction delete mode 100644 datapack/data/hats/functions/fix_hat/halloween/native_american_headband.mcfunction delete mode 100644 datapack/data/hats/functions/fix_hat/halloween/wiggly_ghast.mcfunction delete mode 100644 datapack/data/hats/functions/fix_hat/mario/cappy.mcfunction delete mode 100644 datapack/data/hats/functions/fix_hat/mario/luigi.mcfunction delete mode 100644 datapack/data/hats/functions/fix_hat/mario/luigi_cap.mcfunction delete mode 100644 datapack/data/hats/functions/fix_hat/mario/mario.mcfunction delete mode 100644 datapack/data/hats/functions/fix_hat/mario/mario_cap.mcfunction delete mode 100644 datapack/data/hats/functions/fix_hat/mario/toad_blue.mcfunction delete mode 100644 datapack/data/hats/functions/fix_hat/mario/toad_green.mcfunction delete mode 100644 datapack/data/hats/functions/fix_hat/mario/toad_red.mcfunction delete mode 100644 datapack/data/hats/functions/fix_hat/mario/toad_yellow.mcfunction delete mode 100644 datapack/data/hats/functions/fix_hat/squid.mcfunction delete mode 100644 datapack/data/hats/functions/fix_hat/tophats/black.mcfunction delete mode 100644 datapack/data/hats/functions/fix_hat/tophats/black_monocle.mcfunction delete mode 100644 datapack/data/hats/functions/fix_hat/tophats/blue.mcfunction delete mode 100644 datapack/data/hats/functions/fix_hat/tophats/brown.mcfunction delete mode 100644 datapack/data/hats/functions/fix_hat/tophats/cyan.mcfunction delete mode 100644 datapack/data/hats/functions/fix_hat/tophats/gray.mcfunction delete mode 100644 datapack/data/hats/functions/fix_hat/tophats/green.mcfunction delete mode 100644 datapack/data/hats/functions/fix_hat/tophats/light_blue.mcfunction delete mode 100644 datapack/data/hats/functions/fix_hat/tophats/light_gray.mcfunction delete mode 100644 datapack/data/hats/functions/fix_hat/tophats/lime.mcfunction delete mode 100644 datapack/data/hats/functions/fix_hat/tophats/magenta.mcfunction delete mode 100644 datapack/data/hats/functions/fix_hat/tophats/orange.mcfunction delete mode 100644 datapack/data/hats/functions/fix_hat/tophats/pink.mcfunction delete mode 100644 datapack/data/hats/functions/fix_hat/tophats/purple.mcfunction delete mode 100644 datapack/data/hats/functions/fix_hat/tophats/rainbow.mcfunction delete mode 100644 datapack/data/hats/functions/fix_hat/tophats/red.mcfunction delete mode 100644 datapack/data/hats/functions/fix_hat/tophats/white.mcfunction delete mode 100644 datapack/data/hats/functions/fix_hat/tophats/yellow.mcfunction delete mode 100644 datapack/data/hats/functions/fix_hat/villager/armorer.mcfunction delete mode 100644 datapack/data/hats/functions/fix_hat/villager/farmer.mcfunction delete mode 100644 datapack/data/hats/functions/fix_hat/villager/nose.mcfunction delete mode 100644 datapack/data/hats/functions/hat_behavior/fix_hat_from_head.mcfunction create mode 100644 datapack/data/hats/functions/hat_behavior/fix_stick_hats_in_players_inventory.mcfunction diff --git a/datapack/data/hats/functions/fix_hat/accessories/alex_mask.mcfunction b/datapack/data/hats/functions/fix_hat/accessories/alex_mask.mcfunction deleted file mode 100644 index fcdddcb..0000000 --- a/datapack/data/hats/functions/fix_hat/accessories/alex_mask.mcfunction +++ /dev/null @@ -1,3 +0,0 @@ -# as: Player, descr: Replace #hat item with equivalent #hat_on_head item -clear @s minecraft:stick{CustomModelData:3152, Tags:["is_hat"]} 1 -execute as @s run loot give @s loot hats:hat/accessories/alex_mask \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/accessories/googly_eyes.mcfunction b/datapack/data/hats/functions/fix_hat/accessories/googly_eyes.mcfunction deleted file mode 100644 index 2aaad03..0000000 --- a/datapack/data/hats/functions/fix_hat/accessories/googly_eyes.mcfunction +++ /dev/null @@ -1,3 +0,0 @@ -# as: Player, descr: Replace #hat item with equivalent #hat_on_head item -clear @s minecraft:stick{CustomModelData:3155, Tags:["is_hat"]} 1 -execute as @s run loot give @s loot hats:hat/accessories/googly_eyes \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/accessories/ninja_headband.mcfunction b/datapack/data/hats/functions/fix_hat/accessories/ninja_headband.mcfunction deleted file mode 100644 index 90e4d18..0000000 --- a/datapack/data/hats/functions/fix_hat/accessories/ninja_headband.mcfunction +++ /dev/null @@ -1,3 +0,0 @@ -# as: Player, descr: Replace #hat item with equivalent #hat_on_head item -clear @s minecraft:stick{CustomModelData:3150, Tags:["is_hat"]} 1 -execute as @s run loot give @s loot hats:hat/accessories/ninja_headband \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/accessories/snorkel_mask_blue.mcfunction b/datapack/data/hats/functions/fix_hat/accessories/snorkel_mask_blue.mcfunction deleted file mode 100644 index 96827a0..0000000 --- a/datapack/data/hats/functions/fix_hat/accessories/snorkel_mask_blue.mcfunction +++ /dev/null @@ -1,3 +0,0 @@ -# as: Player, descr: Replace #hat item with equivalent #hat_on_head item -clear @s minecraft:stick{CustomModelData:3153, Tags:["is_hat"]} 1 -execute as @s run loot give @s loot hats:hat/accessories/snorkel_mask_blue \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/accessories/snorkel_mask_red.mcfunction b/datapack/data/hats/functions/fix_hat/accessories/snorkel_mask_red.mcfunction deleted file mode 100644 index a34b386..0000000 --- a/datapack/data/hats/functions/fix_hat/accessories/snorkel_mask_red.mcfunction +++ /dev/null @@ -1,3 +0,0 @@ -# as: Player, descr: Replace #hat item with equivalent #hat_on_head item -clear @s minecraft:stick{CustomModelData:3154, Tags:["is_hat"]} 1 -execute as @s run loot give @s loot hats:hat/accessories/snorkel_mask_red \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/accessories/steve_mask.mcfunction b/datapack/data/hats/functions/fix_hat/accessories/steve_mask.mcfunction deleted file mode 100644 index c2625d7..0000000 --- a/datapack/data/hats/functions/fix_hat/accessories/steve_mask.mcfunction +++ /dev/null @@ -1,3 +0,0 @@ -# as: Player, descr: Replace #hat item with equivalent #hat_on_head item -clear @s minecraft:stick{CustomModelData:3151, Tags:["is_hat"]} 1 -execute as @s run loot give @s loot hats:hat/accessories/steve_mask \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/arrow.mcfunction b/datapack/data/hats/functions/fix_hat/arrow.mcfunction deleted file mode 100644 index 590377d..0000000 --- a/datapack/data/hats/functions/fix_hat/arrow.mcfunction +++ /dev/null @@ -1,3 +0,0 @@ -# as: Player, descr: Replace #hat item with equivalent #hat_on_head item -clear @s minecraft:stick{CustomModelData:3002, Tags:["is_hat"]} 1 -execute as @s run loot give @s loot hats:hat/arrow \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/cats/black.mcfunction b/datapack/data/hats/functions/fix_hat/cats/black.mcfunction deleted file mode 100644 index 02f540b..0000000 --- a/datapack/data/hats/functions/fix_hat/cats/black.mcfunction +++ /dev/null @@ -1,3 +0,0 @@ -# as: Player, descr: Replace #hat item with equivalent #hat_on_head item -clear @s minecraft:stick{CustomModelData:3131, Tags:["is_hat"]} 1 -execute as @s run loot give @s loot hats:hat/cats/black \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/cats/british_shorthair.mcfunction b/datapack/data/hats/functions/fix_hat/cats/british_shorthair.mcfunction deleted file mode 100644 index d94eddf..0000000 --- a/datapack/data/hats/functions/fix_hat/cats/british_shorthair.mcfunction +++ /dev/null @@ -1,3 +0,0 @@ -# as: Player, descr: Replace #hat item with equivalent #hat_on_head item -clear @s minecraft:stick{CustomModelData:3125, Tags:["is_hat"]} 1 -execute as @s run loot give @s loot hats:hat/cats/british_shorthair \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/cats/calico.mcfunction b/datapack/data/hats/functions/fix_hat/cats/calico.mcfunction deleted file mode 100644 index f3f36f4..0000000 --- a/datapack/data/hats/functions/fix_hat/cats/calico.mcfunction +++ /dev/null @@ -1,3 +0,0 @@ -# as: Player, descr: Replace #hat item with equivalent #hat_on_head item -clear @s minecraft:stick{CustomModelData:3126, Tags:["is_hat"]} 1 -execute as @s run loot give @s loot hats:hat/cats/calico \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/cats/jellie.mcfunction b/datapack/data/hats/functions/fix_hat/cats/jellie.mcfunction deleted file mode 100644 index 846351c..0000000 --- a/datapack/data/hats/functions/fix_hat/cats/jellie.mcfunction +++ /dev/null @@ -1,3 +0,0 @@ -# as: Player, descr: Replace #hat item with equivalent #hat_on_head item -clear @s minecraft:stick{CustomModelData:3130, Tags:["is_hat"]} 1 -execute as @s run loot give @s loot hats:hat/cats/jellie \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/cats/ocelot.mcfunction b/datapack/data/hats/functions/fix_hat/cats/ocelot.mcfunction deleted file mode 100644 index 6496cc9..0000000 --- a/datapack/data/hats/functions/fix_hat/cats/ocelot.mcfunction +++ /dev/null @@ -1,3 +0,0 @@ -# as: Player, descr: Replace #hat item with equivalent #hat_on_head item -clear @s minecraft:stick{CustomModelData:3120, Tags:["is_hat"]} 1 -execute as @s run loot give @s loot hats:hat/cats/ocelot \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/cats/persian.mcfunction b/datapack/data/hats/functions/fix_hat/cats/persian.mcfunction deleted file mode 100644 index a787efc..0000000 --- a/datapack/data/hats/functions/fix_hat/cats/persian.mcfunction +++ /dev/null @@ -1,3 +0,0 @@ -# as: Player, descr: Replace #hat item with equivalent #hat_on_head item -clear @s minecraft:stick{CustomModelData:3127, Tags:["is_hat"]} 1 -execute as @s run loot give @s loot hats:hat/cats/persian \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/cats/ragdoll.mcfunction b/datapack/data/hats/functions/fix_hat/cats/ragdoll.mcfunction deleted file mode 100644 index 80e3e65..0000000 --- a/datapack/data/hats/functions/fix_hat/cats/ragdoll.mcfunction +++ /dev/null @@ -1,3 +0,0 @@ -# as: Player, descr: Replace #hat item with equivalent #hat_on_head item -clear @s minecraft:stick{CustomModelData:3128, Tags:["is_hat"]} 1 -execute as @s run loot give @s loot hats:hat/cats/ragdoll \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/cats/red.mcfunction b/datapack/data/hats/functions/fix_hat/cats/red.mcfunction deleted file mode 100644 index d21b970..0000000 --- a/datapack/data/hats/functions/fix_hat/cats/red.mcfunction +++ /dev/null @@ -1,3 +0,0 @@ -# as: Player, descr: Replace #hat item with equivalent #hat_on_head item -clear @s minecraft:stick{CustomModelData:3123, Tags:["is_hat"]} 1 -execute as @s run loot give @s loot hats:hat/cats/red \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/cats/siamese.mcfunction b/datapack/data/hats/functions/fix_hat/cats/siamese.mcfunction deleted file mode 100644 index 8768e65..0000000 --- a/datapack/data/hats/functions/fix_hat/cats/siamese.mcfunction +++ /dev/null @@ -1,3 +0,0 @@ -# as: Player, descr: Replace #hat item with equivalent #hat_on_head item -clear @s minecraft:stick{CustomModelData:3124, Tags:["is_hat"]} 1 -execute as @s run loot give @s loot hats:hat/cats/siamese \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/cats/tabby.mcfunction b/datapack/data/hats/functions/fix_hat/cats/tabby.mcfunction deleted file mode 100644 index 3c255e2..0000000 --- a/datapack/data/hats/functions/fix_hat/cats/tabby.mcfunction +++ /dev/null @@ -1,3 +0,0 @@ -# as: Player, descr: Replace #hat item with equivalent #hat_on_head item -clear @s minecraft:stick{CustomModelData:3121, Tags:["is_hat"]} 1 -execute as @s run loot give @s loot hats:hat/cats/tabby \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/cats/tuxedo.mcfunction b/datapack/data/hats/functions/fix_hat/cats/tuxedo.mcfunction deleted file mode 100644 index b49677b..0000000 --- a/datapack/data/hats/functions/fix_hat/cats/tuxedo.mcfunction +++ /dev/null @@ -1,3 +0,0 @@ -# as: Player, descr: Replace #hat item with equivalent #hat_on_head item -clear @s minecraft:stick{CustomModelData:3122, Tags:["is_hat"]} 1 -execute as @s run loot give @s loot hats:hat/cats/tuxedo \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/cats/white.mcfunction b/datapack/data/hats/functions/fix_hat/cats/white.mcfunction deleted file mode 100644 index 19c9c64..0000000 --- a/datapack/data/hats/functions/fix_hat/cats/white.mcfunction +++ /dev/null @@ -1,3 +0,0 @@ -# as: Player, descr: Replace #hat item with equivalent #hat_on_head item -clear @s minecraft:stick{CustomModelData:3129, Tags:["is_hat"]} 1 -execute as @s run loot give @s loot hats:hat/cats/white \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/fez.mcfunction b/datapack/data/hats/functions/fix_hat/fez.mcfunction deleted file mode 100644 index 05b65c1..0000000 --- a/datapack/data/hats/functions/fix_hat/fez.mcfunction +++ /dev/null @@ -1,3 +0,0 @@ -# as: Player, descr: Replace #hat item with equivalent #hat_on_head item -clear @s minecraft:stick{CustomModelData:3000, Tags:["is_hat"]} 1 -execute as @s run loot give @s loot hats:hat/fez \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/frying_pan.mcfunction b/datapack/data/hats/functions/fix_hat/frying_pan.mcfunction deleted file mode 100644 index a66f1e2..0000000 --- a/datapack/data/hats/functions/fix_hat/frying_pan.mcfunction +++ /dev/null @@ -1,3 +0,0 @@ -# as: Player, descr: Replace #hat item with equivalent #hat_on_head item -clear @s minecraft:stick{CustomModelData:3003, Tags:["is_hat"]} 1 -execute as @s run loot give @s loot hats:hat/frying_pan \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/glasses/half_rim.mcfunction b/datapack/data/hats/functions/fix_hat/glasses/half_rim.mcfunction deleted file mode 100644 index 94ea5b8..0000000 --- a/datapack/data/hats/functions/fix_hat/glasses/half_rim.mcfunction +++ /dev/null @@ -1,3 +0,0 @@ -# as: Player, descr: Replace #hat item with equivalent #hat_on_head item -clear @s minecraft:stick{CustomModelData:3142, Tags:["is_hat"]} 1 -execute as @s run loot give @s loot hats:hat/glasses/half_rim \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/glasses/harry_potter.mcfunction b/datapack/data/hats/functions/fix_hat/glasses/harry_potter.mcfunction deleted file mode 100644 index b265ad4..0000000 --- a/datapack/data/hats/functions/fix_hat/glasses/harry_potter.mcfunction +++ /dev/null @@ -1,3 +0,0 @@ -# as: Player, descr: Replace #hat item with equivalent #hat_on_head item -clear @s minecraft:stick{CustomModelData:3141, Tags:["is_hat"]} 1 -execute as @s run loot give @s loot hats:hat/glasses/harry_potter \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/glasses/librarian.mcfunction b/datapack/data/hats/functions/fix_hat/glasses/librarian.mcfunction deleted file mode 100644 index fea1e3c..0000000 --- a/datapack/data/hats/functions/fix_hat/glasses/librarian.mcfunction +++ /dev/null @@ -1,3 +0,0 @@ -# as: Player, descr: Replace #hat item with equivalent #hat_on_head item -clear @s minecraft:stick{CustomModelData:3144, Tags:["is_hat"]} 1 -execute as @s run loot give @s loot hats:hat/glasses/librarian \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/glasses/rainbow.mcfunction b/datapack/data/hats/functions/fix_hat/glasses/rainbow.mcfunction deleted file mode 100644 index d9ba8c7..0000000 --- a/datapack/data/hats/functions/fix_hat/glasses/rainbow.mcfunction +++ /dev/null @@ -1,3 +0,0 @@ -# as: Player, descr: Replace #hat item with equivalent #hat_on_head item -clear @s minecraft:stick{CustomModelData:3143, Tags:["is_hat"]} 1 -execute as @s run loot give @s loot hats:hat/glasses/rainbow \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/glasses/sunglasses.mcfunction b/datapack/data/hats/functions/fix_hat/glasses/sunglasses.mcfunction deleted file mode 100644 index 83b07de..0000000 --- a/datapack/data/hats/functions/fix_hat/glasses/sunglasses.mcfunction +++ /dev/null @@ -1,3 +0,0 @@ -# as: Player, descr: Replace #hat item with equivalent #hat_on_head item -clear @s minecraft:stick{CustomModelData:3140, Tags:["is_hat"]} 1 -execute as @s run loot give @s loot hats:hat/glasses/sunglasses \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/glasses/three_d.mcfunction b/datapack/data/hats/functions/fix_hat/glasses/three_d.mcfunction deleted file mode 100644 index c912bcc..0000000 --- a/datapack/data/hats/functions/fix_hat/glasses/three_d.mcfunction +++ /dev/null @@ -1,3 +0,0 @@ -# as: Player, descr: Replace #hat item with equivalent #hat_on_head item -clear @s minecraft:stick{CustomModelData:3145, Tags:["is_hat"]} 1 -execute as @s run loot give @s loot hats:hat/glasses/three_d \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/halloween/jason_mask.mcfunction b/datapack/data/hats/functions/fix_hat/halloween/jason_mask.mcfunction deleted file mode 100644 index 727b31e..0000000 --- a/datapack/data/hats/functions/fix_hat/halloween/jason_mask.mcfunction +++ /dev/null @@ -1,3 +0,0 @@ -# as: Player, descr: Replace #hat item with equivalent #hat_on_head item -clear @s minecraft:stick{CustomModelData:7773182, Tags:["is_hat"]} 1 -execute as @s run loot give @s loot hats:hat/halloween/jason_mask \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/halloween/native_american_headband.mcfunction b/datapack/data/hats/functions/fix_hat/halloween/native_american_headband.mcfunction deleted file mode 100644 index 91687d6..0000000 --- a/datapack/data/hats/functions/fix_hat/halloween/native_american_headband.mcfunction +++ /dev/null @@ -1,3 +0,0 @@ -# as: Player, descr: Replace #hat item with equivalent #hat_on_head item -clear @s minecraft:stick{CustomModelData:7773181, Tags:["is_hat"]} 1 -execute as @s run loot give @s loot hats:hat/halloween/native_american_headband \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/halloween/wiggly_ghast.mcfunction b/datapack/data/hats/functions/fix_hat/halloween/wiggly_ghast.mcfunction deleted file mode 100644 index 4142f54..0000000 --- a/datapack/data/hats/functions/fix_hat/halloween/wiggly_ghast.mcfunction +++ /dev/null @@ -1,3 +0,0 @@ -# as: Player, descr: Replace #hat item with equivalent #hat_on_head item -clear @s minecraft:stick{CustomModelData:7773180, Tags:["is_hat"]} 1 -execute as @s run loot give @s loot hats:hat/halloween/wiggly_ghast \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/mario/cappy.mcfunction b/datapack/data/hats/functions/fix_hat/mario/cappy.mcfunction deleted file mode 100644 index 090dc68..0000000 --- a/datapack/data/hats/functions/fix_hat/mario/cappy.mcfunction +++ /dev/null @@ -1,3 +0,0 @@ -# as: Player, descr: Replace #hat item with equivalent #hat_on_head item -clear @s minecraft:stick{CustomModelData:3172, Tags:["is_hat"]} 1 -execute as @s run loot give @s loot hats:hat/mario/cappy \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/mario/luigi.mcfunction b/datapack/data/hats/functions/fix_hat/mario/luigi.mcfunction deleted file mode 100644 index 9c91bbf..0000000 --- a/datapack/data/hats/functions/fix_hat/mario/luigi.mcfunction +++ /dev/null @@ -1,3 +0,0 @@ -# as: Player, descr: Replace #hat item with equivalent #hat_on_head item -clear @s minecraft:stick{CustomModelData:3178, Tags:["is_hat"]} 1 -execute as @s run loot give @s loot hats:hat/mario/luigi \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/mario/luigi_cap.mcfunction b/datapack/data/hats/functions/fix_hat/mario/luigi_cap.mcfunction deleted file mode 100644 index faeba73..0000000 --- a/datapack/data/hats/functions/fix_hat/mario/luigi_cap.mcfunction +++ /dev/null @@ -1,3 +0,0 @@ -# as: Player, descr: Replace #hat item with equivalent #hat_on_head item -clear @s minecraft:stick{CustomModelData:3171, Tags:["is_hat"]} 1 -execute as @s run loot give @s loot hats:hat/mario/luigi_cap \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/mario/mario.mcfunction b/datapack/data/hats/functions/fix_hat/mario/mario.mcfunction deleted file mode 100644 index 1fa63f2..0000000 --- a/datapack/data/hats/functions/fix_hat/mario/mario.mcfunction +++ /dev/null @@ -1,3 +0,0 @@ -# as: Player, descr: Replace #hat item with equivalent #hat_on_head item -clear @s minecraft:stick{CustomModelData:3177, Tags:["is_hat"]} 1 -execute as @s run loot give @s loot hats:hat/mario/mario \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/mario/mario_cap.mcfunction b/datapack/data/hats/functions/fix_hat/mario/mario_cap.mcfunction deleted file mode 100644 index bb3f5f0..0000000 --- a/datapack/data/hats/functions/fix_hat/mario/mario_cap.mcfunction +++ /dev/null @@ -1,3 +0,0 @@ -# as: Player, descr: Replace #hat item with equivalent #hat_on_head item -clear @s minecraft:stick{CustomModelData:3170, Tags:["is_hat"]} 1 -execute as @s run loot give @s loot hats:hat/mario/mario_cap \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/mario/toad_blue.mcfunction b/datapack/data/hats/functions/fix_hat/mario/toad_blue.mcfunction deleted file mode 100644 index 5e7b304..0000000 --- a/datapack/data/hats/functions/fix_hat/mario/toad_blue.mcfunction +++ /dev/null @@ -1,3 +0,0 @@ -# as: Player, descr: Replace #hat item with equivalent #hat_on_head item -clear @s minecraft:stick{CustomModelData:3174, Tags:["is_hat"]} 1 -execute as @s run loot give @s loot hats:hat/mario/toad_blue \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/mario/toad_green.mcfunction b/datapack/data/hats/functions/fix_hat/mario/toad_green.mcfunction deleted file mode 100644 index bf5780b..0000000 --- a/datapack/data/hats/functions/fix_hat/mario/toad_green.mcfunction +++ /dev/null @@ -1,3 +0,0 @@ -# as: Player, descr: Replace #hat item with equivalent #hat_on_head item -clear @s minecraft:stick{CustomModelData:3176, Tags:["is_hat"]} 1 -execute as @s run loot give @s loot hats:hat/mario/toad_green \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/mario/toad_red.mcfunction b/datapack/data/hats/functions/fix_hat/mario/toad_red.mcfunction deleted file mode 100644 index 2ad6d71..0000000 --- a/datapack/data/hats/functions/fix_hat/mario/toad_red.mcfunction +++ /dev/null @@ -1,3 +0,0 @@ -# as: Player, descr: Replace #hat item with equivalent #hat_on_head item -clear @s minecraft:stick{CustomModelData:3173, Tags:["is_hat"]} 1 -execute as @s run loot give @s loot hats:hat/mario/toad_red \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/mario/toad_yellow.mcfunction b/datapack/data/hats/functions/fix_hat/mario/toad_yellow.mcfunction deleted file mode 100644 index 2bd2553..0000000 --- a/datapack/data/hats/functions/fix_hat/mario/toad_yellow.mcfunction +++ /dev/null @@ -1,3 +0,0 @@ -# as: Player, descr: Replace #hat item with equivalent #hat_on_head item -clear @s minecraft:stick{CustomModelData:3175, Tags:["is_hat"]} 1 -execute as @s run loot give @s loot hats:hat/mario/toad_yellow \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/squid.mcfunction b/datapack/data/hats/functions/fix_hat/squid.mcfunction deleted file mode 100644 index ba5cdec..0000000 --- a/datapack/data/hats/functions/fix_hat/squid.mcfunction +++ /dev/null @@ -1,3 +0,0 @@ -# as: Player, descr: Replace #hat item with equivalent #hat_on_head item -clear @s minecraft:stick{CustomModelData:3001, Tags:["is_hat"]} 1 -execute as @s run loot give @s loot hats:hat/squid \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/tophats/black.mcfunction b/datapack/data/hats/functions/fix_hat/tophats/black.mcfunction deleted file mode 100644 index e6098ef..0000000 --- a/datapack/data/hats/functions/fix_hat/tophats/black.mcfunction +++ /dev/null @@ -1,3 +0,0 @@ -# as: Player, descr: Replace #hat item with equivalent #hat_on_head item -clear @s minecraft:stick{CustomModelData:3115, Tags:["is_hat"]} 1 -execute as @s run loot give @s loot hats:hat/tophats/black \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/tophats/black_monocle.mcfunction b/datapack/data/hats/functions/fix_hat/tophats/black_monocle.mcfunction deleted file mode 100644 index 7795eb3..0000000 --- a/datapack/data/hats/functions/fix_hat/tophats/black_monocle.mcfunction +++ /dev/null @@ -1,3 +0,0 @@ -# as: Player, descr: Replace #hat item with equivalent #hat_on_head item -clear @s minecraft:stick{CustomModelData:3117, Tags:["is_hat"]} 1 -execute as @s run loot give @s loot hats:hat/tophats/black_monocle \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/tophats/blue.mcfunction b/datapack/data/hats/functions/fix_hat/tophats/blue.mcfunction deleted file mode 100644 index 6bf0264..0000000 --- a/datapack/data/hats/functions/fix_hat/tophats/blue.mcfunction +++ /dev/null @@ -1,3 +0,0 @@ -# as: Player, descr: Replace #hat item with equivalent #hat_on_head item -clear @s minecraft:stick{CustomModelData:3111, Tags:["is_hat"]} 1 -execute as @s run loot give @s loot hats:hat/tophats/blue \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/tophats/brown.mcfunction b/datapack/data/hats/functions/fix_hat/tophats/brown.mcfunction deleted file mode 100644 index aede68c..0000000 --- a/datapack/data/hats/functions/fix_hat/tophats/brown.mcfunction +++ /dev/null @@ -1,3 +0,0 @@ -# as: Player, descr: Replace #hat item with equivalent #hat_on_head item -clear @s minecraft:stick{CustomModelData:3112, Tags:["is_hat"]} 1 -execute as @s run loot give @s loot hats:hat/tophats/brown \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/tophats/cyan.mcfunction b/datapack/data/hats/functions/fix_hat/tophats/cyan.mcfunction deleted file mode 100644 index 83643de..0000000 --- a/datapack/data/hats/functions/fix_hat/tophats/cyan.mcfunction +++ /dev/null @@ -1,3 +0,0 @@ -# as: Player, descr: Replace #hat item with equivalent #hat_on_head item -clear @s minecraft:stick{CustomModelData:3109, Tags:["is_hat"]} 1 -execute as @s run loot give @s loot hats:hat/tophats/cyan \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/tophats/gray.mcfunction b/datapack/data/hats/functions/fix_hat/tophats/gray.mcfunction deleted file mode 100644 index fe79337..0000000 --- a/datapack/data/hats/functions/fix_hat/tophats/gray.mcfunction +++ /dev/null @@ -1,3 +0,0 @@ -# as: Player, descr: Replace #hat item with equivalent #hat_on_head item -clear @s minecraft:stick{CustomModelData:3107, Tags:["is_hat"]} 1 -execute as @s run loot give @s loot hats:hat/tophats/gray \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/tophats/green.mcfunction b/datapack/data/hats/functions/fix_hat/tophats/green.mcfunction deleted file mode 100644 index b9275a4..0000000 --- a/datapack/data/hats/functions/fix_hat/tophats/green.mcfunction +++ /dev/null @@ -1,3 +0,0 @@ -# as: Player, descr: Replace #hat item with equivalent #hat_on_head item -clear @s minecraft:stick{CustomModelData:3113, Tags:["is_hat"]} 1 -execute as @s run loot give @s loot hats:hat/tophats/green \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/tophats/light_blue.mcfunction b/datapack/data/hats/functions/fix_hat/tophats/light_blue.mcfunction deleted file mode 100644 index 0a861fc..0000000 --- a/datapack/data/hats/functions/fix_hat/tophats/light_blue.mcfunction +++ /dev/null @@ -1,3 +0,0 @@ -# as: Player, descr: Replace #hat item with equivalent #hat_on_head item -clear @s minecraft:stick{CustomModelData:3103, Tags:["is_hat"]} 1 -execute as @s run loot give @s loot hats:hat/tophats/light_blue \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/tophats/light_gray.mcfunction b/datapack/data/hats/functions/fix_hat/tophats/light_gray.mcfunction deleted file mode 100644 index 58975e6..0000000 --- a/datapack/data/hats/functions/fix_hat/tophats/light_gray.mcfunction +++ /dev/null @@ -1,3 +0,0 @@ -# as: Player, descr: Replace #hat item with equivalent #hat_on_head item -clear @s minecraft:stick{CustomModelData:3108, Tags:["is_hat"]} 1 -execute as @s run loot give @s loot hats:hat/tophats/light_gray \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/tophats/lime.mcfunction b/datapack/data/hats/functions/fix_hat/tophats/lime.mcfunction deleted file mode 100644 index b6e546b..0000000 --- a/datapack/data/hats/functions/fix_hat/tophats/lime.mcfunction +++ /dev/null @@ -1,3 +0,0 @@ -# as: Player, descr: Replace #hat item with equivalent #hat_on_head item -clear @s minecraft:stick{CustomModelData:3105, Tags:["is_hat"]} 1 -execute as @s run loot give @s loot hats:hat/tophats/lime \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/tophats/magenta.mcfunction b/datapack/data/hats/functions/fix_hat/tophats/magenta.mcfunction deleted file mode 100644 index c5beabc..0000000 --- a/datapack/data/hats/functions/fix_hat/tophats/magenta.mcfunction +++ /dev/null @@ -1,3 +0,0 @@ -# as: Player, descr: Replace #hat item with equivalent #hat_on_head item -clear @s minecraft:stick{CustomModelData:3102, Tags:["is_hat"]} 1 -execute as @s run loot give @s loot hats:hat/tophats/magenta \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/tophats/orange.mcfunction b/datapack/data/hats/functions/fix_hat/tophats/orange.mcfunction deleted file mode 100644 index 0261f3d..0000000 --- a/datapack/data/hats/functions/fix_hat/tophats/orange.mcfunction +++ /dev/null @@ -1,3 +0,0 @@ -# as: Player, descr: Replace #hat item with equivalent #hat_on_head item -clear @s minecraft:stick{CustomModelData:3101, Tags:["is_hat"]} 1 -execute as @s run loot give @s loot hats:hat/tophats/orange \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/tophats/pink.mcfunction b/datapack/data/hats/functions/fix_hat/tophats/pink.mcfunction deleted file mode 100644 index 0cf199b..0000000 --- a/datapack/data/hats/functions/fix_hat/tophats/pink.mcfunction +++ /dev/null @@ -1,3 +0,0 @@ -# as: Player, descr: Replace #hat item with equivalent #hat_on_head item -clear @s minecraft:stick{CustomModelData:3106, Tags:["is_hat"]} 1 -execute as @s run loot give @s loot hats:hat/tophats/pink \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/tophats/purple.mcfunction b/datapack/data/hats/functions/fix_hat/tophats/purple.mcfunction deleted file mode 100644 index 40960a9..0000000 --- a/datapack/data/hats/functions/fix_hat/tophats/purple.mcfunction +++ /dev/null @@ -1,3 +0,0 @@ -# as: Player, descr: Replace #hat item with equivalent #hat_on_head item -clear @s minecraft:stick{CustomModelData:3110, Tags:["is_hat"]} 1 -execute as @s run loot give @s loot hats:hat/tophats/purple \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/tophats/rainbow.mcfunction b/datapack/data/hats/functions/fix_hat/tophats/rainbow.mcfunction deleted file mode 100644 index 56c9c8e..0000000 --- a/datapack/data/hats/functions/fix_hat/tophats/rainbow.mcfunction +++ /dev/null @@ -1,3 +0,0 @@ -# as: Player, descr: Replace #hat item with equivalent #hat_on_head item -clear @s minecraft:stick{CustomModelData:3116, Tags:["is_hat"]} 1 -execute as @s run loot give @s loot hats:hat/tophats/rainbow \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/tophats/red.mcfunction b/datapack/data/hats/functions/fix_hat/tophats/red.mcfunction deleted file mode 100644 index 8e66d43..0000000 --- a/datapack/data/hats/functions/fix_hat/tophats/red.mcfunction +++ /dev/null @@ -1,3 +0,0 @@ -# as: Player, descr: Replace #hat item with equivalent #hat_on_head item -clear @s minecraft:stick{CustomModelData:3114, Tags:["is_hat"]} 1 -execute as @s run loot give @s loot hats:hat/tophats/red \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/tophats/white.mcfunction b/datapack/data/hats/functions/fix_hat/tophats/white.mcfunction deleted file mode 100644 index a9d90ce..0000000 --- a/datapack/data/hats/functions/fix_hat/tophats/white.mcfunction +++ /dev/null @@ -1,3 +0,0 @@ -# as: Player, descr: Replace #hat item with equivalent #hat_on_head item -clear @s minecraft:stick{CustomModelData:3100, Tags:["is_hat"]} 1 -execute as @s run loot give @s loot hats:hat/tophats/white \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/tophats/yellow.mcfunction b/datapack/data/hats/functions/fix_hat/tophats/yellow.mcfunction deleted file mode 100644 index 225549b..0000000 --- a/datapack/data/hats/functions/fix_hat/tophats/yellow.mcfunction +++ /dev/null @@ -1,3 +0,0 @@ -# as: Player, descr: Replace #hat item with equivalent #hat_on_head item -clear @s minecraft:stick{CustomModelData:3104, Tags:["is_hat"]} 1 -execute as @s run loot give @s loot hats:hat/tophats/yellow \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/villager/armorer.mcfunction b/datapack/data/hats/functions/fix_hat/villager/armorer.mcfunction deleted file mode 100644 index 21bb4e5..0000000 --- a/datapack/data/hats/functions/fix_hat/villager/armorer.mcfunction +++ /dev/null @@ -1,3 +0,0 @@ -# as: Player, descr: Replace #hat item with equivalent #hat_on_head item -clear @s minecraft:stick{CustomModelData:3160, Tags:["is_hat"]} 1 -execute as @s run loot give @s loot hats:hat/villager/armorer \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/villager/farmer.mcfunction b/datapack/data/hats/functions/fix_hat/villager/farmer.mcfunction deleted file mode 100644 index 0e78ce0..0000000 --- a/datapack/data/hats/functions/fix_hat/villager/farmer.mcfunction +++ /dev/null @@ -1,3 +0,0 @@ -# as: Player, descr: Replace #hat item with equivalent #hat_on_head item -clear @s minecraft:stick{CustomModelData:3161, Tags:["is_hat"]} 1 -execute as @s run loot give @s loot hats:hat/villager/farmer \ No newline at end of file diff --git a/datapack/data/hats/functions/fix_hat/villager/nose.mcfunction b/datapack/data/hats/functions/fix_hat/villager/nose.mcfunction deleted file mode 100644 index 350099c..0000000 --- a/datapack/data/hats/functions/fix_hat/villager/nose.mcfunction +++ /dev/null @@ -1,3 +0,0 @@ -# as: Player, descr: Replace #hat item with equivalent #hat_on_head item -clear @s minecraft:stick{CustomModelData:3162, Tags:["is_hat"]} 1 -execute as @s run loot give @s loot hats:hat/villager/nose \ No newline at end of file diff --git a/datapack/data/hats/functions/hat_behavior/fix_hat_from_head.mcfunction b/datapack/data/hats/functions/hat_behavior/fix_hat_from_head.mcfunction deleted file mode 100644 index bda4fad..0000000 --- a/datapack/data/hats/functions/hat_behavior/fix_hat_from_head.mcfunction +++ /dev/null @@ -1,65 +0,0 @@ -# as: Player -# descr: When a Player takes of their hat, they have #hat_on_head item in their inventory. -# Replace that item with an equivalent #hat item - -execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3000}}]}] run function hats:fix_hat/fez -execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3001}}]}] run function hats:fix_hat/squid -execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3002}}]}] run function hats:fix_hat/arrow -execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3003}}]}] run function hats:fix_hat/frying_pan -execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3100}}]}] run function hats:fix_hat/tophats/white -execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3101}}]}] run function hats:fix_hat/tophats/orange -execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3102}}]}] run function hats:fix_hat/tophats/magenta -execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3103}}]}] run function hats:fix_hat/tophats/light_blue -execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3104}}]}] run function hats:fix_hat/tophats/yellow -execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3105}}]}] run function hats:fix_hat/tophats/lime -execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3106}}]}] run function hats:fix_hat/tophats/pink -execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3107}}]}] run function hats:fix_hat/tophats/gray -execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3108}}]}] run function hats:fix_hat/tophats/light_gray -execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3109}}]}] run function hats:fix_hat/tophats/cyan -execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3110}}]}] run function hats:fix_hat/tophats/purple -execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3111}}]}] run function hats:fix_hat/tophats/blue -execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3112}}]}] run function hats:fix_hat/tophats/brown -execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3113}}]}] run function hats:fix_hat/tophats/green -execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3114}}]}] run function hats:fix_hat/tophats/red -execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3115}}]}] run function hats:fix_hat/tophats/black -execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3116}}]}] run function hats:fix_hat/tophats/rainbow -execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3117}}]}] run function hats:fix_hat/tophats/black_monocle -execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3120}}]}] run function hats:fix_hat/cats/ocelot -execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3121}}]}] run function hats:fix_hat/cats/tabby -execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3122}}]}] run function hats:fix_hat/cats/tuxedo -execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3123}}]}] run function hats:fix_hat/cats/red -execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3124}}]}] run function hats:fix_hat/cats/siamese -execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3125}}]}] run function hats:fix_hat/cats/british_shorthair -execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3126}}]}] run function hats:fix_hat/cats/calico -execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3127}}]}] run function hats:fix_hat/cats/persian -execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3128}}]}] run function hats:fix_hat/cats/ragdoll -execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3129}}]}] run function hats:fix_hat/cats/white -execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3130}}]}] run function hats:fix_hat/cats/jellie -execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3131}}]}] run function hats:fix_hat/cats/black -execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3140}}]}] run function hats:fix_hat/glasses/sunglasses -execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3141}}]}] run function hats:fix_hat/glasses/harry_potter -execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3142}}]}] run function hats:fix_hat/glasses/half_rim -execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3143}}]}] run function hats:fix_hat/glasses/rainbow -execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3144}}]}] run function hats:fix_hat/glasses/librarian -execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3145}}]}] run function hats:fix_hat/glasses/three_d -execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3150}}]}] run function hats:fix_hat/accessories/ninja_headband -execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3151}}]}] run function hats:fix_hat/accessories/steve_mask -execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3152}}]}] run function hats:fix_hat/accessories/alex_mask -execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3153}}]}] run function hats:fix_hat/accessories/snorkel_mask_blue -execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3154}}]}] run function hats:fix_hat/accessories/snorkel_mask_red -execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3155}}]}] run function hats:fix_hat/accessories/googly_eyes -execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3160}}]}] run function hats:fix_hat/villager/armorer -execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3161}}]}] run function hats:fix_hat/villager/farmer -execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3162}}]}] run function hats:fix_hat/villager/nose -execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3170}}]}] run function hats:fix_hat/mario/mario_cap -execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3171}}]}] run function hats:fix_hat/mario/luigi_cap -execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3172}}]}] run function hats:fix_hat/mario/cappy -execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3173}}]}] run function hats:fix_hat/mario/toad_red -execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3174}}]}] run function hats:fix_hat/mario/toad_blue -execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3175}}]}] run function hats:fix_hat/mario/toad_yellow -execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3176}}]}] run function hats:fix_hat/mario/toad_green -execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3177}}]}] run function hats:fix_hat/mario/mario -execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:3178}}]}] run function hats:fix_hat/mario/luigi -execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:7773180}}]}] run function hats:fix_hat/halloween/wiggly_ghast -execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:7773181}}]}] run function hats:fix_hat/halloween/native_american_headband -execute as @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"],CustomModelData:7773182}}]}] run function hats:fix_hat/halloween/jason_mask \ No newline at end of file diff --git a/datapack/data/hats/functions/hat_behavior/fix_stick_hats_in_players_inventory.mcfunction b/datapack/data/hats/functions/hat_behavior/fix_stick_hats_in_players_inventory.mcfunction new file mode 100644 index 0000000..1a88189 --- /dev/null +++ b/datapack/data/hats/functions/hat_behavior/fix_stick_hats_in_players_inventory.mcfunction @@ -0,0 +1,97 @@ +# as: Player +# descr: When a Player takes of their hat, they have #hat_on_head item in their inventory. +# Replace that item with an equivalent #hat item + +data modify storage hats buffer.all set from entity @s Inventory + +# Extract hotbar +data modify storage minecraft:hats buffer.hotbar append from storage minecraft:hats buffer.all[{Slot:0b}] +data modify storage minecraft:hats buffer.hotbar append from storage minecraft:hats buffer.all[{Slot:1b}] +data modify storage minecraft:hats buffer.hotbar append from storage minecraft:hats buffer.all[{Slot:2b}] +data modify storage minecraft:hats buffer.hotbar append from storage minecraft:hats buffer.all[{Slot:3b}] +data modify storage minecraft:hats buffer.hotbar append from storage minecraft:hats buffer.all[{Slot:4b}] +data modify storage minecraft:hats buffer.hotbar append from storage minecraft:hats buffer.all[{Slot:5b}] +data modify storage minecraft:hats buffer.hotbar append from storage minecraft:hats buffer.all[{Slot:6b}] +data modify storage minecraft:hats buffer.hotbar append from storage minecraft:hats buffer.all[{Slot:7b}] +data modify storage minecraft:hats buffer.hotbar append from storage minecraft:hats buffer.all[{Slot:8b}] + +# Replace all stick Hats with leather_helmet hats. +# If no stick Hat exists, the modify command will add an invalid item entry. Thats why the check is there. +execute if data storage minecraft:hats buffer.hotbar[{id:"minecraft:stick", tag:{Tags:["is_hat"]}}] run data modify storage minecraft:hats buffer.hotbar[{id:"minecraft:stick", tag:{Tags:["is_hat"]}}].id set value "minecraft:leather_helmet" + +# Replaced Players hotbar with modified hotbar +setblock ~ 0 ~ minecraft:yellow_shulker_box +data modify block ~ 0 ~ Items set from storage minecraft:hats buffer.hotbar +loot replace entity @s hotbar.0 9 mine ~ 0 ~ minecraft:diamond_pickaxe{drop_contents:1b} + +# Extract inventory +data remove storage minecraft:hats buffer.inventory + +data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:9b}] +data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:10b}] +data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:11b}] +data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:12b}] +data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:13b}] +data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:14b}] +data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:15b}] +data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:16b}] +data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:17b}] +data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:18b}] +data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:19b}] +data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:20b}] +data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:21b}] +data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:22b}] +data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:23b}] +data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:24b}] +data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:25b}] +data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:26b}] +data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:27b}] +data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:28b}] +data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:29b}] +data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:30b}] +data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:31b}] +data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:32b}] +data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:33b}] +data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:34b}] +data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:35b}] + +data modify storage minecraft:hats buffer.inventory[{Slot:9b}].Slot set value 0b +data modify storage minecraft:hats buffer.inventory[{Slot:10b}].Slot set value 1b +data modify storage minecraft:hats buffer.inventory[{Slot:11b}].Slot set value 2b +data modify storage minecraft:hats buffer.inventory[{Slot:12b}].Slot set value 3b +data modify storage minecraft:hats buffer.inventory[{Slot:13b}].Slot set value 4b +data modify storage minecraft:hats buffer.inventory[{Slot:14b}].Slot set value 5b +data modify storage minecraft:hats buffer.inventory[{Slot:15b}].Slot set value 6b +data modify storage minecraft:hats buffer.inventory[{Slot:16b}].Slot set value 7b +data modify storage minecraft:hats buffer.inventory[{Slot:17b}].Slot set value 8b +data modify storage minecraft:hats buffer.inventory[{Slot:18b}].Slot set value 9b +data modify storage minecraft:hats buffer.inventory[{Slot:19b}].Slot set value 10b +data modify storage minecraft:hats buffer.inventory[{Slot:20b}].Slot set value 11b +data modify storage minecraft:hats buffer.inventory[{Slot:21b}].Slot set value 12b +data modify storage minecraft:hats buffer.inventory[{Slot:22b}].Slot set value 13b +data modify storage minecraft:hats buffer.inventory[{Slot:23b}].Slot set value 14b +data modify storage minecraft:hats buffer.inventory[{Slot:24b}].Slot set value 15b +data modify storage minecraft:hats buffer.inventory[{Slot:25b}].Slot set value 16b +data modify storage minecraft:hats buffer.inventory[{Slot:26b}].Slot set value 17b +data modify storage minecraft:hats buffer.inventory[{Slot:27b}].Slot set value 18b +data modify storage minecraft:hats buffer.inventory[{Slot:28b}].Slot set value 19b +data modify storage minecraft:hats buffer.inventory[{Slot:29b}].Slot set value 20b +data modify storage minecraft:hats buffer.inventory[{Slot:30b}].Slot set value 21b +data modify storage minecraft:hats buffer.inventory[{Slot:31b}].Slot set value 22b +data modify storage minecraft:hats buffer.inventory[{Slot:32b}].Slot set value 23b +data modify storage minecraft:hats buffer.inventory[{Slot:33b}].Slot set value 24b +data modify storage minecraft:hats buffer.inventory[{Slot:34b}].Slot set value 25b +data modify storage minecraft:hats buffer.inventory[{Slot:35b}].Slot set value 26b + +# Replace all stick Hats with leather_helmet hats. +# If no stick Hat exists, the modify command will add an invalid item entry. Thats why the check is there. +execute if data storage minecraft:hats buffer.inventory[{id:"minecraft:stick", tag:{Tags:["is_hat"]}}] run data modify storage minecraft:hats buffer.inventory[{id:"minecraft:stick", tag:{Tags:["is_hat"]}}].id set value "minecraft:leather_helmet" + +# Replaced Players inventory with modified inventory +setblock ~ 0 ~ minecraft:yellow_shulker_box +data modify block ~ 0 ~ Items set from storage minecraft:hats buffer.inventory +loot replace entity @s inventory.0 27 mine ~ 0 ~ minecraft:diamond_pickaxe{drop_contents:1b} + +# Clean up +setblock ~ 0 ~ minecraft:air +data remove storage minecraft:hats buffer.hotbar \ No newline at end of file From 5163a36b09ba2b25b4650b31f5eeb7a9186c0196 Mon Sep 17 00:00:00 2001 From: OraneUtan Date: Fri, 22 May 2020 10:40:06 +0200 Subject: [PATCH 15/58] Stick hats fixes are now triggered by an advancement --- .../triggers/player_received_stick_hat.json | 34 +++++++++++++++++++ ...stick_hats_in_players_inventory.mcfunction | 1 + datapack/data/hats/functions/tick.mcfunction | 13 +------ .../player_received_stick_hat.mcfunction | 5 +++ 4 files changed, 41 insertions(+), 12 deletions(-) create mode 100644 datapack/data/hats/advancements/triggers/player_received_stick_hat.json create mode 100644 datapack/data/hats/functions/scheduled_calls/fix_stick_hats_in_players_inventory.mcfunction create mode 100644 datapack/data/hats/functions/triggers/player_received_stick_hat.mcfunction diff --git a/datapack/data/hats/advancements/triggers/player_received_stick_hat.json b/datapack/data/hats/advancements/triggers/player_received_stick_hat.json new file mode 100644 index 0000000..cbf6850 --- /dev/null +++ b/datapack/data/hats/advancements/triggers/player_received_stick_hat.json @@ -0,0 +1,34 @@ +{ + "parent" : "hats:root", + "display" : { + "icon": { + "item": "minecraft:air" + }, + "title" : { + "translate": "" + }, + "description" : { + "translate": "" + }, + "show_toast": false, + "announce_to_chat": false, + "hidden": true + }, + "criteria" : { + "player_received_stick_hat" : { + "trigger" : "minecraft:inventory_changed", + "conditions" : { + "items": [ + { + "item": "minecraft:stick", + "nbt": "{Tags:[\"is_hat\"]}" + } + ] + } + } + }, + "requirements" : [["player_received_stick_hat"]], + "rewards": { + "function": "hats:triggers/player_received_stick_hat" + } +} \ No newline at end of file diff --git a/datapack/data/hats/functions/scheduled_calls/fix_stick_hats_in_players_inventory.mcfunction b/datapack/data/hats/functions/scheduled_calls/fix_stick_hats_in_players_inventory.mcfunction new file mode 100644 index 0000000..293fc29 --- /dev/null +++ b/datapack/data/hats/functions/scheduled_calls/fix_stick_hats_in_players_inventory.mcfunction @@ -0,0 +1 @@ +execute as @a[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"]}}]}] run function hats:hat_behavior/fix_stick_hats_in_players_inventory \ No newline at end of file diff --git a/datapack/data/hats/functions/tick.mcfunction b/datapack/data/hats/functions/tick.mcfunction index a86db9a..cb4e0e4 100644 --- a/datapack/data/hats/functions/tick.mcfunction +++ b/datapack/data/hats/functions/tick.mcfunction @@ -10,15 +10,4 @@ #----------------------------------------------------------------------# # Replace helmet on armorstand -execute as @e[type=minecraft:armor_stand,nbt={ArmorItems:[{},{},{},{id:"minecraft:leather_helmet",tag:{Tags:["is_hat"]}}]}] run function hats:hat_behavior/equip_armorstand_with_correct_hat - -#----------------------------------------------------------------------------------# -# Fix Hats in Players Inventory: # -# Hats are items while they are on an entities head. # -# Thats why, when a player gets his hands on one of these # -# (taking hat off, taking one from an armostand, ...), they can't put it on again. # -# To fix this, replace the item-hat with a helmet-hat # -#----------------------------------------------------------------------------------# - -# Replace worn hats (#hat_on_head) with equivalent #hat item -execute as @a[nbt=!{Inventory:[{Slot:103b,id:"minecraft:stick",tag:{Tags:["is_hat"]}}]}, nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"]}}]}] run function hats:hat_behavior/fix_hat_from_head \ No newline at end of file +execute as @e[type=minecraft:armor_stand,nbt={ArmorItems:[{},{},{},{id:"minecraft:leather_helmet",tag:{Tags:["is_hat"]}}]}] run function hats:hat_behavior/equip_armorstand_with_correct_hat \ No newline at end of file diff --git a/datapack/data/hats/functions/triggers/player_received_stick_hat.mcfunction b/datapack/data/hats/functions/triggers/player_received_stick_hat.mcfunction new file mode 100644 index 0000000..d4c6d96 --- /dev/null +++ b/datapack/data/hats/functions/triggers/player_received_stick_hat.mcfunction @@ -0,0 +1,5 @@ +# Check if the hat is on the players hat. If so, schedule to fix it +execute if entity @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"]}}]}] run schedule function hats:scheduled_calls/fix_stick_hats_in_players_inventory 1t + +# Reset trigger +advancement revoke @s only hats:triggers/player_received_stick_hat \ No newline at end of file From bebeeca4bf6765c09f07e0cf77a83820adbf62a0 Mon Sep 17 00:00:00 2001 From: OraneUtan Date: Fri, 22 May 2020 10:43:02 +0200 Subject: [PATCH 16/58] Renamed "received_normal_hat" advancement and trigger --- ...ived_normal_hat.json => player_received_helmet_hat.json} | 6 +++--- ...hat.mcfunction => player_received_helmet_hat.mcfunction} | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) rename datapack/data/hats/advancements/triggers/{received_normal_hat.json => player_received_helmet_hat.json} (76%) rename datapack/data/hats/functions/triggers/{received_normal_hat.mcfunction => player_received_helmet_hat.mcfunction} (90%) diff --git a/datapack/data/hats/advancements/triggers/received_normal_hat.json b/datapack/data/hats/advancements/triggers/player_received_helmet_hat.json similarity index 76% rename from datapack/data/hats/advancements/triggers/received_normal_hat.json rename to datapack/data/hats/advancements/triggers/player_received_helmet_hat.json index aff9c54..8fd7183 100644 --- a/datapack/data/hats/advancements/triggers/received_normal_hat.json +++ b/datapack/data/hats/advancements/triggers/player_received_helmet_hat.json @@ -15,7 +15,7 @@ "hidden": true }, "criteria" : { - "received_normal_hat" : { + "player_received_helmet_hat" : { "trigger" : "minecraft:inventory_changed", "conditions" : { "items": [ @@ -27,8 +27,8 @@ } } }, - "requirements" : [["received_normal_hat"]], + "requirements" : [["player_received_helmet_hat"]], "rewards": { - "function": "hats:triggers/received_normal_hat" + "function": "hats:triggers/player_received_helmet_hat" } } \ No newline at end of file diff --git a/datapack/data/hats/functions/triggers/received_normal_hat.mcfunction b/datapack/data/hats/functions/triggers/player_received_helmet_hat.mcfunction similarity index 90% rename from datapack/data/hats/functions/triggers/received_normal_hat.mcfunction rename to datapack/data/hats/functions/triggers/player_received_helmet_hat.mcfunction index 628f99d..1a42812 100644 --- a/datapack/data/hats/functions/triggers/received_normal_hat.mcfunction +++ b/datapack/data/hats/functions/triggers/player_received_helmet_hat.mcfunction @@ -9,4 +9,4 @@ execute if entity @s[nbt={Inventory:[{Slot:103b,id:"minecraft:leather_helmet",tag:{Tags:["is_hat"]}}]}] run schedule function hats:triggers/scheduled_equip_player_with_correct_hat 1t # Reset trigger -advancement revoke @s only hats:triggers/received_normal_hat \ No newline at end of file +advancement revoke @s only hats:triggers/player_received_helmet_hat \ No newline at end of file From f0fe9fe1ed535f26cd95a06bd264bd9f818f7b25 Mon Sep 17 00:00:00 2001 From: OraneUtan Date: Fri, 22 May 2020 10:45:11 +0200 Subject: [PATCH 17/58] Moved all scheduled hat fixes into "scheduled_proxies" --- .../equip_player_with_correct_hat.mcfunction} | 0 .../fix_stick_hats_in_players_inventory.mcfunction | 0 .../functions/triggers/player_received_helmet_hat.mcfunction | 2 +- .../functions/triggers/player_received_stick_hat.mcfunction | 2 +- 4 files changed, 2 insertions(+), 2 deletions(-) rename datapack/data/hats/functions/{triggers/scheduled_equip_player_with_correct_hat.mcfunction => scheduled_proxies/equip_player_with_correct_hat.mcfunction} (100%) rename datapack/data/hats/functions/{scheduled_calls => scheduled_proxies}/fix_stick_hats_in_players_inventory.mcfunction (100%) diff --git a/datapack/data/hats/functions/triggers/scheduled_equip_player_with_correct_hat.mcfunction b/datapack/data/hats/functions/scheduled_proxies/equip_player_with_correct_hat.mcfunction similarity index 100% rename from datapack/data/hats/functions/triggers/scheduled_equip_player_with_correct_hat.mcfunction rename to datapack/data/hats/functions/scheduled_proxies/equip_player_with_correct_hat.mcfunction diff --git a/datapack/data/hats/functions/scheduled_calls/fix_stick_hats_in_players_inventory.mcfunction b/datapack/data/hats/functions/scheduled_proxies/fix_stick_hats_in_players_inventory.mcfunction similarity index 100% rename from datapack/data/hats/functions/scheduled_calls/fix_stick_hats_in_players_inventory.mcfunction rename to datapack/data/hats/functions/scheduled_proxies/fix_stick_hats_in_players_inventory.mcfunction diff --git a/datapack/data/hats/functions/triggers/player_received_helmet_hat.mcfunction b/datapack/data/hats/functions/triggers/player_received_helmet_hat.mcfunction index 1a42812..be51b7b 100644 --- a/datapack/data/hats/functions/triggers/player_received_helmet_hat.mcfunction +++ b/datapack/data/hats/functions/triggers/player_received_helmet_hat.mcfunction @@ -6,7 +6,7 @@ #################################################################### # Check if the hat is on the players hat. If so, schedule to fix it -execute if entity @s[nbt={Inventory:[{Slot:103b,id:"minecraft:leather_helmet",tag:{Tags:["is_hat"]}}]}] run schedule function hats:triggers/scheduled_equip_player_with_correct_hat 1t +execute if entity @s[nbt={Inventory:[{Slot:103b,id:"minecraft:leather_helmet",tag:{Tags:["is_hat"]}}]}] run schedule function hats:scheduled_proxies/equip_player_with_correct_hat 1t # Reset trigger advancement revoke @s only hats:triggers/player_received_helmet_hat \ No newline at end of file diff --git a/datapack/data/hats/functions/triggers/player_received_stick_hat.mcfunction b/datapack/data/hats/functions/triggers/player_received_stick_hat.mcfunction index d4c6d96..d98f581 100644 --- a/datapack/data/hats/functions/triggers/player_received_stick_hat.mcfunction +++ b/datapack/data/hats/functions/triggers/player_received_stick_hat.mcfunction @@ -1,5 +1,5 @@ # Check if the hat is on the players hat. If so, schedule to fix it -execute if entity @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"]}}]}] run schedule function hats:scheduled_calls/fix_stick_hats_in_players_inventory 1t +execute if entity @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"]}}]}] run schedule function hats:scheduled_proxies/fix_stick_hats_in_players_inventory 1t # Reset trigger advancement revoke @s only hats:triggers/player_received_stick_hat \ No newline at end of file From 0991f065ab3676c0f743c9a960276ca4ecee050e Mon Sep 17 00:00:00 2001 From: OraneUtan Date: Fri, 22 May 2020 11:18:17 +0200 Subject: [PATCH 18/58] Split fixing of stick hats into functions for hotbar and inventory --- ...ix_stick_hats_in_players_hotbar.mcfunction | 16 +++++ ...stick_hats_in_players_inventory.mcfunction | 70 +++---------------- .../fix_stick_hats_of_player.mcfunction | 53 ++++++++++++++ .../equip_player_with_correct_hat.mcfunction | 7 +- ...stick_hats_in_players_inventory.mcfunction | 1 - .../fix_stick_hats_of_player.mcfunction | 5 ++ .../player_received_stick_hat.mcfunction | 2 +- 7 files changed, 87 insertions(+), 67 deletions(-) create mode 100644 datapack/data/hats/functions/hat_behavior/fix_stick_hats_in_players_hotbar.mcfunction create mode 100644 datapack/data/hats/functions/hat_behavior/fix_stick_hats_of_player.mcfunction delete mode 100644 datapack/data/hats/functions/scheduled_proxies/fix_stick_hats_in_players_inventory.mcfunction create mode 100644 datapack/data/hats/functions/scheduled_proxies/fix_stick_hats_of_player.mcfunction diff --git a/datapack/data/hats/functions/hat_behavior/fix_stick_hats_in_players_hotbar.mcfunction b/datapack/data/hats/functions/hat_behavior/fix_stick_hats_in_players_hotbar.mcfunction new file mode 100644 index 0000000..ec400f3 --- /dev/null +++ b/datapack/data/hats/functions/hat_behavior/fix_stick_hats_in_players_hotbar.mcfunction @@ -0,0 +1,16 @@ +# executor: Player whos inventory is getting fixed +# descr: Fixes all stick hats in the Players hotbar slots +# requirements: +# - storage buffer.hotbar has to be populated +# - at least one stick hat has to exist in buffer.hotbar + +# Replace all stick hats with helmet hats +data modify storage minecraft:hats buffer.hotbar[{id:"minecraft:stick", tag:{Tags:["is_hat"]}}].id set value "minecraft:leather_helmet" + +# Replaced Players hotbar with modified hotbar +setblock ~ 0 ~ minecraft:yellow_shulker_box +data modify block ~ 0 ~ Items set from storage minecraft:hats buffer.hotbar +loot replace entity @s hotbar.0 9 mine ~ 0 ~ minecraft:diamond_pickaxe{drop_contents:1b} + +# Clean up +setblock ~ 0 ~ minecraft:air \ No newline at end of file diff --git a/datapack/data/hats/functions/hat_behavior/fix_stick_hats_in_players_inventory.mcfunction b/datapack/data/hats/functions/hat_behavior/fix_stick_hats_in_players_inventory.mcfunction index 1a88189..7cb4b8f 100644 --- a/datapack/data/hats/functions/hat_behavior/fix_stick_hats_in_players_inventory.mcfunction +++ b/datapack/data/hats/functions/hat_behavior/fix_stick_hats_in_players_inventory.mcfunction @@ -1,60 +1,10 @@ -# as: Player -# descr: When a Player takes of their hat, they have #hat_on_head item in their inventory. -# Replace that item with an equivalent #hat item - -data modify storage hats buffer.all set from entity @s Inventory - -# Extract hotbar -data modify storage minecraft:hats buffer.hotbar append from storage minecraft:hats buffer.all[{Slot:0b}] -data modify storage minecraft:hats buffer.hotbar append from storage minecraft:hats buffer.all[{Slot:1b}] -data modify storage minecraft:hats buffer.hotbar append from storage minecraft:hats buffer.all[{Slot:2b}] -data modify storage minecraft:hats buffer.hotbar append from storage minecraft:hats buffer.all[{Slot:3b}] -data modify storage minecraft:hats buffer.hotbar append from storage minecraft:hats buffer.all[{Slot:4b}] -data modify storage minecraft:hats buffer.hotbar append from storage minecraft:hats buffer.all[{Slot:5b}] -data modify storage minecraft:hats buffer.hotbar append from storage minecraft:hats buffer.all[{Slot:6b}] -data modify storage minecraft:hats buffer.hotbar append from storage minecraft:hats buffer.all[{Slot:7b}] -data modify storage minecraft:hats buffer.hotbar append from storage minecraft:hats buffer.all[{Slot:8b}] - -# Replace all stick Hats with leather_helmet hats. -# If no stick Hat exists, the modify command will add an invalid item entry. Thats why the check is there. -execute if data storage minecraft:hats buffer.hotbar[{id:"minecraft:stick", tag:{Tags:["is_hat"]}}] run data modify storage minecraft:hats buffer.hotbar[{id:"minecraft:stick", tag:{Tags:["is_hat"]}}].id set value "minecraft:leather_helmet" - -# Replaced Players hotbar with modified hotbar -setblock ~ 0 ~ minecraft:yellow_shulker_box -data modify block ~ 0 ~ Items set from storage minecraft:hats buffer.hotbar -loot replace entity @s hotbar.0 9 mine ~ 0 ~ minecraft:diamond_pickaxe{drop_contents:1b} - -# Extract inventory -data remove storage minecraft:hats buffer.inventory - -data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:9b}] -data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:10b}] -data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:11b}] -data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:12b}] -data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:13b}] -data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:14b}] -data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:15b}] -data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:16b}] -data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:17b}] -data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:18b}] -data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:19b}] -data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:20b}] -data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:21b}] -data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:22b}] -data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:23b}] -data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:24b}] -data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:25b}] -data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:26b}] -data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:27b}] -data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:28b}] -data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:29b}] -data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:30b}] -data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:31b}] -data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:32b}] -data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:33b}] -data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:34b}] -data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:35b}] +# executor: Player whos inventory is getting fixed +# descr: Fixes all stick hats in the Players inventory slots +# requirements: +# - storage buffer.inventory has to be populated +# - at least one stick hat has to exist in buffer.inventory +# Correct slot data data modify storage minecraft:hats buffer.inventory[{Slot:9b}].Slot set value 0b data modify storage minecraft:hats buffer.inventory[{Slot:10b}].Slot set value 1b data modify storage minecraft:hats buffer.inventory[{Slot:11b}].Slot set value 2b @@ -83,9 +33,8 @@ data modify storage minecraft:hats buffer.inventory[{Slot:33b}].Slot set value 2 data modify storage minecraft:hats buffer.inventory[{Slot:34b}].Slot set value 25b data modify storage minecraft:hats buffer.inventory[{Slot:35b}].Slot set value 26b -# Replace all stick Hats with leather_helmet hats. -# If no stick Hat exists, the modify command will add an invalid item entry. Thats why the check is there. -execute if data storage minecraft:hats buffer.inventory[{id:"minecraft:stick", tag:{Tags:["is_hat"]}}] run data modify storage minecraft:hats buffer.inventory[{id:"minecraft:stick", tag:{Tags:["is_hat"]}}].id set value "minecraft:leather_helmet" +# Replace all stick Hats with helmet hats +data modify storage minecraft:hats buffer.inventory[{id:"minecraft:stick", tag:{Tags:["is_hat"]}}].id set value "minecraft:leather_helmet" # Replaced Players inventory with modified inventory setblock ~ 0 ~ minecraft:yellow_shulker_box @@ -93,5 +42,4 @@ data modify block ~ 0 ~ Items set from storage minecraft:hats buffer.inventory loot replace entity @s inventory.0 27 mine ~ 0 ~ minecraft:diamond_pickaxe{drop_contents:1b} # Clean up -setblock ~ 0 ~ minecraft:air -data remove storage minecraft:hats buffer.hotbar \ No newline at end of file +setblock ~ 0 ~ minecraft:air \ No newline at end of file diff --git a/datapack/data/hats/functions/hat_behavior/fix_stick_hats_of_player.mcfunction b/datapack/data/hats/functions/hat_behavior/fix_stick_hats_of_player.mcfunction new file mode 100644 index 0000000..29cdbd9 --- /dev/null +++ b/datapack/data/hats/functions/hat_behavior/fix_stick_hats_of_player.mcfunction @@ -0,0 +1,53 @@ +# as: Player +# descr: When a Player takes of their hat, they have #hat_on_head item in their inventory. +# Replace that item with an equivalent #hat item + +data modify storage hats buffer.all set from entity @s Inventory + +# Extract items in hotbar from buffer.all +data modify storage minecraft:hats buffer.hotbar append from storage minecraft:hats buffer.all[{Slot:0b}] +data modify storage minecraft:hats buffer.hotbar append from storage minecraft:hats buffer.all[{Slot:1b}] +data modify storage minecraft:hats buffer.hotbar append from storage minecraft:hats buffer.all[{Slot:2b}] +data modify storage minecraft:hats buffer.hotbar append from storage minecraft:hats buffer.all[{Slot:3b}] +data modify storage minecraft:hats buffer.hotbar append from storage minecraft:hats buffer.all[{Slot:4b}] +data modify storage minecraft:hats buffer.hotbar append from storage minecraft:hats buffer.all[{Slot:5b}] +data modify storage minecraft:hats buffer.hotbar append from storage minecraft:hats buffer.all[{Slot:6b}] +data modify storage minecraft:hats buffer.hotbar append from storage minecraft:hats buffer.all[{Slot:7b}] +data modify storage minecraft:hats buffer.hotbar append from storage minecraft:hats buffer.all[{Slot:8b}] + +execute if data storage minecraft:hats buffer.hotbar[{id:"minecraft:stick", tag:{Tags:["is_hat"]}}] run function hats:hat_behavior/fix_stick_hats_in_players_hotbar + +# Extract items in inventory from buffer.all +data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:9b}] +data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:10b}] +data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:11b}] +data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:12b}] +data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:13b}] +data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:14b}] +data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:15b}] +data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:16b}] +data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:17b}] +data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:18b}] +data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:19b}] +data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:20b}] +data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:21b}] +data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:22b}] +data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:23b}] +data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:24b}] +data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:25b}] +data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:26b}] +data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:27b}] +data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:28b}] +data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:29b}] +data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:30b}] +data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:31b}] +data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:32b}] +data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:33b}] +data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:34b}] +data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:35b}] + +execute if data storage minecraft:hats buffer.inventory[{id:"minecraft:stick", tag:{Tags:["is_hat"]}}] run function hats:hat_behavior/fix_stick_hats_in_players_inventory + +# Clean up +setblock ~ 0 ~ minecraft:air +data remove storage minecraft:hats buffer \ No newline at end of file diff --git a/datapack/data/hats/functions/scheduled_proxies/equip_player_with_correct_hat.mcfunction b/datapack/data/hats/functions/scheduled_proxies/equip_player_with_correct_hat.mcfunction index 44d5984..a89680c 100644 --- a/datapack/data/hats/functions/scheduled_proxies/equip_player_with_correct_hat.mcfunction +++ b/datapack/data/hats/functions/scheduled_proxies/equip_player_with_correct_hat.mcfunction @@ -1,6 +1,5 @@ -#################################################################### -# as: World # -# Descr: Fix hats on players that need fixing # -#################################################################### +# executor: World +# descr: This function is scheduled as a proxy, so that another function call can be scheduled with a desired context +# Execute proxied function as Players with helmet hats on their head execute as @a[nbt={Inventory:[{Slot:103b,id:"minecraft:leather_helmet",tag:{Tags:["is_hat"]}}]}] run function hats:hat_behavior/equip_player_with_correct_hat \ No newline at end of file diff --git a/datapack/data/hats/functions/scheduled_proxies/fix_stick_hats_in_players_inventory.mcfunction b/datapack/data/hats/functions/scheduled_proxies/fix_stick_hats_in_players_inventory.mcfunction deleted file mode 100644 index 293fc29..0000000 --- a/datapack/data/hats/functions/scheduled_proxies/fix_stick_hats_in_players_inventory.mcfunction +++ /dev/null @@ -1 +0,0 @@ -execute as @a[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"]}}]}] run function hats:hat_behavior/fix_stick_hats_in_players_inventory \ No newline at end of file diff --git a/datapack/data/hats/functions/scheduled_proxies/fix_stick_hats_of_player.mcfunction b/datapack/data/hats/functions/scheduled_proxies/fix_stick_hats_of_player.mcfunction new file mode 100644 index 0000000..e0dbe34 --- /dev/null +++ b/datapack/data/hats/functions/scheduled_proxies/fix_stick_hats_of_player.mcfunction @@ -0,0 +1,5 @@ +# executor: World +# descr: This function is scheduled as a proxy, so that another function call can be scheduled with a desired context + +# Execute proxied function as Players with sitck hats in their inventory +execute as @a[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"]}}]}] run function hats:hat_behavior/fix_stick_hats_of_player \ No newline at end of file diff --git a/datapack/data/hats/functions/triggers/player_received_stick_hat.mcfunction b/datapack/data/hats/functions/triggers/player_received_stick_hat.mcfunction index d98f581..1005048 100644 --- a/datapack/data/hats/functions/triggers/player_received_stick_hat.mcfunction +++ b/datapack/data/hats/functions/triggers/player_received_stick_hat.mcfunction @@ -1,5 +1,5 @@ # Check if the hat is on the players hat. If so, schedule to fix it -execute if entity @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"]}}]}] run schedule function hats:scheduled_proxies/fix_stick_hats_in_players_inventory 1t +execute if entity @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"]}}]}] run schedule function hats:scheduled_proxies/fix_stick_hats_of_player 1t # Reset trigger advancement revoke @s only hats:triggers/player_received_stick_hat \ No newline at end of file From 03b5f19723a049c208fe9281e7fcca00839fdb5e Mon Sep 17 00:00:00 2001 From: OraneUtan Date: Fri, 22 May 2020 11:33:22 +0200 Subject: [PATCH 19/58] Removed build script for fix_hat functions --- build/generate_fix_hat_functions.py | 55 ----------------------------- 1 file changed, 55 deletions(-) delete mode 100644 build/generate_fix_hat_functions.py diff --git a/build/generate_fix_hat_functions.py b/build/generate_fix_hat_functions.py deleted file mode 100644 index 4e9981c..0000000 --- a/build/generate_fix_hat_functions.py +++ /dev/null @@ -1,55 +0,0 @@ -import inspect, os -from registry import Registry, Hat - -def generate_fix_hat_functions(hats): - for hat in hats: - if hat.category == "*": - rel_path = f"{hat.name}" - else: - rel_path = f"{hat.category}/{hat.name}" - - function_path = f"datapack/data/hats/functions/fix_hat/{rel_path}.mcfunction" - function_content = inspect.cleandoc(f""" - # as: Player, descr: Replace #hat item with equivalent #hat_on_head item - clear @s {base_item_on_head}{{CustomModelData:{hat.custom_model_data}, Tags:["is_hat"]}} 1 - execute as @s run loot give @s loot hats:hat/{rel_path} - """) - - parent_dir = os.path.split(function_path)[0] - if not os.path.exists(parent_dir): - os.makedirs(parent_dir) - - with open(function_path, "w") as file: - file.write(function_content) - -def generate_root_function(hats): - function_content = inspect.cleandoc(""" - # as: Player - # descr: When a Player takes of their hat, they have #hat_on_head item in their inventory. - # Replace that item with an equivalent #hat item""") - function_content += "\n" - - for hat in hats: - if hat.category == "*": - rel_path = f"{hat.name}" - else: - rel_path = f"{hat.category}/{hat.name}" - - function_content += "\n" - conditional_command = f"execute as @s[nbt={{Inventory:[{{id:\"{base_item_on_head}\",tag:{{Tags:[\"is_hat\"],CustomModelData:{hat.custom_model_data}}}}}]}}] run function hats:fix_hat/{rel_path}" - function_content += conditional_command - - function_path = "datapack/data/hats/functions/hat_behavior/fix_hat_from_head.mcfunction" - parent_dir = os.path.split(function_path)[0] - if not os.path.exists(parent_dir): - os.makedirs(parent_dir) - - with open(function_path, "w+") as file: - file.write(function_content) - -registry = Registry() -hats = list(registry.all_hats()) -base_item_on_head = "minecraft:stick" - -generate_fix_hat_functions(hats) -generate_root_function(hats) From d844aa03c561457ae074479aafdb0c2d6197a5aa Mon Sep 17 00:00:00 2001 From: OraneUtan Date: Fri, 22 May 2020 12:20:13 +0200 Subject: [PATCH 20/58] Added functions to execute low priority calls with slower rates --- datapack/data/hats/functions/every_3t.mcfunction | 4 ++++ datapack/data/hats/functions/every_60s.mcfunction | 4 ++++ datapack/data/hats/functions/load.mcfunction | 8 +++++++- datapack/data/hats/functions/tick.mcfunction | 13 ------------- 4 files changed, 15 insertions(+), 14 deletions(-) create mode 100644 datapack/data/hats/functions/every_3t.mcfunction create mode 100644 datapack/data/hats/functions/every_60s.mcfunction diff --git a/datapack/data/hats/functions/every_3t.mcfunction b/datapack/data/hats/functions/every_3t.mcfunction new file mode 100644 index 0000000..98ca589 --- /dev/null +++ b/datapack/data/hats/functions/every_3t.mcfunction @@ -0,0 +1,4 @@ +# Replace helmet hats on armorstands with stick hats +execute as @a at @s as @e[distance=0..10, type=minecraft:armor_stand,nbt={ArmorItems:[{},{},{},{id:"minecraft:leather_helmet",tag:{Tags:["is_hat"]}}]}] run function hats:hat_behavior/equip_armorstand_with_correct_hat + +schedule function hats:every_3t 3t \ No newline at end of file diff --git a/datapack/data/hats/functions/every_60s.mcfunction b/datapack/data/hats/functions/every_60s.mcfunction new file mode 100644 index 0000000..b30428d --- /dev/null +++ b/datapack/data/hats/functions/every_60s.mcfunction @@ -0,0 +1,4 @@ +# Replace helmet hats on armorstands with stick hats +execute as @e[type=minecraft:armor_stand,nbt={ArmorItems:[{},{},{},{id:"minecraft:leather_helmet",tag:{Tags:["is_hat"]}}]}] run function hats:hat_behavior/equip_armorstand_with_correct_hat + +schedule function hats:every_60s 60s \ No newline at end of file diff --git a/datapack/data/hats/functions/load.mcfunction b/datapack/data/hats/functions/load.mcfunction index c3f5d48..c046331 100644 --- a/datapack/data/hats/functions/load.mcfunction +++ b/datapack/data/hats/functions/load.mcfunction @@ -16,4 +16,10 @@ scoreboard objectives add hats_max_price dummy #-------------------------------------# # Dresses new mobs with hats every x seconds -function hats:dress_mobs/dress_mobs_with_hats \ No newline at end of file +function hats:dress_mobs/dress_mobs_with_hats + +#----------------------# +# Start tick functions # +#----------------------# +function hats:every_3t +function hats:every_60s \ No newline at end of file diff --git a/datapack/data/hats/functions/tick.mcfunction b/datapack/data/hats/functions/tick.mcfunction index cb4e0e4..e69de29 100644 --- a/datapack/data/hats/functions/tick.mcfunction +++ b/datapack/data/hats/functions/tick.mcfunction @@ -1,13 +0,0 @@ -############# -# as: World # -############# - -#----------------------------------------------------------------------# -# Replace helmet-hats with item-hats: # -# Hats are custom helmet models, which allows them to be used as such. # -# But since helmets cannot display their a custom model on a head, # -# the following code replaces them with an item that can # -#----------------------------------------------------------------------# - -# Replace helmet on armorstand -execute as @e[type=minecraft:armor_stand,nbt={ArmorItems:[{},{},{},{id:"minecraft:leather_helmet",tag:{Tags:["is_hat"]}}]}] run function hats:hat_behavior/equip_armorstand_with_correct_hat \ No newline at end of file From 947e623849d45f0c9093f1181f3b256a1b1ae2b8 Mon Sep 17 00:00:00 2001 From: OraneUtan Date: Fri, 22 May 2020 12:37:06 +0200 Subject: [PATCH 21/58] Now removing storage and advancements when uninstalling --- .../data/hats/functions/uninstall.mcfunction | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/datapack/data/hats/functions/uninstall.mcfunction b/datapack/data/hats/functions/uninstall.mcfunction index 0c1b047..a6e2fdd 100644 --- a/datapack/data/hats/functions/uninstall.mcfunction +++ b/datapack/data/hats/functions/uninstall.mcfunction @@ -1,10 +1,14 @@ -######################################## -# Descr: Remove all Hats related stuff # -######################################## - -#--------------------# -# Remove Scoreboards # -#--------------------# +# descr: Remove all Hats related from the world +# Remove Scoreboards scoreboard objectives remove hats_min_price -scoreboard objectives remove hats_max_price \ No newline at end of file +scoreboard objectives remove hats_max_price + +# Remove storage +data remove storage minecraft:hats buffer + +# Remove advancements +advancement revoke @a from hats:root + +# Goodbye +tellraw @s {"text":"Uninstalled Hats Datapack. Items have to be removed manually","color":"dark_red"} \ No newline at end of file From f2515c5f09d3ef2a4bd13d1b536e90746e3958b3 Mon Sep 17 00:00:00 2001 From: OraneUtan Date: Fri, 22 May 2020 15:26:57 +0200 Subject: [PATCH 22/58] Only mobs near Players get dressed --- .../dress_mobs_near_player.mcfunction | 13 ++++++++++++ .../dress_mobs_with_hats.mcfunction | 20 ------------------- .../data/hats/functions/every_5s.mcfunction | 4 ++++ datapack/data/hats/functions/load.mcfunction | 1 + 4 files changed, 18 insertions(+), 20 deletions(-) create mode 100644 datapack/data/hats/functions/dress_mobs/dress_mobs_near_player.mcfunction delete mode 100644 datapack/data/hats/functions/dress_mobs/dress_mobs_with_hats.mcfunction create mode 100644 datapack/data/hats/functions/every_5s.mcfunction diff --git a/datapack/data/hats/functions/dress_mobs/dress_mobs_near_player.mcfunction b/datapack/data/hats/functions/dress_mobs/dress_mobs_near_player.mcfunction new file mode 100644 index 0000000..1198f5c --- /dev/null +++ b/datapack/data/hats/functions/dress_mobs/dress_mobs_near_player.mcfunction @@ -0,0 +1,13 @@ +# executor: Player +# descr: Tries to dress all undressed mobs near the player + +execute as @e[type=zombie,distance=0..64,tag=!hats_is_dressed,tag=!hats.mob.dont_dress,nbt=!{ArmorItems:[{},{},{},{Count:1b}]}] at @s run function hats:dress_mobs/zombie +execute as @e[type=husk,distance=0..64,tag=!hats_is_dressed,tag=!hats.mob.dont_dress,nbt=!{ArmorItems:[{},{},{},{Count:1b}]}] at @s run function hats:dress_mobs/husk +execute as @e[type=skeleton,distance=0..64,tag=!hats_is_dressed,tag=!hats.mob.dont_dress,nbt=!{ArmorItems:[{},{},{},{Count:1b}]}] at @s run function hats:dress_mobs/skeleton +execute as @e[type=drowned,distance=0..64,tag=!hats_is_dressed,tag=!hats.mob.dont_dress,nbt=!{ArmorItems:[{},{},{},{Count:1b}]}] at @s run function hats:dress_mobs/drowned +execute as @e[type=stray,distance=0..64,tag=!hats_is_dressed,tag=!hats.mob.dont_dress,nbt=!{ArmorItems:[{},{},{},{Count:1b}]}] at @s run function hats:dress_mobs/stray +execute as @e[type=wandering_trader,distance=0..64,tag=!hats_is_dressed,tag=!hats.mob.dont_dress] at @s run function hats:dress_mobs/wandering_trader +execute as @e[type=zombie_pigman,distance=0..64,tag=!hats_is_dressed,tag=!hats.mob.dont_dress,nbt=!{ArmorItems:[{},{},{},{Count:1b}]}] at @s run function hats:dress_mobs/zombie_pigman + +# Only dress Villagers with a profession +execute as @e[type=villager,distance=0..64,tag=!hats_is_dressed,tag=!hats.mob.dont_dress,nbt=!{VillagerData:{profession:"minecraft:none"}}] at @s run function hats:dress_mobs/villager \ No newline at end of file diff --git a/datapack/data/hats/functions/dress_mobs/dress_mobs_with_hats.mcfunction b/datapack/data/hats/functions/dress_mobs/dress_mobs_with_hats.mcfunction deleted file mode 100644 index 5e61228..0000000 --- a/datapack/data/hats/functions/dress_mobs/dress_mobs_with_hats.mcfunction +++ /dev/null @@ -1,20 +0,0 @@ -############################################################# -# as: World # -# from: hats:load # -# Descr: Checks every x seconds if there are any new mobs. # -# If so, randomly dresses them with a hat (or none). # -############################################################# - -execute as @e[type=zombie,tag=!hats_is_dressed,tag=!hats.mob.dont_dress,nbt=!{ArmorItems:[{},{},{},{Count:1b}]}] at @s run function hats:dress_mobs/zombie -execute as @e[type=husk,tag=!hats_is_dressed,tag=!hats.mob.dont_dress,nbt=!{ArmorItems:[{},{},{},{Count:1b}]}] at @s run function hats:dress_mobs/husk -execute as @e[type=skeleton,tag=!hats_is_dressed,tag=!hats.mob.dont_dress,nbt=!{ArmorItems:[{},{},{},{Count:1b}]}] at @s run function hats:dress_mobs/skeleton -execute as @e[type=drowned,tag=!hats_is_dressed,tag=!hats.mob.dont_dress,nbt=!{ArmorItems:[{},{},{},{Count:1b}]}] at @s run function hats:dress_mobs/drowned -execute as @e[type=stray,tag=!hats_is_dressed,tag=!hats.mob.dont_dress,nbt=!{ArmorItems:[{},{},{},{Count:1b}]}] at @s run function hats:dress_mobs/stray -execute as @e[type=wandering_trader,tag=!hats_is_dressed,tag=!hats.mob.dont_dress] at @s run function hats:dress_mobs/wandering_trader -execute as @e[type=zombie_pigman,tag=!hats_is_dressed,tag=!hats.mob.dont_dress,nbt=!{ArmorItems:[{},{},{},{Count:1b}]}] at @s run function hats:dress_mobs/zombie_pigman - -# Only dress Villagers with a profession -execute as @e[type=villager,tag=!hats_is_dressed,tag=!hats.mob.dont_dress,nbt=!{VillagerData:{profession:"minecraft:none"}}] at @s run function hats:dress_mobs/villager - -# Schedule next check -schedule function hats:dress_mobs/dress_mobs_with_hats 5s \ No newline at end of file diff --git a/datapack/data/hats/functions/every_5s.mcfunction b/datapack/data/hats/functions/every_5s.mcfunction new file mode 100644 index 0000000..654ea53 --- /dev/null +++ b/datapack/data/hats/functions/every_5s.mcfunction @@ -0,0 +1,4 @@ +# Dress all mobs near all Players. Mobs in viewing direction are prioritized +execute as @a at @s positioned ^ ^ ^25 run function hats:dress_mobs/dress_mobs_near_player + +schedule function hats:every_5s 5s \ No newline at end of file diff --git a/datapack/data/hats/functions/load.mcfunction b/datapack/data/hats/functions/load.mcfunction index c046331..8e2a9a7 100644 --- a/datapack/data/hats/functions/load.mcfunction +++ b/datapack/data/hats/functions/load.mcfunction @@ -22,4 +22,5 @@ function hats:dress_mobs/dress_mobs_with_hats # Start tick functions # #----------------------# function hats:every_3t +function hats:every_5s function hats:every_60s \ No newline at end of file From cb34aed505de9fdca1eb2680843376a0a30f062b Mon Sep 17 00:00:00 2001 From: OraneUtan Date: Fri, 22 May 2020 21:43:23 +0200 Subject: [PATCH 23/58] Fix: Villagers were equipped with helmet hats instead of stick hats --- build/generate_special_hat_loot_tables.py | 19 +++++++++++-------- .../hats/loot_tables/dress_mobs/villager.json | 2 +- .../loot_tables/hat_on_head/cats/_rand.json | 1 + 3 files changed, 13 insertions(+), 9 deletions(-) create mode 100644 datapack/data/hats/loot_tables/hat_on_head/cats/_rand.json diff --git a/build/generate_special_hat_loot_tables.py b/build/generate_special_hat_loot_tables.py index bee5f62..8cd3a6b 100644 --- a/build/generate_special_hat_loot_tables.py +++ b/build/generate_special_hat_loot_tables.py @@ -1,7 +1,7 @@ import os, json from registry import Registry, Hat -def generate_loot_table_all_for_category(category_name, category_hats): +def generate_loot_table_all_for_category(category_name, category_hats, subfolder): pools = [] for hat in category_hats: if hat.category == "*": @@ -14,7 +14,7 @@ def generate_loot_table_all_for_category(category_name, category_hats): "entries": [ { "type": "minecraft:loot_table", - "name": f"hats:hat/{rel_path}" + "name": f"hats:{subfolder}/{rel_path}" } ] } @@ -25,7 +25,7 @@ def generate_loot_table_all_for_category(category_name, category_hats): "pools": pools } - loot_table_all_path = f"datapack/data/hats/loot_tables/hat/{category_name}/_all.json" + loot_table_all_path = f"datapack/data/hats/loot_tables/{subfolder}/{category_name}/_all.json" parent_dir = os.path.split(loot_table_all_path)[0] if not os.path.exists(parent_dir): os.makedirs(parent_dir) @@ -33,7 +33,7 @@ def generate_loot_table_all_for_category(category_name, category_hats): with open(loot_table_all_path, "w+") as file: json.dump(loot_table_all, file) -def generate_loot_table_rand_for_category(category_name, category_hats): +def generate_loot_table_rand_for_category(category_name, category_hats, subfolder): entries = [] for hat in category_hats: if hat.category == "*": @@ -43,7 +43,7 @@ def generate_loot_table_rand_for_category(category_name, category_hats): hat_entry = { "type": "minecraft:loot_table", - "name": f"hats:hat/{rel_path}" + "name": f"hats:{subfolder}/{rel_path}" } entries.append(hat_entry) @@ -58,7 +58,7 @@ def generate_loot_table_rand_for_category(category_name, category_hats): ] } - loot_table_rand_path = f"datapack/data/hats/loot_tables/hat/{category_name}/_rand.json" + loot_table_rand_path = f"datapack/data/hats/loot_tables/{subfolder}/{category_name}/_rand.json" parent_dir = os.path.split(loot_table_rand_path)[0] if not os.path.exists(parent_dir): os.makedirs(parent_dir) @@ -70,5 +70,8 @@ def generate_loot_table_rand_for_category(category_name, category_hats): for category_name, category_hats in registry.categories(): if category_name != "*": - generate_loot_table_all_for_category(category_name, category_hats) - generate_loot_table_rand_for_category(category_name, category_hats) \ No newline at end of file + generate_loot_table_all_for_category(category_name, category_hats, 'hat') + generate_loot_table_rand_for_category(category_name, category_hats, 'hat') + + if category_name == 'cats': + generate_loot_table_rand_for_category(category_name, category_hats, 'hat_on_head') \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/dress_mobs/villager.json b/datapack/data/hats/loot_tables/dress_mobs/villager.json index 04ab30c..0772675 100644 --- a/datapack/data/hats/loot_tables/dress_mobs/villager.json +++ b/datapack/data/hats/loot_tables/dress_mobs/villager.json @@ -10,7 +10,7 @@ }, { "type": "minecraft:loot_table", - "name": "hats:hat/cats/_rand", + "name": "hats:hat_on_head/cats/_rand", "weight": 11 } ] diff --git a/datapack/data/hats/loot_tables/hat_on_head/cats/_rand.json b/datapack/data/hats/loot_tables/hat_on_head/cats/_rand.json new file mode 100644 index 0000000..1889b83 --- /dev/null +++ b/datapack/data/hats/loot_tables/hat_on_head/cats/_rand.json @@ -0,0 +1 @@ +{"type": "minecraft:generic", "pools": [{"rolls": 1, "entries": [{"type": "minecraft:loot_table", "name": "hats:hat_on_head/cats/ocelot"}, {"type": "minecraft:loot_table", "name": "hats:hat_on_head/cats/tabby"}, {"type": "minecraft:loot_table", "name": "hats:hat_on_head/cats/tuxedo"}, {"type": "minecraft:loot_table", "name": "hats:hat_on_head/cats/red"}, {"type": "minecraft:loot_table", "name": "hats:hat_on_head/cats/siamese"}, {"type": "minecraft:loot_table", "name": "hats:hat_on_head/cats/british_shorthair"}, {"type": "minecraft:loot_table", "name": "hats:hat_on_head/cats/calico"}, {"type": "minecraft:loot_table", "name": "hats:hat_on_head/cats/persian"}, {"type": "minecraft:loot_table", "name": "hats:hat_on_head/cats/ragdoll"}, {"type": "minecraft:loot_table", "name": "hats:hat_on_head/cats/white"}, {"type": "minecraft:loot_table", "name": "hats:hat_on_head/cats/jellie"}, {"type": "minecraft:loot_table", "name": "hats:hat_on_head/cats/black"}]}]} \ No newline at end of file From 4705e572a39a7349ed9cb1878576bf7d75414a24 Mon Sep 17 00:00:00 2001 From: OraneUtan Date: Sat, 23 May 2020 00:05:54 +0200 Subject: [PATCH 24/58] Renamed 'dress_mobs' subfolders to just 'dress' --- .../dress/dress_mobs_near_player.mcfunction | 13 +++++++++++++ .../data/hats/functions/dress/drowned.mcfunction | 7 +++++++ datapack/data/hats/functions/dress/husk.mcfunction | 7 +++++++ .../data/hats/functions/dress/skeleton.mcfunction | 7 +++++++ datapack/data/hats/functions/dress/stray.mcfunction | 7 +++++++ .../{dress_mobs => dress}/villager.mcfunction | 9 +++------ .../wandering_trader.mcfunction | 9 +++------ .../data/hats/functions/dress/zombie.mcfunction | 7 +++++++ .../hats/functions/dress/zombie_pigman.mcfunction | 7 +++++++ .../dress_mobs/dress_mobs_near_player.mcfunction | 13 ------------- .../hats/functions/dress_mobs/drowned.mcfunction | 10 ---------- .../data/hats/functions/dress_mobs/husk.mcfunction | 10 ---------- .../hats/functions/dress_mobs/skeleton.mcfunction | 10 ---------- .../data/hats/functions/dress_mobs/stray.mcfunction | 10 ---------- .../hats/functions/dress_mobs/zombie.mcfunction | 10 ---------- .../functions/dress_mobs/zombie_pigman.mcfunction | 10 ---------- datapack/data/hats/functions/every_5s.mcfunction | 2 +- datapack/data/hats/functions/load.mcfunction | 8 ++++---- .../loot_tables/{dress_mobs => dress}/drowned.json | 0 .../loot_tables/{dress_mobs => dress}/husk.json | 0 .../loot_tables/{dress_mobs => dress}/skeleton.json | 0 .../loot_tables/{dress_mobs => dress}/stray.json | 0 .../loot_tables/{dress_mobs => dress}/villager.json | 0 .../{dress_mobs => dress}/wandering_trader.json | 0 .../loot_tables/{dress_mobs => dress}/zombie.json | 0 .../{dress_mobs => dress}/zombie_pigman.json | 0 26 files changed, 66 insertions(+), 90 deletions(-) create mode 100644 datapack/data/hats/functions/dress/dress_mobs_near_player.mcfunction create mode 100644 datapack/data/hats/functions/dress/drowned.mcfunction create mode 100644 datapack/data/hats/functions/dress/husk.mcfunction create mode 100644 datapack/data/hats/functions/dress/skeleton.mcfunction create mode 100644 datapack/data/hats/functions/dress/stray.mcfunction rename datapack/data/hats/functions/{dress_mobs => dress}/villager.mcfunction (78%) rename datapack/data/hats/functions/{dress_mobs => dress}/wandering_trader.mcfunction (73%) create mode 100644 datapack/data/hats/functions/dress/zombie.mcfunction create mode 100644 datapack/data/hats/functions/dress/zombie_pigman.mcfunction delete mode 100644 datapack/data/hats/functions/dress_mobs/dress_mobs_near_player.mcfunction delete mode 100644 datapack/data/hats/functions/dress_mobs/drowned.mcfunction delete mode 100644 datapack/data/hats/functions/dress_mobs/husk.mcfunction delete mode 100644 datapack/data/hats/functions/dress_mobs/skeleton.mcfunction delete mode 100644 datapack/data/hats/functions/dress_mobs/stray.mcfunction delete mode 100644 datapack/data/hats/functions/dress_mobs/zombie.mcfunction delete mode 100644 datapack/data/hats/functions/dress_mobs/zombie_pigman.mcfunction rename datapack/data/hats/loot_tables/{dress_mobs => dress}/drowned.json (100%) rename datapack/data/hats/loot_tables/{dress_mobs => dress}/husk.json (100%) rename datapack/data/hats/loot_tables/{dress_mobs => dress}/skeleton.json (100%) rename datapack/data/hats/loot_tables/{dress_mobs => dress}/stray.json (100%) rename datapack/data/hats/loot_tables/{dress_mobs => dress}/villager.json (100%) rename datapack/data/hats/loot_tables/{dress_mobs => dress}/wandering_trader.json (100%) rename datapack/data/hats/loot_tables/{dress_mobs => dress}/zombie.json (100%) rename datapack/data/hats/loot_tables/{dress_mobs => dress}/zombie_pigman.json (100%) diff --git a/datapack/data/hats/functions/dress/dress_mobs_near_player.mcfunction b/datapack/data/hats/functions/dress/dress_mobs_near_player.mcfunction new file mode 100644 index 0000000..711b325 --- /dev/null +++ b/datapack/data/hats/functions/dress/dress_mobs_near_player.mcfunction @@ -0,0 +1,13 @@ +# executor: Player +# descr: Tries to dress all undressed mobs near the player + +execute as @e[type=zombie,distance=0..64,tag=!hats.mob.dont_dress,nbt=!{ArmorItems:[{},{},{},{Count:1b}]}] at @s run function hats:dress/zombie +execute as @e[type=husk,distance=0..64,tag=!hats.mob.dont_dress,nbt=!{ArmorItems:[{},{},{},{Count:1b}]}] at @s run function hats:dress/husk +execute as @e[type=skeleton,distance=0..64,tag=!hats.mob.dont_dress,nbt=!{ArmorItems:[{},{},{},{Count:1b}]}] at @s run function hats:dress/skeleton +execute as @e[type=drowned,distance=0..64,tag=!hats.mob.dont_dress,nbt=!{ArmorItems:[{},{},{},{Count:1b}]}] at @s run function hats:dress/drowned +execute as @e[type=stray,distance=0..64,tag=!hats.mob.dont_dress,nbt=!{ArmorItems:[{},{},{},{Count:1b}]}] at @s run function hats:dress/stray +execute as @e[type=wandering_trader,distance=0..64,tag=!hats.mob.dont_dress] at @s run function hats:dress/wandering_trader +execute as @e[type=zombie_pigman,distance=0..64,tag=!hats.mob.dont_dress,nbt=!{ArmorItems:[{},{},{},{Count:1b}]}] at @s run function hats:dress/zombie_pigman + +# Only dress Villagers with a profession +execute as @e[type=villager,distance=0..64,tag=!hats.mob.dont_dress,nbt=!{VillagerData:{profession:"minecraft:none"}}] at @s run function hats:dress/villager \ No newline at end of file diff --git a/datapack/data/hats/functions/dress/drowned.mcfunction b/datapack/data/hats/functions/dress/drowned.mcfunction new file mode 100644 index 0000000..9bbd931 --- /dev/null +++ b/datapack/data/hats/functions/dress/drowned.mcfunction @@ -0,0 +1,7 @@ +# as: Drowned beeing dressed +# descr: Try dressing a Drowned with a hat + +loot replace entity @s armor.head loot hats:dress/drowned + +execute as @s[nbt={ArmorItems:[{},{},{},{Count:1b}]}] run data modify entity @s ArmorDropChances[3] set value 1.0f +tag @s add hats.mob.dont_dress \ No newline at end of file diff --git a/datapack/data/hats/functions/dress/husk.mcfunction b/datapack/data/hats/functions/dress/husk.mcfunction new file mode 100644 index 0000000..db6f9aa --- /dev/null +++ b/datapack/data/hats/functions/dress/husk.mcfunction @@ -0,0 +1,7 @@ +# as: The Husk beeing dressed +# descr: Try dressing a Husk with a hat + +loot replace entity @s armor.head loot hats:dress/husk + +execute as @s[nbt={ArmorItems:[{},{},{},{Count:1b}]}] run data modify entity @s ArmorDropChances[3] set value 1.0f +tag @s add hats.mob.dont_dress \ No newline at end of file diff --git a/datapack/data/hats/functions/dress/skeleton.mcfunction b/datapack/data/hats/functions/dress/skeleton.mcfunction new file mode 100644 index 0000000..dfba8fc --- /dev/null +++ b/datapack/data/hats/functions/dress/skeleton.mcfunction @@ -0,0 +1,7 @@ +# as: The Skeleton beeing dressed +# descr: Try dressing a Skeleton with a hat + +loot replace entity @s armor.head loot hats:dress/skeleton + +execute as @s[nbt={ArmorItems:[{},{},{},{Count:1b}]}] run data modify entity @s ArmorDropChances[3] set value 1.0f +tag @s add hats.mob.dont_dress \ No newline at end of file diff --git a/datapack/data/hats/functions/dress/stray.mcfunction b/datapack/data/hats/functions/dress/stray.mcfunction new file mode 100644 index 0000000..2c6a59e --- /dev/null +++ b/datapack/data/hats/functions/dress/stray.mcfunction @@ -0,0 +1,7 @@ +# as: The Stray beeing dressed +# descr: Try dressing a Stray with a hat + +loot replace entity @s armor.head loot hats:dress/stray + +execute as @s[nbt={ArmorItems:[{},{},{},{Count:1b}]}] run data modify entity @s ArmorDropChances[3] set value 1.0f +tag @s add hats.mob.dont_dress \ No newline at end of file diff --git a/datapack/data/hats/functions/dress_mobs/villager.mcfunction b/datapack/data/hats/functions/dress/villager.mcfunction similarity index 78% rename from datapack/data/hats/functions/dress_mobs/villager.mcfunction rename to datapack/data/hats/functions/dress/villager.mcfunction index ebe7633..20aebc3 100644 --- a/datapack/data/hats/functions/dress_mobs/villager.mcfunction +++ b/datapack/data/hats/functions/dress/villager.mcfunction @@ -1,15 +1,12 @@ -###################################################################### -# as: Villager # -# from: hats:dress_mobs_with_hats # -# Descr: Dress the Villager with a random hat and give it hat trades # -###################################################################### +# as: The Villager beeing dressed +# descr: Dress the Villager with a random hat and give it hat trades #----------------------# # Add optional cat hat # #----------------------# # Equip Villager with random cat (or none) -loot replace entity @s armor.head loot hats:dress_mobs/villager +loot replace entity @s armor.head loot hats:dress/villager # If Villagers has a cat hat, modify helmet drop chances execute if data entity @s ArmorItems[3].id run data modify entity @s ArmorDropChances[3] set value 0.0f diff --git a/datapack/data/hats/functions/dress_mobs/wandering_trader.mcfunction b/datapack/data/hats/functions/dress/wandering_trader.mcfunction similarity index 73% rename from datapack/data/hats/functions/dress_mobs/wandering_trader.mcfunction rename to datapack/data/hats/functions/dress/wandering_trader.mcfunction index cc5c9fd..3dce250 100644 --- a/datapack/data/hats/functions/dress_mobs/wandering_trader.mcfunction +++ b/datapack/data/hats/functions/dress/wandering_trader.mcfunction @@ -1,15 +1,12 @@ -############################################################################## -# as: Wandering Trader # -# from: hats:dress_mobs_with_hats # -# Descr: Dress the Wandering Trader with a random hat and give it hat trades # -############################################################################## +# as: The Wandering Trader beeing dressed +# Descr: Dress the Wandering Trader with a random hat and give it hat trades #----------------------# # Add optional cat hat # #----------------------# # Equip Wandering Trader with random cat (or none) -loot replace entity @s armor.head loot hats:dress_mobs/wandering_trader +loot replace entity @s armor.head loot hats:dress/wandering_trader # If Wandering Trader has a cat hat, modify helmet drop chances execute if data entity @s ArmorItems[3].id run data modify entity @s ArmorDropChances[3] set value 0.0f diff --git a/datapack/data/hats/functions/dress/zombie.mcfunction b/datapack/data/hats/functions/dress/zombie.mcfunction new file mode 100644 index 0000000..b1613e2 --- /dev/null +++ b/datapack/data/hats/functions/dress/zombie.mcfunction @@ -0,0 +1,7 @@ +# as: The Zombie beeing dressed +# descr: Dress a Zombie with a hat + +loot replace entity @s armor.head loot hats:dress/zombie + +execute as @s[nbt={ArmorItems:[{},{},{},{Count:1b}]}] run data modify entity @s ArmorDropChances[3] set value 1.0f +tag @s add hats.mob.dont_dress \ No newline at end of file diff --git a/datapack/data/hats/functions/dress/zombie_pigman.mcfunction b/datapack/data/hats/functions/dress/zombie_pigman.mcfunction new file mode 100644 index 0000000..a8c0d4a --- /dev/null +++ b/datapack/data/hats/functions/dress/zombie_pigman.mcfunction @@ -0,0 +1,7 @@ +# as: The Zombie Pigman beeing dressed +# descr: Dress the Zombie Pigman with a hat + +loot replace entity @s armor.head loot hats:dress/zombie_pigman + +execute as @s[nbt={ArmorItems:[{},{},{},{Count:1b}]}] run data modify entity @s ArmorDropChances[3] set value 1.0f +tag @s add hats.mob.dont_dress \ No newline at end of file diff --git a/datapack/data/hats/functions/dress_mobs/dress_mobs_near_player.mcfunction b/datapack/data/hats/functions/dress_mobs/dress_mobs_near_player.mcfunction deleted file mode 100644 index 1198f5c..0000000 --- a/datapack/data/hats/functions/dress_mobs/dress_mobs_near_player.mcfunction +++ /dev/null @@ -1,13 +0,0 @@ -# executor: Player -# descr: Tries to dress all undressed mobs near the player - -execute as @e[type=zombie,distance=0..64,tag=!hats_is_dressed,tag=!hats.mob.dont_dress,nbt=!{ArmorItems:[{},{},{},{Count:1b}]}] at @s run function hats:dress_mobs/zombie -execute as @e[type=husk,distance=0..64,tag=!hats_is_dressed,tag=!hats.mob.dont_dress,nbt=!{ArmorItems:[{},{},{},{Count:1b}]}] at @s run function hats:dress_mobs/husk -execute as @e[type=skeleton,distance=0..64,tag=!hats_is_dressed,tag=!hats.mob.dont_dress,nbt=!{ArmorItems:[{},{},{},{Count:1b}]}] at @s run function hats:dress_mobs/skeleton -execute as @e[type=drowned,distance=0..64,tag=!hats_is_dressed,tag=!hats.mob.dont_dress,nbt=!{ArmorItems:[{},{},{},{Count:1b}]}] at @s run function hats:dress_mobs/drowned -execute as @e[type=stray,distance=0..64,tag=!hats_is_dressed,tag=!hats.mob.dont_dress,nbt=!{ArmorItems:[{},{},{},{Count:1b}]}] at @s run function hats:dress_mobs/stray -execute as @e[type=wandering_trader,distance=0..64,tag=!hats_is_dressed,tag=!hats.mob.dont_dress] at @s run function hats:dress_mobs/wandering_trader -execute as @e[type=zombie_pigman,distance=0..64,tag=!hats_is_dressed,tag=!hats.mob.dont_dress,nbt=!{ArmorItems:[{},{},{},{Count:1b}]}] at @s run function hats:dress_mobs/zombie_pigman - -# Only dress Villagers with a profession -execute as @e[type=villager,distance=0..64,tag=!hats_is_dressed,tag=!hats.mob.dont_dress,nbt=!{VillagerData:{profession:"minecraft:none"}}] at @s run function hats:dress_mobs/villager \ No newline at end of file diff --git a/datapack/data/hats/functions/dress_mobs/drowned.mcfunction b/datapack/data/hats/functions/dress_mobs/drowned.mcfunction deleted file mode 100644 index 4399e26..0000000 --- a/datapack/data/hats/functions/dress_mobs/drowned.mcfunction +++ /dev/null @@ -1,10 +0,0 @@ -############################################## -# as: Drowned # -# from: hats:dress_mobs_with_hats # -# Descr: Dress the Drowned with a random hat # -############################################## - -loot replace entity @s armor.head loot hats:dress_mobs/drowned - -execute as @s[nbt={ArmorItems:[{},{},{},{Count:1b}]}] run data modify entity @s ArmorDropChances[3] set value 1.0f -tag @s add hats.mob.dont_dress \ No newline at end of file diff --git a/datapack/data/hats/functions/dress_mobs/husk.mcfunction b/datapack/data/hats/functions/dress_mobs/husk.mcfunction deleted file mode 100644 index e1fcaf2..0000000 --- a/datapack/data/hats/functions/dress_mobs/husk.mcfunction +++ /dev/null @@ -1,10 +0,0 @@ -########################################### -# as: Husk # -# from: hats:dress_mobs_with_hats # -# Descr: Dress the Husk with a random hat # -########################################### - -loot replace entity @s armor.head loot hats:dress_mobs/husk - -execute as @s[nbt={ArmorItems:[{},{},{},{Count:1b}]}] run data modify entity @s ArmorDropChances[3] set value 1.0f -tag @s add hats.mob.dont_dress \ No newline at end of file diff --git a/datapack/data/hats/functions/dress_mobs/skeleton.mcfunction b/datapack/data/hats/functions/dress_mobs/skeleton.mcfunction deleted file mode 100644 index f16dd37..0000000 --- a/datapack/data/hats/functions/dress_mobs/skeleton.mcfunction +++ /dev/null @@ -1,10 +0,0 @@ -############################################### -# as: Skeleton # -# from: hats:dress_mobs_with_hats # -# Descr: Dress the Skeleton with a random hat # -############################################### - -loot replace entity @s armor.head loot hats:dress_mobs/skeleton - -execute as @s[nbt={ArmorItems:[{},{},{},{Count:1b}]}] run data modify entity @s ArmorDropChances[3] set value 1.0f -tag @s add hats.mob.dont_dress \ No newline at end of file diff --git a/datapack/data/hats/functions/dress_mobs/stray.mcfunction b/datapack/data/hats/functions/dress_mobs/stray.mcfunction deleted file mode 100644 index 079e25e..0000000 --- a/datapack/data/hats/functions/dress_mobs/stray.mcfunction +++ /dev/null @@ -1,10 +0,0 @@ -############################################ -# as: Stray # -# from: hats:dress_mobs_with_hats # -# Descr: Dress the Stray with a random hat # -############################################ - -loot replace entity @s armor.head loot hats:dress_mobs/stray - -execute as @s[nbt={ArmorItems:[{},{},{},{Count:1b}]}] run data modify entity @s ArmorDropChances[3] set value 1.0f -tag @s add hats.mob.dont_dress \ No newline at end of file diff --git a/datapack/data/hats/functions/dress_mobs/zombie.mcfunction b/datapack/data/hats/functions/dress_mobs/zombie.mcfunction deleted file mode 100644 index a9405e7..0000000 --- a/datapack/data/hats/functions/dress_mobs/zombie.mcfunction +++ /dev/null @@ -1,10 +0,0 @@ -############################################# -# as: Zombie # -# from: hats:dress_mobs_with_hats # -# Descr: Dress the Zombie with a random hat # -############################################# - -loot replace entity @s armor.head loot hats:dress_mobs/zombie - -execute as @s[nbt={ArmorItems:[{},{},{},{Count:1b}]}] run data modify entity @s ArmorDropChances[3] set value 1.0f -tag @s add hats.mob.dont_dress \ No newline at end of file diff --git a/datapack/data/hats/functions/dress_mobs/zombie_pigman.mcfunction b/datapack/data/hats/functions/dress_mobs/zombie_pigman.mcfunction deleted file mode 100644 index f63f158..0000000 --- a/datapack/data/hats/functions/dress_mobs/zombie_pigman.mcfunction +++ /dev/null @@ -1,10 +0,0 @@ -#################################################### -# as: Zombie Pigman # -# from: hats:dress_mobs_with_hats # -# Descr: Dress the Zombie Pigman with a random hat # -#################################################### - -loot replace entity @s armor.head loot hats:dress_mobs/zombie_pigman - -execute as @s[nbt={ArmorItems:[{},{},{},{Count:1b}]}] run data modify entity @s ArmorDropChances[3] set value 1.0f -tag @s add hats.mob.dont_dress \ No newline at end of file diff --git a/datapack/data/hats/functions/every_5s.mcfunction b/datapack/data/hats/functions/every_5s.mcfunction index 654ea53..d0c6be8 100644 --- a/datapack/data/hats/functions/every_5s.mcfunction +++ b/datapack/data/hats/functions/every_5s.mcfunction @@ -1,4 +1,4 @@ # Dress all mobs near all Players. Mobs in viewing direction are prioritized -execute as @a at @s positioned ^ ^ ^25 run function hats:dress_mobs/dress_mobs_near_player +execute as @a at @s positioned ^ ^ ^25 run function hats:dress/dress_mobs_near_player schedule function hats:every_5s 5s \ No newline at end of file diff --git a/datapack/data/hats/functions/load.mcfunction b/datapack/data/hats/functions/load.mcfunction index 8e2a9a7..949b8bb 100644 --- a/datapack/data/hats/functions/load.mcfunction +++ b/datapack/data/hats/functions/load.mcfunction @@ -11,12 +11,12 @@ scoreboard objectives add hats_min_price dummy scoreboard objectives add hats_max_price dummy -#-------------------------------------# -# Start repeating dress_mobs function # -#-------------------------------------# +#---------------------------------------# +# Start repeating 'dress_mobs' function # +#---------------------------------------# # Dresses new mobs with hats every x seconds -function hats:dress_mobs/dress_mobs_with_hats +function hats:dress/dress_mobs_with_hats #----------------------# # Start tick functions # diff --git a/datapack/data/hats/loot_tables/dress_mobs/drowned.json b/datapack/data/hats/loot_tables/dress/drowned.json similarity index 100% rename from datapack/data/hats/loot_tables/dress_mobs/drowned.json rename to datapack/data/hats/loot_tables/dress/drowned.json diff --git a/datapack/data/hats/loot_tables/dress_mobs/husk.json b/datapack/data/hats/loot_tables/dress/husk.json similarity index 100% rename from datapack/data/hats/loot_tables/dress_mobs/husk.json rename to datapack/data/hats/loot_tables/dress/husk.json diff --git a/datapack/data/hats/loot_tables/dress_mobs/skeleton.json b/datapack/data/hats/loot_tables/dress/skeleton.json similarity index 100% rename from datapack/data/hats/loot_tables/dress_mobs/skeleton.json rename to datapack/data/hats/loot_tables/dress/skeleton.json diff --git a/datapack/data/hats/loot_tables/dress_mobs/stray.json b/datapack/data/hats/loot_tables/dress/stray.json similarity index 100% rename from datapack/data/hats/loot_tables/dress_mobs/stray.json rename to datapack/data/hats/loot_tables/dress/stray.json diff --git a/datapack/data/hats/loot_tables/dress_mobs/villager.json b/datapack/data/hats/loot_tables/dress/villager.json similarity index 100% rename from datapack/data/hats/loot_tables/dress_mobs/villager.json rename to datapack/data/hats/loot_tables/dress/villager.json diff --git a/datapack/data/hats/loot_tables/dress_mobs/wandering_trader.json b/datapack/data/hats/loot_tables/dress/wandering_trader.json similarity index 100% rename from datapack/data/hats/loot_tables/dress_mobs/wandering_trader.json rename to datapack/data/hats/loot_tables/dress/wandering_trader.json diff --git a/datapack/data/hats/loot_tables/dress_mobs/zombie.json b/datapack/data/hats/loot_tables/dress/zombie.json similarity index 100% rename from datapack/data/hats/loot_tables/dress_mobs/zombie.json rename to datapack/data/hats/loot_tables/dress/zombie.json diff --git a/datapack/data/hats/loot_tables/dress_mobs/zombie_pigman.json b/datapack/data/hats/loot_tables/dress/zombie_pigman.json similarity index 100% rename from datapack/data/hats/loot_tables/dress_mobs/zombie_pigman.json rename to datapack/data/hats/loot_tables/dress/zombie_pigman.json From a82ff967a68083ae120a77380c9d925d7eddba1d Mon Sep 17 00:00:00 2001 From: OraneUtan Date: Sat, 23 May 2020 13:23:36 +0200 Subject: [PATCH 25/58] Villager favorite cat is now dependent on biome --- .../hats/functions/dress/villager.mcfunction | 2 +- .../data/hats/loot_tables/dress/villager.json | 19 -- .../dress/villager_favorite_cat.json | 235 ++++++++++++++++++ .../predicates/villager/is_type_desert.json | 8 + .../predicates/villager/is_type_jungle.json | 8 + .../predicates/villager/is_type_plains.json | 8 + .../predicates/villager/is_type_savanna.json | 8 + .../predicates/villager/is_type_snow.json | 8 + .../predicates/villager/is_type_swamp.json | 8 + .../predicates/villager/is_type_taiga.json | 8 + 10 files changed, 292 insertions(+), 20 deletions(-) delete mode 100644 datapack/data/hats/loot_tables/dress/villager.json create mode 100644 datapack/data/hats/loot_tables/dress/villager_favorite_cat.json create mode 100644 datapack/data/hats/predicates/villager/is_type_desert.json create mode 100644 datapack/data/hats/predicates/villager/is_type_jungle.json create mode 100644 datapack/data/hats/predicates/villager/is_type_plains.json create mode 100644 datapack/data/hats/predicates/villager/is_type_savanna.json create mode 100644 datapack/data/hats/predicates/villager/is_type_snow.json create mode 100644 datapack/data/hats/predicates/villager/is_type_swamp.json create mode 100644 datapack/data/hats/predicates/villager/is_type_taiga.json diff --git a/datapack/data/hats/functions/dress/villager.mcfunction b/datapack/data/hats/functions/dress/villager.mcfunction index 20aebc3..08480bb 100644 --- a/datapack/data/hats/functions/dress/villager.mcfunction +++ b/datapack/data/hats/functions/dress/villager.mcfunction @@ -6,7 +6,7 @@ #----------------------# # Equip Villager with random cat (or none) -loot replace entity @s armor.head loot hats:dress/villager +loot replace entity @s armor.head loot hats:dress/villager_favorite_cat # If Villagers has a cat hat, modify helmet drop chances execute if data entity @s ArmorItems[3].id run data modify entity @s ArmorDropChances[3] set value 0.0f diff --git a/datapack/data/hats/loot_tables/dress/villager.json b/datapack/data/hats/loot_tables/dress/villager.json deleted file mode 100644 index 0772675..0000000 --- a/datapack/data/hats/loot_tables/dress/villager.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "type": "generic", - "pools": [ - { - "rolls": 1, - "entries": [ - { - "type": "empty", - "weight": 20 - }, - { - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/cats/_rand", - "weight": 11 - } - ] - } - ] -} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/dress/villager_favorite_cat.json b/datapack/data/hats/loot_tables/dress/villager_favorite_cat.json new file mode 100644 index 0000000..b023926 --- /dev/null +++ b/datapack/data/hats/loot_tables/dress/villager_favorite_cat.json @@ -0,0 +1,235 @@ +{ + "type": "generic", + "pools": [ + { + "rolls": 1, + "conditions": [ + { + "condition": "reference", + "name": "hats:villager/is_type_desert" + } + ], + "entries": [ + { + "type": "minecraft:empty", + "weight": 12 + }, + { + "weight": 1, + "type": "minecraft:loot_table", + "name": "hats:hat_on_head/cats/black" + }, + { + "weight": 1, + "type": "minecraft:loot_table", + "name": "hats:hat_on_head/cats/persian" + }, + { + "weight": 1, + "type": "minecraft:loot_table", + "name": "hats:hat_on_head/cats/red" + } + ] + }, + { + "rolls": 1, + "conditions": [ + { + "condition": "reference", + "name": "hats:villager/is_type_jungle" + } + ], + "entries": [ + { + "type": "minecraft:empty", + "weight": 12 + }, + { + "weight": 1, + "type": "minecraft:loot_table", + "name": "hats:hat_on_head/cats/calico" + }, + { + "weight": 1, + "type": "minecraft:loot_table", + "name": "hats:hat_on_head/cats/ocelot" + }, + { + "weight": 1, + "type": "minecraft:loot_table", + "name": "hats:hat_on_head/cats/red" + } + ] + }, + { + "rolls": 1, + "conditions": [ + { + "condition": "reference", + "name": "hats:villager/is_type_plains" + } + ], + "entries": [ + { + "type": "minecraft:empty", + "weight": 16 + }, + { + "weight": 1, + "type": "minecraft:loot_table", + "name": "hats:hat_on_head/cats/british_shorthair" + }, + { + "weight": 1, + "type": "minecraft:loot_table", + "name": "hats:hat_on_head/cats/calico" + }, + { + "weight": 1, + "type": "minecraft:loot_table", + "name": "hats:hat_on_head/cats/red" + }, + { + "weight": 1, + "type": "minecraft:loot_table", + "name": "hats:hat_on_head/cats/tuxedo" + } + ] + }, + { + "rolls": 1, + "conditions": [ + { + "condition": "reference", + "name": "hats:villager/is_type_savanna" + } + ], + "entries": [ + { + "type": "minecraft:empty", + "weight": 16 + }, + { + "weight": 1, + "type": "minecraft:loot_table", + "name": "hats:hat_on_head/cats/calico" + }, + { + "weight": 1, + "type": "minecraft:loot_table", + "name": "hats:hat_on_head/cats/ocelot" + }, + { + "weight": 1, + "type": "minecraft:loot_table", + "name": "hats:hat_on_head/cats/persian" + }, + { + "weight": 1, + "type": "minecraft:loot_table", + "name": "hats:hat_on_head/cats/red" + } + ] + }, + { + "rolls": 1, + "conditions": [ + { + "condition": "reference", + "name": "hats:villager/is_type_snow" + } + ], + "entries": [ + { + "type": "minecraft:empty", + "weight": 16 + }, + { + "weight": 1, + "type": "minecraft:loot_table", + "name": "hats:hat_on_head/cats/jellie" + }, + { + "weight": 1, + "type": "minecraft:loot_table", + "name": "hats:hat_on_head/cats/ragdoll" + }, + { + "weight": 1, + "type": "minecraft:loot_table", + "name": "hats:hat_on_head/cats/tabby" + }, + { + "weight": 1, + "type": "minecraft:loot_table", + "name": "hats:hat_on_head/cats/white" + } + ] + }, + { + "rolls": 1, + "conditions": [ + { + "condition": "reference", + "name": "hats:villager/is_type_swamp" + } + ], + "entries": [ + { + "type": "minecraft:empty", + "weight": 12 + }, + { + "weight": 1, + "type": "minecraft:loot_table", + "name": "hats:hat_on_head/cats/black" + }, + { + "weight": 1, + "type": "minecraft:loot_table", + "name": "hats:hat_on_head/cats/jellie" + }, + { + "weight": 1, + "type": "minecraft:loot_table", + "name": "hats:hat_on_head/cats/tabby" + } + ] + }, + { + "rolls": 1, + "conditions": [ + { + "condition": "reference", + "name": "hats:villager/is_type_taiga" + } + ], + "entries": [ + { + "type": "minecraft:empty", + "weight": 16 + }, + { + "weight": 1, + "type": "minecraft:loot_table", + "name": "hats:hat_on_head/cats/british_shorthair" + }, + { + "weight": 1, + "type": "minecraft:loot_table", + "name": "hats:hat_on_head/cats/jellie" + }, + { + "weight": 1, + "type": "minecraft:loot_table", + "name": "hats:hat_on_head/cats/siamese" + }, + { + "weight": 1, + "type": "minecraft:loot_table", + "name": "hats:hat_on_head/cats/tabby" + } + ] + } + ] +} \ No newline at end of file diff --git a/datapack/data/hats/predicates/villager/is_type_desert.json b/datapack/data/hats/predicates/villager/is_type_desert.json new file mode 100644 index 0000000..8c89afe --- /dev/null +++ b/datapack/data/hats/predicates/villager/is_type_desert.json @@ -0,0 +1,8 @@ +{ + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "type": "minecraft:villager", + "nbt": "{VillagerData:{type:\"minecraft:desert\"}}" + } +} \ No newline at end of file diff --git a/datapack/data/hats/predicates/villager/is_type_jungle.json b/datapack/data/hats/predicates/villager/is_type_jungle.json new file mode 100644 index 0000000..a870f8c --- /dev/null +++ b/datapack/data/hats/predicates/villager/is_type_jungle.json @@ -0,0 +1,8 @@ +{ + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "type": "minecraft:villager", + "nbt": "{VillagerData:{type:\"minecraft:jungle\"}}" + } +} \ No newline at end of file diff --git a/datapack/data/hats/predicates/villager/is_type_plains.json b/datapack/data/hats/predicates/villager/is_type_plains.json new file mode 100644 index 0000000..7655e0c --- /dev/null +++ b/datapack/data/hats/predicates/villager/is_type_plains.json @@ -0,0 +1,8 @@ +{ + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "type": "minecraft:villager", + "nbt": "{VillagerData:{type:\"minecraft:plains\"}}" + } +} \ No newline at end of file diff --git a/datapack/data/hats/predicates/villager/is_type_savanna.json b/datapack/data/hats/predicates/villager/is_type_savanna.json new file mode 100644 index 0000000..f9a1dd1 --- /dev/null +++ b/datapack/data/hats/predicates/villager/is_type_savanna.json @@ -0,0 +1,8 @@ +{ + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "type": "minecraft:villager", + "nbt": "{VillagerData:{type:\"minecraft:savanna\"}}" + } +} \ No newline at end of file diff --git a/datapack/data/hats/predicates/villager/is_type_snow.json b/datapack/data/hats/predicates/villager/is_type_snow.json new file mode 100644 index 0000000..61f441a --- /dev/null +++ b/datapack/data/hats/predicates/villager/is_type_snow.json @@ -0,0 +1,8 @@ +{ + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "type": "minecraft:villager", + "nbt": "{VillagerData:{type:\"minecraft:snow\"}}" + } +} \ No newline at end of file diff --git a/datapack/data/hats/predicates/villager/is_type_swamp.json b/datapack/data/hats/predicates/villager/is_type_swamp.json new file mode 100644 index 0000000..1fa54d1 --- /dev/null +++ b/datapack/data/hats/predicates/villager/is_type_swamp.json @@ -0,0 +1,8 @@ +{ + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "type": "minecraft:villager", + "nbt": "{VillagerData:{type:\"minecraft:swamp\"}}" + } +} \ No newline at end of file diff --git a/datapack/data/hats/predicates/villager/is_type_taiga.json b/datapack/data/hats/predicates/villager/is_type_taiga.json new file mode 100644 index 0000000..700db02 --- /dev/null +++ b/datapack/data/hats/predicates/villager/is_type_taiga.json @@ -0,0 +1,8 @@ +{ + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "type": "minecraft:villager", + "nbt": "{VillagerData:{type:\"minecraft:taiga\"}}" + } +} \ No newline at end of file From 4ea21eff30c205148cfdb8e5acc609a1ff747bb7 Mon Sep 17 00:00:00 2001 From: OraneUtan Date: Sat, 23 May 2020 14:48:46 +0200 Subject: [PATCH 26/58] Now using predicate to determine if a Villager has a fav cat --- .../hats/functions/dress/villager.mcfunction | 14 +---- .../dress/villager_fav_cat.mcfunction | 11 ++++ .../dress/villager_favorite_cat.json | 53 ------------------- .../villager/chance_has_fav_cat.json | 4 ++ 4 files changed, 17 insertions(+), 65 deletions(-) create mode 100644 datapack/data/hats/functions/dress/villager_fav_cat.mcfunction create mode 100644 datapack/data/hats/predicates/villager/chance_has_fav_cat.json diff --git a/datapack/data/hats/functions/dress/villager.mcfunction b/datapack/data/hats/functions/dress/villager.mcfunction index 08480bb..ce42245 100644 --- a/datapack/data/hats/functions/dress/villager.mcfunction +++ b/datapack/data/hats/functions/dress/villager.mcfunction @@ -1,18 +1,8 @@ # as: The Villager beeing dressed # descr: Dress the Villager with a random hat and give it hat trades -#----------------------# -# Add optional cat hat # -#----------------------# - -# Equip Villager with random cat (or none) -loot replace entity @s armor.head loot hats:dress/villager_favorite_cat - -# If Villagers has a cat hat, modify helmet drop chances -execute if data entity @s ArmorItems[3].id run data modify entity @s ArmorDropChances[3] set value 0.0f - -# If Villager has a cat hat, add that cat as a trade -execute if data entity @s ArmorItems[3].id run function hats:add_trades/favorite_cat +# Add optional favorite cat hat +execute if predicate hats:villager/chance_has_fav_cat run function hats:dress/villager_fav_cat #-------------------------------------------------------------# # Give Villager optinal special trade depending on profession # diff --git a/datapack/data/hats/functions/dress/villager_fav_cat.mcfunction b/datapack/data/hats/functions/dress/villager_fav_cat.mcfunction new file mode 100644 index 0000000..ff7c505 --- /dev/null +++ b/datapack/data/hats/functions/dress/villager_fav_cat.mcfunction @@ -0,0 +1,11 @@ +# Add tag to indicate that the villager has a favorite cat +tag @s add hats.villager.has_fav_cat + +# Equip a favorite cat, depending on the biome +loot replace entity @s armor.head loot hats:dress/villager_favorite_cat + +# Villagers don't drop their favorite cat +data modify entity @s ArmorDropChances[3] set value 0.0f + +# Add trade for favorite cat +function hats:add_trades/favorite_cat \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/dress/villager_favorite_cat.json b/datapack/data/hats/loot_tables/dress/villager_favorite_cat.json index b023926..36f099e 100644 --- a/datapack/data/hats/loot_tables/dress/villager_favorite_cat.json +++ b/datapack/data/hats/loot_tables/dress/villager_favorite_cat.json @@ -11,21 +11,14 @@ ], "entries": [ { - "type": "minecraft:empty", - "weight": 12 - }, - { - "weight": 1, "type": "minecraft:loot_table", "name": "hats:hat_on_head/cats/black" }, { - "weight": 1, "type": "minecraft:loot_table", "name": "hats:hat_on_head/cats/persian" }, { - "weight": 1, "type": "minecraft:loot_table", "name": "hats:hat_on_head/cats/red" } @@ -41,21 +34,14 @@ ], "entries": [ { - "type": "minecraft:empty", - "weight": 12 - }, - { - "weight": 1, "type": "minecraft:loot_table", "name": "hats:hat_on_head/cats/calico" }, { - "weight": 1, "type": "minecraft:loot_table", "name": "hats:hat_on_head/cats/ocelot" }, { - "weight": 1, "type": "minecraft:loot_table", "name": "hats:hat_on_head/cats/red" } @@ -71,26 +57,18 @@ ], "entries": [ { - "type": "minecraft:empty", - "weight": 16 - }, - { - "weight": 1, "type": "minecraft:loot_table", "name": "hats:hat_on_head/cats/british_shorthair" }, { - "weight": 1, "type": "minecraft:loot_table", "name": "hats:hat_on_head/cats/calico" }, { - "weight": 1, "type": "minecraft:loot_table", "name": "hats:hat_on_head/cats/red" }, { - "weight": 1, "type": "minecraft:loot_table", "name": "hats:hat_on_head/cats/tuxedo" } @@ -106,26 +84,18 @@ ], "entries": [ { - "type": "minecraft:empty", - "weight": 16 - }, - { - "weight": 1, "type": "minecraft:loot_table", "name": "hats:hat_on_head/cats/calico" }, { - "weight": 1, "type": "minecraft:loot_table", "name": "hats:hat_on_head/cats/ocelot" }, { - "weight": 1, "type": "minecraft:loot_table", "name": "hats:hat_on_head/cats/persian" }, { - "weight": 1, "type": "minecraft:loot_table", "name": "hats:hat_on_head/cats/red" } @@ -141,26 +111,18 @@ ], "entries": [ { - "type": "minecraft:empty", - "weight": 16 - }, - { - "weight": 1, "type": "minecraft:loot_table", "name": "hats:hat_on_head/cats/jellie" }, { - "weight": 1, "type": "minecraft:loot_table", "name": "hats:hat_on_head/cats/ragdoll" }, { - "weight": 1, "type": "minecraft:loot_table", "name": "hats:hat_on_head/cats/tabby" }, { - "weight": 1, "type": "minecraft:loot_table", "name": "hats:hat_on_head/cats/white" } @@ -176,21 +138,14 @@ ], "entries": [ { - "type": "minecraft:empty", - "weight": 12 - }, - { - "weight": 1, "type": "minecraft:loot_table", "name": "hats:hat_on_head/cats/black" }, { - "weight": 1, "type": "minecraft:loot_table", "name": "hats:hat_on_head/cats/jellie" }, { - "weight": 1, "type": "minecraft:loot_table", "name": "hats:hat_on_head/cats/tabby" } @@ -206,26 +161,18 @@ ], "entries": [ { - "type": "minecraft:empty", - "weight": 16 - }, - { - "weight": 1, "type": "minecraft:loot_table", "name": "hats:hat_on_head/cats/british_shorthair" }, { - "weight": 1, "type": "minecraft:loot_table", "name": "hats:hat_on_head/cats/jellie" }, { - "weight": 1, "type": "minecraft:loot_table", "name": "hats:hat_on_head/cats/siamese" }, { - "weight": 1, "type": "minecraft:loot_table", "name": "hats:hat_on_head/cats/tabby" } diff --git a/datapack/data/hats/predicates/villager/chance_has_fav_cat.json b/datapack/data/hats/predicates/villager/chance_has_fav_cat.json new file mode 100644 index 0000000..bc0e24f --- /dev/null +++ b/datapack/data/hats/predicates/villager/chance_has_fav_cat.json @@ -0,0 +1,4 @@ +{ + "condition": "minecraft:random_chance", + "chance": 0.22 +} \ No newline at end of file From 3f068621fa07bd4b4f0eee11d3e9a90e10be291b Mon Sep 17 00:00:00 2001 From: OraneUtan Date: Sat, 23 May 2020 14:59:18 +0200 Subject: [PATCH 27/58] Renamed directory 'scheduled_proxies' to just 'proxies' --- .../equip_player_with_correct_hat.mcfunction | 0 .../fix_stick_hats_of_player.mcfunction | 0 .../triggers/player_received_helmet_hat.mcfunction | 11 ++++------- .../triggers/player_received_stick_hat.mcfunction | 6 ++++-- 4 files changed, 8 insertions(+), 9 deletions(-) rename datapack/data/hats/functions/{scheduled_proxies => proxies}/equip_player_with_correct_hat.mcfunction (100%) rename datapack/data/hats/functions/{scheduled_proxies => proxies}/fix_stick_hats_of_player.mcfunction (100%) diff --git a/datapack/data/hats/functions/scheduled_proxies/equip_player_with_correct_hat.mcfunction b/datapack/data/hats/functions/proxies/equip_player_with_correct_hat.mcfunction similarity index 100% rename from datapack/data/hats/functions/scheduled_proxies/equip_player_with_correct_hat.mcfunction rename to datapack/data/hats/functions/proxies/equip_player_with_correct_hat.mcfunction diff --git a/datapack/data/hats/functions/scheduled_proxies/fix_stick_hats_of_player.mcfunction b/datapack/data/hats/functions/proxies/fix_stick_hats_of_player.mcfunction similarity index 100% rename from datapack/data/hats/functions/scheduled_proxies/fix_stick_hats_of_player.mcfunction rename to datapack/data/hats/functions/proxies/fix_stick_hats_of_player.mcfunction diff --git a/datapack/data/hats/functions/triggers/player_received_helmet_hat.mcfunction b/datapack/data/hats/functions/triggers/player_received_helmet_hat.mcfunction index be51b7b..2cfa65f 100644 --- a/datapack/data/hats/functions/triggers/player_received_helmet_hat.mcfunction +++ b/datapack/data/hats/functions/triggers/player_received_helmet_hat.mcfunction @@ -1,12 +1,9 @@ -#################################################################### -# as: Player getting advancement # -# Descr: Called by advancement when the players inventory # -# contains a hat. If the hat is on the players head, # -# replace it with a HOH-hat # -#################################################################### +# executor: Player getting advancement +# descr: Called by advancement when the players inventory contains a helmet hat. +# If the hat is on the players head, replace it with a stick hat # Check if the hat is on the players hat. If so, schedule to fix it -execute if entity @s[nbt={Inventory:[{Slot:103b,id:"minecraft:leather_helmet",tag:{Tags:["is_hat"]}}]}] run schedule function hats:scheduled_proxies/equip_player_with_correct_hat 1t +execute if entity @s[nbt={Inventory:[{Slot:103b,id:"minecraft:leather_helmet",tag:{Tags:["is_hat"]}}]}] run schedule function hats:proxies/equip_player_with_correct_hat 1t # Reset trigger advancement revoke @s only hats:triggers/player_received_helmet_hat \ No newline at end of file diff --git a/datapack/data/hats/functions/triggers/player_received_stick_hat.mcfunction b/datapack/data/hats/functions/triggers/player_received_stick_hat.mcfunction index 1005048..c728311 100644 --- a/datapack/data/hats/functions/triggers/player_received_stick_hat.mcfunction +++ b/datapack/data/hats/functions/triggers/player_received_stick_hat.mcfunction @@ -1,5 +1,7 @@ -# Check if the hat is on the players hat. If so, schedule to fix it -execute if entity @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"]}}]}] run schedule function hats:scheduled_proxies/fix_stick_hats_of_player 1t +# executor: Player getting advancement +# descr: Called by advancement when the players inventory contains a stick hat. Replaces it with a helmet hat + +execute if entity @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"]}}]}] run schedule function hats:proxies/fix_stick_hats_of_player 1t # Reset trigger advancement revoke @s only hats:triggers/player_received_stick_hat \ No newline at end of file From b796d7d9166ea89f3226ac4e8bf076ca8f88dfa8 Mon Sep 17 00:00:00 2001 From: OraneUtan Date: Sat, 23 May 2020 15:06:32 +0200 Subject: [PATCH 28/58] Renamed directory 'hat_behavior' to 'hat_mechanism' 'Behavior' could mean more than what the functions do. 'Mechanism' better describes the functions: They are responsible for making the hats work like helmets --- datapack/data/hats/functions/every_3t.mcfunction | 2 +- datapack/data/hats/functions/every_60s.mcfunction | 2 +- .../equip_armorstand_with_correct_hat.mcfunction | 0 .../equip_player_with_correct_hat.mcfunction | 0 .../fix_stick_hats_in_players_hotbar.mcfunction | 0 .../fix_stick_hats_in_players_inventory.mcfunction | 0 .../fix_stick_hats_of_player.mcfunction | 4 ++-- .../proxies/equip_player_with_correct_hat.mcfunction | 2 +- .../functions/proxies/fix_stick_hats_of_player.mcfunction | 2 +- 9 files changed, 6 insertions(+), 6 deletions(-) rename datapack/data/hats/functions/{hat_behavior => hat_mechanism}/equip_armorstand_with_correct_hat.mcfunction (100%) rename datapack/data/hats/functions/{hat_behavior => hat_mechanism}/equip_player_with_correct_hat.mcfunction (100%) rename datapack/data/hats/functions/{hat_behavior => hat_mechanism}/fix_stick_hats_in_players_hotbar.mcfunction (100%) rename datapack/data/hats/functions/{hat_behavior => hat_mechanism}/fix_stick_hats_in_players_inventory.mcfunction (100%) rename datapack/data/hats/functions/{hat_behavior => hat_mechanism}/fix_stick_hats_of_player.mcfunction (95%) diff --git a/datapack/data/hats/functions/every_3t.mcfunction b/datapack/data/hats/functions/every_3t.mcfunction index 98ca589..9a3790b 100644 --- a/datapack/data/hats/functions/every_3t.mcfunction +++ b/datapack/data/hats/functions/every_3t.mcfunction @@ -1,4 +1,4 @@ # Replace helmet hats on armorstands with stick hats -execute as @a at @s as @e[distance=0..10, type=minecraft:armor_stand,nbt={ArmorItems:[{},{},{},{id:"minecraft:leather_helmet",tag:{Tags:["is_hat"]}}]}] run function hats:hat_behavior/equip_armorstand_with_correct_hat +execute as @a at @s as @e[distance=0..10, type=minecraft:armor_stand,nbt={ArmorItems:[{},{},{},{id:"minecraft:leather_helmet",tag:{Tags:["is_hat"]}}]}] run function hats:hat_mechanism/equip_armorstand_with_correct_hat schedule function hats:every_3t 3t \ No newline at end of file diff --git a/datapack/data/hats/functions/every_60s.mcfunction b/datapack/data/hats/functions/every_60s.mcfunction index b30428d..8e44523 100644 --- a/datapack/data/hats/functions/every_60s.mcfunction +++ b/datapack/data/hats/functions/every_60s.mcfunction @@ -1,4 +1,4 @@ # Replace helmet hats on armorstands with stick hats -execute as @e[type=minecraft:armor_stand,nbt={ArmorItems:[{},{},{},{id:"minecraft:leather_helmet",tag:{Tags:["is_hat"]}}]}] run function hats:hat_behavior/equip_armorstand_with_correct_hat +execute as @e[type=minecraft:armor_stand,nbt={ArmorItems:[{},{},{},{id:"minecraft:leather_helmet",tag:{Tags:["is_hat"]}}]}] run function hats:hat_mechanism/equip_armorstand_with_correct_hat schedule function hats:every_60s 60s \ No newline at end of file diff --git a/datapack/data/hats/functions/hat_behavior/equip_armorstand_with_correct_hat.mcfunction b/datapack/data/hats/functions/hat_mechanism/equip_armorstand_with_correct_hat.mcfunction similarity index 100% rename from datapack/data/hats/functions/hat_behavior/equip_armorstand_with_correct_hat.mcfunction rename to datapack/data/hats/functions/hat_mechanism/equip_armorstand_with_correct_hat.mcfunction diff --git a/datapack/data/hats/functions/hat_behavior/equip_player_with_correct_hat.mcfunction b/datapack/data/hats/functions/hat_mechanism/equip_player_with_correct_hat.mcfunction similarity index 100% rename from datapack/data/hats/functions/hat_behavior/equip_player_with_correct_hat.mcfunction rename to datapack/data/hats/functions/hat_mechanism/equip_player_with_correct_hat.mcfunction diff --git a/datapack/data/hats/functions/hat_behavior/fix_stick_hats_in_players_hotbar.mcfunction b/datapack/data/hats/functions/hat_mechanism/fix_stick_hats_in_players_hotbar.mcfunction similarity index 100% rename from datapack/data/hats/functions/hat_behavior/fix_stick_hats_in_players_hotbar.mcfunction rename to datapack/data/hats/functions/hat_mechanism/fix_stick_hats_in_players_hotbar.mcfunction diff --git a/datapack/data/hats/functions/hat_behavior/fix_stick_hats_in_players_inventory.mcfunction b/datapack/data/hats/functions/hat_mechanism/fix_stick_hats_in_players_inventory.mcfunction similarity index 100% rename from datapack/data/hats/functions/hat_behavior/fix_stick_hats_in_players_inventory.mcfunction rename to datapack/data/hats/functions/hat_mechanism/fix_stick_hats_in_players_inventory.mcfunction diff --git a/datapack/data/hats/functions/hat_behavior/fix_stick_hats_of_player.mcfunction b/datapack/data/hats/functions/hat_mechanism/fix_stick_hats_of_player.mcfunction similarity index 95% rename from datapack/data/hats/functions/hat_behavior/fix_stick_hats_of_player.mcfunction rename to datapack/data/hats/functions/hat_mechanism/fix_stick_hats_of_player.mcfunction index 29cdbd9..b902b22 100644 --- a/datapack/data/hats/functions/hat_behavior/fix_stick_hats_of_player.mcfunction +++ b/datapack/data/hats/functions/hat_mechanism/fix_stick_hats_of_player.mcfunction @@ -15,7 +15,7 @@ data modify storage minecraft:hats buffer.hotbar append from storage minecraft:h data modify storage minecraft:hats buffer.hotbar append from storage minecraft:hats buffer.all[{Slot:7b}] data modify storage minecraft:hats buffer.hotbar append from storage minecraft:hats buffer.all[{Slot:8b}] -execute if data storage minecraft:hats buffer.hotbar[{id:"minecraft:stick", tag:{Tags:["is_hat"]}}] run function hats:hat_behavior/fix_stick_hats_in_players_hotbar +execute if data storage minecraft:hats buffer.hotbar[{id:"minecraft:stick", tag:{Tags:["is_hat"]}}] run function hats:hat_mechanism/fix_stick_hats_in_players_hotbar # Extract items in inventory from buffer.all data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:9b}] @@ -46,7 +46,7 @@ data modify storage minecraft:hats buffer.inventory append from storage minecraf data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:34b}] data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:35b}] -execute if data storage minecraft:hats buffer.inventory[{id:"minecraft:stick", tag:{Tags:["is_hat"]}}] run function hats:hat_behavior/fix_stick_hats_in_players_inventory +execute if data storage minecraft:hats buffer.inventory[{id:"minecraft:stick", tag:{Tags:["is_hat"]}}] run function hats:hat_mechanism/fix_stick_hats_in_players_inventory # Clean up setblock ~ 0 ~ minecraft:air diff --git a/datapack/data/hats/functions/proxies/equip_player_with_correct_hat.mcfunction b/datapack/data/hats/functions/proxies/equip_player_with_correct_hat.mcfunction index a89680c..289dbe1 100644 --- a/datapack/data/hats/functions/proxies/equip_player_with_correct_hat.mcfunction +++ b/datapack/data/hats/functions/proxies/equip_player_with_correct_hat.mcfunction @@ -2,4 +2,4 @@ # descr: This function is scheduled as a proxy, so that another function call can be scheduled with a desired context # Execute proxied function as Players with helmet hats on their head -execute as @a[nbt={Inventory:[{Slot:103b,id:"minecraft:leather_helmet",tag:{Tags:["is_hat"]}}]}] run function hats:hat_behavior/equip_player_with_correct_hat \ No newline at end of file +execute as @a[nbt={Inventory:[{Slot:103b,id:"minecraft:leather_helmet",tag:{Tags:["is_hat"]}}]}] run function hats:hat_mechanism/equip_player_with_correct_hat \ No newline at end of file diff --git a/datapack/data/hats/functions/proxies/fix_stick_hats_of_player.mcfunction b/datapack/data/hats/functions/proxies/fix_stick_hats_of_player.mcfunction index e0dbe34..923d13d 100644 --- a/datapack/data/hats/functions/proxies/fix_stick_hats_of_player.mcfunction +++ b/datapack/data/hats/functions/proxies/fix_stick_hats_of_player.mcfunction @@ -2,4 +2,4 @@ # descr: This function is scheduled as a proxy, so that another function call can be scheduled with a desired context # Execute proxied function as Players with sitck hats in their inventory -execute as @a[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"]}}]}] run function hats:hat_behavior/fix_stick_hats_of_player \ No newline at end of file +execute as @a[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"]}}]}] run function hats:hat_mechanism/fix_stick_hats_of_player \ No newline at end of file From 243174c2b57643608613ef96fdd5946ae49a2c33 Mon Sep 17 00:00:00 2001 From: OraneUtan Date: Sat, 23 May 2020 15:28:25 +0200 Subject: [PATCH 29/58] Moved functions adding Villager trades into 'dress/villager' --- datapack/data/hats/functions/dress/villager.mcfunction | 4 ++-- .../add_fav_cat.mcfunction} | 2 +- .../villager/add_fav_cat_trade.mcfunction} | 0 .../villager/add_special_trade.mcfunction} | 0 .../data/hats/functions/dress/wandering_trader.mcfunction | 4 ++-- 5 files changed, 5 insertions(+), 5 deletions(-) rename datapack/data/hats/functions/dress/{villager_fav_cat.mcfunction => villager/add_fav_cat.mcfunction} (88%) rename datapack/data/hats/functions/{add_trades/favorite_cat.mcfunction => dress/villager/add_fav_cat_trade.mcfunction} (100%) rename datapack/data/hats/functions/{add_trades/special.mcfunction => dress/villager/add_special_trade.mcfunction} (100%) diff --git a/datapack/data/hats/functions/dress/villager.mcfunction b/datapack/data/hats/functions/dress/villager.mcfunction index ce42245..dc04dbb 100644 --- a/datapack/data/hats/functions/dress/villager.mcfunction +++ b/datapack/data/hats/functions/dress/villager.mcfunction @@ -2,7 +2,7 @@ # descr: Dress the Villager with a random hat and give it hat trades # Add optional favorite cat hat -execute if predicate hats:villager/chance_has_fav_cat run function hats:dress/villager_fav_cat +execute if predicate hats:villager/chance_has_fav_cat run function hats:dress/villager/add_fav_cat #-------------------------------------------------------------# # Give Villager optinal special trade depending on profession # @@ -15,7 +15,7 @@ execute as @s[nbt={VillagerData:{profession:"minecraft:farmer"}}] run loot repla execute as @s[nbt={VillagerData:{profession:"minecraft:toolsmith"}}] run loot replace entity @s weapon.offhand loot hats:trades/toolsmith # Add special offer if Villager is holding a special item -execute as @s[nbt={HandItems:[{},{tag:{Tags:["is_hat"]}}]}] run function hats:add_trades/special +execute as @s[nbt={HandItems:[{},{tag:{Tags:["is_hat"]}}]}] run function hats:dress/villager/add_special_trade #--------------------------# # Mark Villager as dressed # diff --git a/datapack/data/hats/functions/dress/villager_fav_cat.mcfunction b/datapack/data/hats/functions/dress/villager/add_fav_cat.mcfunction similarity index 88% rename from datapack/data/hats/functions/dress/villager_fav_cat.mcfunction rename to datapack/data/hats/functions/dress/villager/add_fav_cat.mcfunction index ff7c505..30967ae 100644 --- a/datapack/data/hats/functions/dress/villager_fav_cat.mcfunction +++ b/datapack/data/hats/functions/dress/villager/add_fav_cat.mcfunction @@ -8,4 +8,4 @@ loot replace entity @s armor.head loot hats:dress/villager_favorite_cat data modify entity @s ArmorDropChances[3] set value 0.0f # Add trade for favorite cat -function hats:add_trades/favorite_cat \ No newline at end of file +function hats:dress/villager/add_fav_cat_trade \ No newline at end of file diff --git a/datapack/data/hats/functions/add_trades/favorite_cat.mcfunction b/datapack/data/hats/functions/dress/villager/add_fav_cat_trade.mcfunction similarity index 100% rename from datapack/data/hats/functions/add_trades/favorite_cat.mcfunction rename to datapack/data/hats/functions/dress/villager/add_fav_cat_trade.mcfunction diff --git a/datapack/data/hats/functions/add_trades/special.mcfunction b/datapack/data/hats/functions/dress/villager/add_special_trade.mcfunction similarity index 100% rename from datapack/data/hats/functions/add_trades/special.mcfunction rename to datapack/data/hats/functions/dress/villager/add_special_trade.mcfunction diff --git a/datapack/data/hats/functions/dress/wandering_trader.mcfunction b/datapack/data/hats/functions/dress/wandering_trader.mcfunction index 3dce250..f2b38ca 100644 --- a/datapack/data/hats/functions/dress/wandering_trader.mcfunction +++ b/datapack/data/hats/functions/dress/wandering_trader.mcfunction @@ -12,7 +12,7 @@ loot replace entity @s armor.head loot hats:dress/wandering_trader execute if data entity @s ArmorItems[3].id run data modify entity @s ArmorDropChances[3] set value 0.0f # If Wandering Trader has a cat hat, add that cat as a trade -execute if data entity @s ArmorItems[3].id run function hats:add_trades/favorite_cat +execute if data entity @s ArmorItems[3].id run function hats:dress/villager/add_fav_cat_trade #----------------------------------------------# # Give Wandering Trader optional special trade # @@ -22,7 +22,7 @@ execute if data entity @s ArmorItems[3].id run function hats:add_trades/favorite loot replace entity @s weapon.offhand loot hats:trades/wandering_trader # Add special offer if Wandering Trader is holding a special item -execute as @s[nbt={HandItems:[{},{tag:{Tags:["is_hat"]}}]}] run function hats:add_trades/special +execute as @s[nbt={HandItems:[{},{tag:{Tags:["is_hat"]}}]}] run function hats:dress/villager/add_special_trade #----------------------------------# # Mark Wandering Trader as dressed # From 1ea77e84e6229e1f869d560b2a7af0cc72f575d8 Mon Sep 17 00:00:00 2001 From: OraneUtan Date: Sat, 23 May 2020 16:18:42 +0200 Subject: [PATCH 30/58] Wandering Trader gets equipped with random favorite cat --- .../dress/villager/add_fav_cat.mcfunction | 2 +- .../villager/add_fav_cat_trade.mcfunction | 6 ++---- .../dress/wandering_trader.mcfunction | 14 ++------------ .../wandering_trader/add_fav_cat.mcfunction | 11 +++++++++++ .../add_fav_cat_trade.mcfunction | 18 ++++++++++++++++++ .../wandering_trader/chance_has_fav_cat.json | 4 ++++ 6 files changed, 38 insertions(+), 17 deletions(-) create mode 100644 datapack/data/hats/functions/dress/wandering_trader/add_fav_cat.mcfunction create mode 100644 datapack/data/hats/functions/dress/wandering_trader/add_fav_cat_trade.mcfunction create mode 100644 datapack/data/hats/predicates/wandering_trader/chance_has_fav_cat.json diff --git a/datapack/data/hats/functions/dress/villager/add_fav_cat.mcfunction b/datapack/data/hats/functions/dress/villager/add_fav_cat.mcfunction index 30967ae..85e410a 100644 --- a/datapack/data/hats/functions/dress/villager/add_fav_cat.mcfunction +++ b/datapack/data/hats/functions/dress/villager/add_fav_cat.mcfunction @@ -1,5 +1,5 @@ # Add tag to indicate that the villager has a favorite cat -tag @s add hats.villager.has_fav_cat +tag @s add hats.mob.has_fav_cat # Equip a favorite cat, depending on the biome loot replace entity @s armor.head loot hats:dress/villager_favorite_cat diff --git a/datapack/data/hats/functions/dress/villager/add_fav_cat_trade.mcfunction b/datapack/data/hats/functions/dress/villager/add_fav_cat_trade.mcfunction index 525fb31..d8fb897 100644 --- a/datapack/data/hats/functions/dress/villager/add_fav_cat_trade.mcfunction +++ b/datapack/data/hats/functions/dress/villager/add_fav_cat_trade.mcfunction @@ -1,7 +1,5 @@ -################################################################################## -# as: Villager/Wandering Trader # -# Descr: Adds offer of the favorite cat the Villager/Wandering Trader is wearing # -################################################################################## +# executor: Villager beeing dressed +# Descr: Adds offer of the favorite cat the Villager Trader is wearing # Add template offer data modify entity @s Offers.Recipes append value {buy:{id:"minecraft:emerald", Count:1b}, sell:{id:"minecraft:leather_helmet",Count:1b,tag:{CustomModelData:0,Tags:["is_hat"]}}} diff --git a/datapack/data/hats/functions/dress/wandering_trader.mcfunction b/datapack/data/hats/functions/dress/wandering_trader.mcfunction index f2b38ca..e545933 100644 --- a/datapack/data/hats/functions/dress/wandering_trader.mcfunction +++ b/datapack/data/hats/functions/dress/wandering_trader.mcfunction @@ -1,18 +1,8 @@ # as: The Wandering Trader beeing dressed # Descr: Dress the Wandering Trader with a random hat and give it hat trades -#----------------------# -# Add optional cat hat # -#----------------------# - -# Equip Wandering Trader with random cat (or none) -loot replace entity @s armor.head loot hats:dress/wandering_trader - -# If Wandering Trader has a cat hat, modify helmet drop chances -execute if data entity @s ArmorItems[3].id run data modify entity @s ArmorDropChances[3] set value 0.0f - -# If Wandering Trader has a cat hat, add that cat as a trade -execute if data entity @s ArmorItems[3].id run function hats:dress/villager/add_fav_cat_trade +# Add optional favorite cat hat +execute if predicate hats:wandering_trader/chance_has_fav_cat run function hats:dress/wandering_trader/add_fav_cat #----------------------------------------------# # Give Wandering Trader optional special trade # diff --git a/datapack/data/hats/functions/dress/wandering_trader/add_fav_cat.mcfunction b/datapack/data/hats/functions/dress/wandering_trader/add_fav_cat.mcfunction new file mode 100644 index 0000000..591606f --- /dev/null +++ b/datapack/data/hats/functions/dress/wandering_trader/add_fav_cat.mcfunction @@ -0,0 +1,11 @@ +# Add tag to indicate that the villager has a favorite cat +tag @s add hats.mob.has_fav_cat + +# Equip Wandering Trader with random cat +loot replace entity @s armor.head loot hats:hat_on_head/cats/_rand + +# Wandering Traders don't drop their favorite cat +data modify entity @s ArmorDropChances[3] set value 0.0f + +# Add trade for favorite cat +function hats:dress/wandering_trader/add_fav_cat_trade \ No newline at end of file diff --git a/datapack/data/hats/functions/dress/wandering_trader/add_fav_cat_trade.mcfunction b/datapack/data/hats/functions/dress/wandering_trader/add_fav_cat_trade.mcfunction new file mode 100644 index 0000000..4c9b373 --- /dev/null +++ b/datapack/data/hats/functions/dress/wandering_trader/add_fav_cat_trade.mcfunction @@ -0,0 +1,18 @@ +# executor: Wandering Trader beeing dressed +# Descr: Adds offer of the favorite cat the Wandering Trader is wearing + +# Add template offer +data modify entity @s Offers.Recipes append value {buy:{id:"minecraft:emerald", Count:1b}, sell:{id:"minecraft:leather_helmet",Count:1b,tag:{CustomModelData:0,Tags:["is_hat"]}}} + +# Set the sell item of the template offer to the cat hat on the Wandering Traders head +data modify entity @s Offers.Recipes[-1].sell.tag set from entity @s ArmorItems[3].tag + +# Set random price +scoreboard players set @s hats_min_price 15 +scoreboard players set @s hats_max_price 30 + +loot replace entity @s weapon.offhand loot hats:trades/rand_price +data modify entity @s Offers.Recipes[-1].buy.Count set from entity @s HandItems[1].Count + +scoreboard players reset @s hats_min_price +scoreboard players reset @s hats_max_price \ No newline at end of file diff --git a/datapack/data/hats/predicates/wandering_trader/chance_has_fav_cat.json b/datapack/data/hats/predicates/wandering_trader/chance_has_fav_cat.json new file mode 100644 index 0000000..489b402 --- /dev/null +++ b/datapack/data/hats/predicates/wandering_trader/chance_has_fav_cat.json @@ -0,0 +1,4 @@ +{ + "condition": "minecraft:random_chance", + "chance": 0.5 +} \ No newline at end of file From 41e37837b343f36ffd81ef500e6544b622edc0f7 Mon Sep 17 00:00:00 2001 From: OraneUtan Date: Sat, 23 May 2020 19:32:45 +0200 Subject: [PATCH 31/58] Added random number generator using lcg algorithm --- datapack/data/hats/functions/load.mcfunction | 5 ++++- datapack/data/hats/functions/math/lcg.mcfunction | 5 +++++ .../data/hats/functions/math/lcg_init.mcfunction | 8 ++++++++ .../hats/functions/math/lcg_new_seed.mcfunction | 3 +++ .../data/hats/functions/math/rng-rec.mcfunction | 14 ++++++++++++++ datapack/data/hats/functions/math/rng.mcfunction | 9 +++++++++ datapack/data/hats/functions/uninstall.mcfunction | 1 + 7 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 datapack/data/hats/functions/math/lcg.mcfunction create mode 100644 datapack/data/hats/functions/math/lcg_init.mcfunction create mode 100644 datapack/data/hats/functions/math/lcg_new_seed.mcfunction create mode 100644 datapack/data/hats/functions/math/rng-rec.mcfunction create mode 100644 datapack/data/hats/functions/math/rng.mcfunction diff --git a/datapack/data/hats/functions/load.mcfunction b/datapack/data/hats/functions/load.mcfunction index 949b8bb..2821f15 100644 --- a/datapack/data/hats/functions/load.mcfunction +++ b/datapack/data/hats/functions/load.mcfunction @@ -7,9 +7,12 @@ # Add Scoreboards # #-----------------# -# Used for random price scoreboard objectives add hats_min_price dummy scoreboard objectives add hats_max_price dummy +scoreboard objectives add hats_math dummy + +# Initialise random number generator +function hats:math/lcg_init #---------------------------------------# # Start repeating 'dress_mobs' function # diff --git a/datapack/data/hats/functions/math/lcg.mcfunction b/datapack/data/hats/functions/math/lcg.mcfunction new file mode 100644 index 0000000..444c182 --- /dev/null +++ b/datapack/data/hats/functions/math/lcg.mcfunction @@ -0,0 +1,5 @@ +# Linear congruential generator (Random number generator). Calculates a pseudo-random number. +# Formula: x_{n+1} = x_n * 1103515245 + 12345 + +scoreboard players operation #hats_lcg hats_math *= #hats_lcg_mult hats_math +scoreboard players add #hats_lcg hats_math 12345 \ No newline at end of file diff --git a/datapack/data/hats/functions/math/lcg_init.mcfunction b/datapack/data/hats/functions/math/lcg_init.mcfunction new file mode 100644 index 0000000..c83b2ba --- /dev/null +++ b/datapack/data/hats/functions/math/lcg_init.mcfunction @@ -0,0 +1,8 @@ +# lcg_mult: Constant used for multiplication by lcg +scoreboard players set #hats_lcg_mult hats_math 1103515245 + +# Set a default rng range +scoreboard players set #hats_rng_range hats_math 100 + +# Seed lcg +function hats:math/lcg_new_seed \ No newline at end of file diff --git a/datapack/data/hats/functions/math/lcg_new_seed.mcfunction b/datapack/data/hats/functions/math/lcg_new_seed.mcfunction new file mode 100644 index 0000000..cb2a1ae --- /dev/null +++ b/datapack/data/hats/functions/math/lcg_new_seed.mcfunction @@ -0,0 +1,3 @@ +summon minecraft:area_effect_cloud ~ ~ ~ {Tags:["hats.rng_seed"]} +execute store result score #hats_lcg hats_math run data get entity @e[distance=..1,type=minecraft:area_effect_cloud,tag=hats.rng_seed,limit=1] UUIDMost 0.00000000023283064365386962890625 +kill @e[distance=..1,type=minecraft:area_effect_cloud,tag=hats.rng_seed,limit=1] \ No newline at end of file diff --git a/datapack/data/hats/functions/math/rng-rec.mcfunction b/datapack/data/hats/functions/math/rng-rec.mcfunction new file mode 100644 index 0000000..f9c0e23 --- /dev/null +++ b/datapack/data/hats/functions/math/rng-rec.mcfunction @@ -0,0 +1,14 @@ +# Calculate next lcg value +function hats:math/lcg + +# Store current lcg value in 'rand_num' and 'tmp' +scoreboard players operation #hats_rand_num hats_math = #hats_lcg hats_math +scoreboard players operation #hats_tmp hats_math = #hats_lcg hats_math + +# Calculate random number inside range +scoreboard players operation #hats_rand_num hats_math %= #hats_rng_range hats_math +scoreboard players operation #hats_tmp hats_math -= #hats_rand_num hats_math +scoreboard players operation #hats_tmp hats_math += #hats_m hats_math + +# Loop if value is negative +execute if score #hats_tmp hats_math matches ..-1 run function hats:math/lcg_next \ No newline at end of file diff --git a/datapack/data/hats/functions/math/rng.mcfunction b/datapack/data/hats/functions/math/rng.mcfunction new file mode 100644 index 0000000..55364a8 --- /dev/null +++ b/datapack/data/hats/functions/math/rng.mcfunction @@ -0,0 +1,9 @@ +# descr: Calculates a random number. +# Lower (inclusive) bound is 0, upper (exclusive) bound is score 'hats_math' of player '#hats_rng_range' + +# m = range - 1 +scoreboard players operation #hats_m hats_math = #hats_rng_range hats_math +scoreboard players remove #hats_m hats_math 1 + +# Calculate random number inside range +function hats:math/rng-rec \ No newline at end of file diff --git a/datapack/data/hats/functions/uninstall.mcfunction b/datapack/data/hats/functions/uninstall.mcfunction index a6e2fdd..f841df2 100644 --- a/datapack/data/hats/functions/uninstall.mcfunction +++ b/datapack/data/hats/functions/uninstall.mcfunction @@ -3,6 +3,7 @@ # Remove Scoreboards scoreboard objectives remove hats_min_price scoreboard objectives remove hats_max_price +scoreboard objectives remove hats_math # Remove storage data remove storage minecraft:hats buffer From 1c8d49493f24507205ba5abd1599b831e4c7faa2 Mon Sep 17 00:00:00 2001 From: OraneUtan Date: Sat, 23 May 2020 20:59:54 +0200 Subject: [PATCH 32/58] Villagers are now using the random number generator to set their prices --- .../villager/add_fav_cat_trade.mcfunction | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/datapack/data/hats/functions/dress/villager/add_fav_cat_trade.mcfunction b/datapack/data/hats/functions/dress/villager/add_fav_cat_trade.mcfunction index d8fb897..a75da80 100644 --- a/datapack/data/hats/functions/dress/villager/add_fav_cat_trade.mcfunction +++ b/datapack/data/hats/functions/dress/villager/add_fav_cat_trade.mcfunction @@ -7,12 +7,17 @@ data modify entity @s Offers.Recipes append value {buy:{id:"minecraft:emerald", # Set the sell item of the template offer to the cat hat on the villagers head data modify entity @s Offers.Recipes[-1].sell.tag set from entity @s ArmorItems[3].tag -# Set random price -scoreboard players set @s hats_min_price 15 -scoreboard players set @s hats_max_price 30 +#-----------------# +# Set offer price # +#-----------------# -loot replace entity @s weapon.offhand loot hats:trades/rand_price -data modify entity @s Offers.Recipes[-1].buy.Count set from entity @s HandItems[1].Count +# Random number in range [0,15] +scoreboard players set #hats_rng_range hats_math 16 +function hats:math/rng +scoreboard players get #hats_rand_num hats_math -scoreboard players reset @s hats_min_price -scoreboard players reset @s hats_max_price \ No newline at end of file +# Random number in range [15,30] +scoreboard players add #hats_rand_num hats_math 15 + +# Set price of last added offer to random number +execute store result entity @s Offers.Recipes[-1].buy.Count byte 1 run scoreboard players get #hats_rand_num hats_math \ No newline at end of file From e7841e8106fa8f52f10eb4c50dcf3cf8e564e9e7 Mon Sep 17 00:00:00 2001 From: OraneUtan Date: Sat, 23 May 2020 21:10:18 +0200 Subject: [PATCH 33/58] Using loot_tables instead of lcg to set Villager prices --- .../villager/add_fav_cat_trade.mcfunction | 19 ++++----------- .../trades/prices/villager_fav_cat.json | 23 +++++++++++++++++++ 2 files changed, 27 insertions(+), 15 deletions(-) create mode 100644 datapack/data/hats/loot_tables/trades/prices/villager_fav_cat.json diff --git a/datapack/data/hats/functions/dress/villager/add_fav_cat_trade.mcfunction b/datapack/data/hats/functions/dress/villager/add_fav_cat_trade.mcfunction index a75da80..415df18 100644 --- a/datapack/data/hats/functions/dress/villager/add_fav_cat_trade.mcfunction +++ b/datapack/data/hats/functions/dress/villager/add_fav_cat_trade.mcfunction @@ -2,22 +2,11 @@ # Descr: Adds offer of the favorite cat the Villager Trader is wearing # Add template offer -data modify entity @s Offers.Recipes append value {buy:{id:"minecraft:emerald", Count:1b}, sell:{id:"minecraft:leather_helmet",Count:1b,tag:{CustomModelData:0,Tags:["is_hat"]}}} +data modify entity @s Offers.Recipes append value {sell:{id:"minecraft:leather_helmet",Count:1b,tag:{CustomModelData:0,Tags:["is_hat"]}}} # Set the sell item of the template offer to the cat hat on the villagers head data modify entity @s Offers.Recipes[-1].sell.tag set from entity @s ArmorItems[3].tag -#-----------------# -# Set offer price # -#-----------------# - -# Random number in range [0,15] -scoreboard players set #hats_rng_range hats_math 16 -function hats:math/rng -scoreboard players get #hats_rand_num hats_math - -# Random number in range [15,30] -scoreboard players add #hats_rand_num hats_math 15 - -# Set price of last added offer to random number -execute store result entity @s Offers.Recipes[-1].buy.Count byte 1 run scoreboard players get #hats_rand_num hats_math \ No newline at end of file +# Set offer price +loot replace entity @s weapon.offhand loot hats:trades/prices/villager_fav_cat +data modify entity @s Offers.Recipes[-1].buy set from entity @s HandItems[1] \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/trades/prices/villager_fav_cat.json b/datapack/data/hats/loot_tables/trades/prices/villager_fav_cat.json new file mode 100644 index 0000000..6059647 --- /dev/null +++ b/datapack/data/hats/loot_tables/trades/prices/villager_fav_cat.json @@ -0,0 +1,23 @@ +{ + "type": "minecraft:generic", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:emerald", + "functions": [ + { + "function": "set_count", + "count": { + "min": 15, + "max": 30 + } + } + ] + } + ] + } + ] +} \ No newline at end of file From 61241b2a1ae51d985d0cf53723b737e7ac7c5555 Mon Sep 17 00:00:00 2001 From: OraneUtan Date: Sat, 23 May 2020 21:14:58 +0200 Subject: [PATCH 34/58] Villager special offer prices are now set via loot_table --- .../villager/add_special_trade.mcfunction | 18 ++++----------- .../trades/prices/villager_special.json | 23 +++++++++++++++++++ 2 files changed, 28 insertions(+), 13 deletions(-) create mode 100644 datapack/data/hats/loot_tables/trades/prices/villager_special.json diff --git a/datapack/data/hats/functions/dress/villager/add_special_trade.mcfunction b/datapack/data/hats/functions/dress/villager/add_special_trade.mcfunction index ae5eef3..c601506 100644 --- a/datapack/data/hats/functions/dress/villager/add_special_trade.mcfunction +++ b/datapack/data/hats/functions/dress/villager/add_special_trade.mcfunction @@ -1,21 +1,13 @@ -################################################################################### -# as: Villager/Wandering Trader # -# Descr: Adds profession dependent special offer to the Villager/Wandering Trader # -################################################################################### +# executor: Villager beeing dressed +# descr: Adds profession dependent special offer to the Villager # Add special offer data modify entity @s Offers.Recipes append value {buy:{id:"minecraft:emerald", Count:1b}, sell:{id:"minecraft:leather_helmet",Count:1b,tag:{Tags:["is_hat"]}}} data modify entity @s Offers.Recipes[-1].sell.tag merge from entity @s HandItems[1].tag -# Set random price -scoreboard players set @s hats_min_price 15 -scoreboard players set @s hats_max_price 25 - -loot replace entity @s weapon.offhand loot hats:trades/rand_price -data modify entity @s Offers.Recipes[-1].buy.Count set from entity @s HandItems[1].Count - -scoreboard players reset @s hats_min_price -scoreboard players reset @s hats_max_price +# Set offer price +loot replace entity @s weapon.offhand loot hats:trades/prices/villager_special +data modify entity @s Offers.Recipes[-1].buy set from entity @s HandItems[1] # Clean up replaceitem entity @s weapon.offhand minecraft:air \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/trades/prices/villager_special.json b/datapack/data/hats/loot_tables/trades/prices/villager_special.json new file mode 100644 index 0000000..531c381 --- /dev/null +++ b/datapack/data/hats/loot_tables/trades/prices/villager_special.json @@ -0,0 +1,23 @@ +{ + "type": "minecraft:generic", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:emerald", + "functions": [ + { + "function": "set_count", + "count": { + "min": 15, + "max": 25 + } + } + ] + } + ] + } + ] +} \ No newline at end of file From 1bdf3afb419748a2c67aeb293bf260ff5064eb66 Mon Sep 17 00:00:00 2001 From: OraneUtan Date: Sat, 23 May 2020 21:22:46 +0200 Subject: [PATCH 35/58] Wandering Trader favorite cat offer price now set via loot_table --- .../add_fav_cat_trade.mcfunction | 12 +++------- .../wandering_trader/fav_cat_price.json | 23 +++++++++++++++++++ .../wandering_trader/chance_has_fav_cat.json | 2 +- 3 files changed, 27 insertions(+), 10 deletions(-) create mode 100644 datapack/data/hats/loot_tables/trades/wandering_trader/fav_cat_price.json diff --git a/datapack/data/hats/functions/dress/wandering_trader/add_fav_cat_trade.mcfunction b/datapack/data/hats/functions/dress/wandering_trader/add_fav_cat_trade.mcfunction index 4c9b373..d37ab2f 100644 --- a/datapack/data/hats/functions/dress/wandering_trader/add_fav_cat_trade.mcfunction +++ b/datapack/data/hats/functions/dress/wandering_trader/add_fav_cat_trade.mcfunction @@ -7,12 +7,6 @@ data modify entity @s Offers.Recipes append value {buy:{id:"minecraft:emerald", # Set the sell item of the template offer to the cat hat on the Wandering Traders head data modify entity @s Offers.Recipes[-1].sell.tag set from entity @s ArmorItems[3].tag -# Set random price -scoreboard players set @s hats_min_price 15 -scoreboard players set @s hats_max_price 30 - -loot replace entity @s weapon.offhand loot hats:trades/rand_price -data modify entity @s Offers.Recipes[-1].buy.Count set from entity @s HandItems[1].Count - -scoreboard players reset @s hats_min_price -scoreboard players reset @s hats_max_price \ No newline at end of file +# Set offer price +loot replace entity @s weapon.offhand loot hats:trades/wandering_trader/fav_cat_price +data modify entity @s Offers.Recipes[-1].buy set from entity @s HandItems[1] \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/trades/wandering_trader/fav_cat_price.json b/datapack/data/hats/loot_tables/trades/wandering_trader/fav_cat_price.json new file mode 100644 index 0000000..13095e5 --- /dev/null +++ b/datapack/data/hats/loot_tables/trades/wandering_trader/fav_cat_price.json @@ -0,0 +1,23 @@ +{ + "type": "minecraft:generic", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:emerald", + "functions": [ + { + "function": "set_count", + "count": { + "min": 10, + "max": 25 + } + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/datapack/data/hats/predicates/wandering_trader/chance_has_fav_cat.json b/datapack/data/hats/predicates/wandering_trader/chance_has_fav_cat.json index 489b402..3d87ff2 100644 --- a/datapack/data/hats/predicates/wandering_trader/chance_has_fav_cat.json +++ b/datapack/data/hats/predicates/wandering_trader/chance_has_fav_cat.json @@ -1,4 +1,4 @@ { "condition": "minecraft:random_chance", - "chance": 0.5 + "chance": 0.333 } \ No newline at end of file From 6451f5aa69f6c9c97a049877d3aa9698d025056c Mon Sep 17 00:00:00 2001 From: OraneUtan Date: Sat, 23 May 2020 21:26:45 +0200 Subject: [PATCH 36/58] Removed unnecessary Scoreboards and disabled lcg --- datapack/data/hats/functions/load.mcfunction | 30 ++++--------------- .../data/hats/functions/uninstall.mcfunction | 4 +-- 2 files changed, 7 insertions(+), 27 deletions(-) diff --git a/datapack/data/hats/functions/load.mcfunction b/datapack/data/hats/functions/load.mcfunction index 2821f15..04e7cf7 100644 --- a/datapack/data/hats/functions/load.mcfunction +++ b/datapack/data/hats/functions/load.mcfunction @@ -1,29 +1,11 @@ -######################################## -# as: World # -# Descr: Initialises the Hats datapack # -######################################## +# executor: World +# descr: Initialises the datapack -#-----------------# -# Add Scoreboards # -#-----------------# +# Initialise random number generator (currently disabled) +#scoreboard objectives add hats_math dummy +#function hats:math/lcg_init -scoreboard objectives add hats_min_price dummy -scoreboard objectives add hats_max_price dummy -scoreboard objectives add hats_math dummy - -# Initialise random number generator -function hats:math/lcg_init - -#---------------------------------------# -# Start repeating 'dress_mobs' function # -#---------------------------------------# - -# Dresses new mobs with hats every x seconds -function hats:dress/dress_mobs_with_hats - -#----------------------# -# Start tick functions # -#----------------------# +# Start tick functions function hats:every_3t function hats:every_5s function hats:every_60s \ No newline at end of file diff --git a/datapack/data/hats/functions/uninstall.mcfunction b/datapack/data/hats/functions/uninstall.mcfunction index f841df2..a2402a5 100644 --- a/datapack/data/hats/functions/uninstall.mcfunction +++ b/datapack/data/hats/functions/uninstall.mcfunction @@ -1,9 +1,7 @@ # descr: Remove all Hats related from the world # Remove Scoreboards -scoreboard objectives remove hats_min_price -scoreboard objectives remove hats_max_price -scoreboard objectives remove hats_math +# scoreboard objectives remove hats_math # Remove storage data remove storage minecraft:hats buffer From 9180656787c69e5a4ced62ac5175513742b14a2b Mon Sep 17 00:00:00 2001 From: OraneUtan Date: Sat, 23 May 2020 21:30:38 +0200 Subject: [PATCH 37/58] Removed rand_price loot_table --- .../hats/loot_tables/trades/rand_price.json | 56 ------------------- 1 file changed, 56 deletions(-) delete mode 100644 datapack/data/hats/loot_tables/trades/rand_price.json diff --git a/datapack/data/hats/loot_tables/trades/rand_price.json b/datapack/data/hats/loot_tables/trades/rand_price.json deleted file mode 100644 index d3b45e1..0000000 --- a/datapack/data/hats/loot_tables/trades/rand_price.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "type": "generic", - "pools": [ - { - "rolls": 1, - "entries": [ - { - "type": "item", - "name": "minecraft:emerald", - "conditions": [ - { - "condition": "entity_scores", - "entity": "this", - "scores": { - "hats_min_price": 15, - "hats_max_price": 25 - } - } - ], - "functions": [ - { - "function": "set_count", - "count": { - "min": 15, - "max": 25 - } - } - ] - }, - { - "type": "item", - "name": "minecraft:emerald", - "conditions": [ - { - "condition": "entity_scores", - "entity": "this", - "scores": { - "hats_min_price": 15, - "hats_max_price": 30 - } - } - ], - "functions": [ - { - "function": "set_count", - "count": { - "min": 15, - "max": 30 - } - } - ] - } - ] - } - ] -} \ No newline at end of file From b4b381d5c6bcbdd4e7f344e05e457861c2c06b9b Mon Sep 17 00:00:00 2001 From: OraneUtan Date: Sat, 23 May 2020 21:33:44 +0200 Subject: [PATCH 38/58] Moved both Villager trades and their prices into 'trades/villager' --- datapack/data/hats/functions/dress/villager.mcfunction | 8 ++++---- .../functions/dress/villager/add_fav_cat_trade.mcfunction | 2 +- .../functions/dress/villager/add_special_trade.mcfunction | 2 +- .../hats/loot_tables/trades/{ => villager}/armorer.json | 0 .../hats/loot_tables/trades/{ => villager}/farmer.json | 0 .../villager_fav_cat.json => villager/fav_cat_price.json} | 0 .../hats/loot_tables/trades/{ => villager}/librarian.json | 0 .../villager_special.json => villager/special_price.json} | 0 .../hats/loot_tables/trades/{ => villager}/toolsmith.json | 0 9 files changed, 6 insertions(+), 6 deletions(-) rename datapack/data/hats/loot_tables/trades/{ => villager}/armorer.json (100%) rename datapack/data/hats/loot_tables/trades/{ => villager}/farmer.json (100%) rename datapack/data/hats/loot_tables/trades/{prices/villager_fav_cat.json => villager/fav_cat_price.json} (100%) rename datapack/data/hats/loot_tables/trades/{ => villager}/librarian.json (100%) rename datapack/data/hats/loot_tables/trades/{prices/villager_special.json => villager/special_price.json} (100%) rename datapack/data/hats/loot_tables/trades/{ => villager}/toolsmith.json (100%) diff --git a/datapack/data/hats/functions/dress/villager.mcfunction b/datapack/data/hats/functions/dress/villager.mcfunction index dc04dbb..7198fb4 100644 --- a/datapack/data/hats/functions/dress/villager.mcfunction +++ b/datapack/data/hats/functions/dress/villager.mcfunction @@ -9,10 +9,10 @@ execute if predicate hats:villager/chance_has_fav_cat run function hats:dress/vi #-------------------------------------------------------------# # Give Villager random special sell item (or none) depending on profession -execute as @s[nbt={VillagerData:{profession:"minecraft:librarian"}}] run loot replace entity @s weapon.offhand loot hats:trades/librarian -execute as @s[nbt={VillagerData:{profession:"minecraft:armorer"}}] run loot replace entity @s weapon.offhand loot hats:trades/armorer -execute as @s[nbt={VillagerData:{profession:"minecraft:farmer"}}] run loot replace entity @s weapon.offhand loot hats:trades/farmer -execute as @s[nbt={VillagerData:{profession:"minecraft:toolsmith"}}] run loot replace entity @s weapon.offhand loot hats:trades/toolsmith +execute as @s[nbt={VillagerData:{profession:"minecraft:librarian"}}] run loot replace entity @s weapon.offhand loot hats:trades/villager/librarian +execute as @s[nbt={VillagerData:{profession:"minecraft:armorer"}}] run loot replace entity @s weapon.offhand loot hats:trades/villager/armorer +execute as @s[nbt={VillagerData:{profession:"minecraft:farmer"}}] run loot replace entity @s weapon.offhand loot hats:trades/villager/farmer +execute as @s[nbt={VillagerData:{profession:"minecraft:toolsmith"}}] run loot replace entity @s weapon.offhand loot hats:trades/villager/toolsmith # Add special offer if Villager is holding a special item execute as @s[nbt={HandItems:[{},{tag:{Tags:["is_hat"]}}]}] run function hats:dress/villager/add_special_trade diff --git a/datapack/data/hats/functions/dress/villager/add_fav_cat_trade.mcfunction b/datapack/data/hats/functions/dress/villager/add_fav_cat_trade.mcfunction index 415df18..392a947 100644 --- a/datapack/data/hats/functions/dress/villager/add_fav_cat_trade.mcfunction +++ b/datapack/data/hats/functions/dress/villager/add_fav_cat_trade.mcfunction @@ -8,5 +8,5 @@ data modify entity @s Offers.Recipes append value {sell:{id:"minecraft:leather_h data modify entity @s Offers.Recipes[-1].sell.tag set from entity @s ArmorItems[3].tag # Set offer price -loot replace entity @s weapon.offhand loot hats:trades/prices/villager_fav_cat +loot replace entity @s weapon.offhand loot hats:trades/villager/fav_cat_price data modify entity @s Offers.Recipes[-1].buy set from entity @s HandItems[1] \ No newline at end of file diff --git a/datapack/data/hats/functions/dress/villager/add_special_trade.mcfunction b/datapack/data/hats/functions/dress/villager/add_special_trade.mcfunction index c601506..eae6abe 100644 --- a/datapack/data/hats/functions/dress/villager/add_special_trade.mcfunction +++ b/datapack/data/hats/functions/dress/villager/add_special_trade.mcfunction @@ -6,7 +6,7 @@ data modify entity @s Offers.Recipes append value {buy:{id:"minecraft:emerald", data modify entity @s Offers.Recipes[-1].sell.tag merge from entity @s HandItems[1].tag # Set offer price -loot replace entity @s weapon.offhand loot hats:trades/prices/villager_special +loot replace entity @s weapon.offhand loot hats:trades/villager/special_price data modify entity @s Offers.Recipes[-1].buy set from entity @s HandItems[1] # Clean up diff --git a/datapack/data/hats/loot_tables/trades/armorer.json b/datapack/data/hats/loot_tables/trades/villager/armorer.json similarity index 100% rename from datapack/data/hats/loot_tables/trades/armorer.json rename to datapack/data/hats/loot_tables/trades/villager/armorer.json diff --git a/datapack/data/hats/loot_tables/trades/farmer.json b/datapack/data/hats/loot_tables/trades/villager/farmer.json similarity index 100% rename from datapack/data/hats/loot_tables/trades/farmer.json rename to datapack/data/hats/loot_tables/trades/villager/farmer.json diff --git a/datapack/data/hats/loot_tables/trades/prices/villager_fav_cat.json b/datapack/data/hats/loot_tables/trades/villager/fav_cat_price.json similarity index 100% rename from datapack/data/hats/loot_tables/trades/prices/villager_fav_cat.json rename to datapack/data/hats/loot_tables/trades/villager/fav_cat_price.json diff --git a/datapack/data/hats/loot_tables/trades/librarian.json b/datapack/data/hats/loot_tables/trades/villager/librarian.json similarity index 100% rename from datapack/data/hats/loot_tables/trades/librarian.json rename to datapack/data/hats/loot_tables/trades/villager/librarian.json diff --git a/datapack/data/hats/loot_tables/trades/prices/villager_special.json b/datapack/data/hats/loot_tables/trades/villager/special_price.json similarity index 100% rename from datapack/data/hats/loot_tables/trades/prices/villager_special.json rename to datapack/data/hats/loot_tables/trades/villager/special_price.json diff --git a/datapack/data/hats/loot_tables/trades/toolsmith.json b/datapack/data/hats/loot_tables/trades/villager/toolsmith.json similarity index 100% rename from datapack/data/hats/loot_tables/trades/toolsmith.json rename to datapack/data/hats/loot_tables/trades/villager/toolsmith.json From c7e1c83b72421c04a2f100aee6ae7cfa93e4c36e Mon Sep 17 00:00:00 2001 From: OraneUtan Date: Sat, 23 May 2020 21:51:20 +0200 Subject: [PATCH 39/58] Removed random number generator :c --- datapack/data/hats/functions/load.mcfunction | 4 ---- datapack/data/hats/functions/math/lcg.mcfunction | 5 ----- .../data/hats/functions/math/lcg_init.mcfunction | 8 -------- .../hats/functions/math/lcg_new_seed.mcfunction | 3 --- .../data/hats/functions/math/rng-rec.mcfunction | 14 -------------- datapack/data/hats/functions/math/rng.mcfunction | 9 --------- datapack/data/hats/functions/uninstall.mcfunction | 3 --- 7 files changed, 46 deletions(-) delete mode 100644 datapack/data/hats/functions/math/lcg.mcfunction delete mode 100644 datapack/data/hats/functions/math/lcg_init.mcfunction delete mode 100644 datapack/data/hats/functions/math/lcg_new_seed.mcfunction delete mode 100644 datapack/data/hats/functions/math/rng-rec.mcfunction delete mode 100644 datapack/data/hats/functions/math/rng.mcfunction diff --git a/datapack/data/hats/functions/load.mcfunction b/datapack/data/hats/functions/load.mcfunction index 04e7cf7..6405a17 100644 --- a/datapack/data/hats/functions/load.mcfunction +++ b/datapack/data/hats/functions/load.mcfunction @@ -1,10 +1,6 @@ # executor: World # descr: Initialises the datapack -# Initialise random number generator (currently disabled) -#scoreboard objectives add hats_math dummy -#function hats:math/lcg_init - # Start tick functions function hats:every_3t function hats:every_5s diff --git a/datapack/data/hats/functions/math/lcg.mcfunction b/datapack/data/hats/functions/math/lcg.mcfunction deleted file mode 100644 index 444c182..0000000 --- a/datapack/data/hats/functions/math/lcg.mcfunction +++ /dev/null @@ -1,5 +0,0 @@ -# Linear congruential generator (Random number generator). Calculates a pseudo-random number. -# Formula: x_{n+1} = x_n * 1103515245 + 12345 - -scoreboard players operation #hats_lcg hats_math *= #hats_lcg_mult hats_math -scoreboard players add #hats_lcg hats_math 12345 \ No newline at end of file diff --git a/datapack/data/hats/functions/math/lcg_init.mcfunction b/datapack/data/hats/functions/math/lcg_init.mcfunction deleted file mode 100644 index c83b2ba..0000000 --- a/datapack/data/hats/functions/math/lcg_init.mcfunction +++ /dev/null @@ -1,8 +0,0 @@ -# lcg_mult: Constant used for multiplication by lcg -scoreboard players set #hats_lcg_mult hats_math 1103515245 - -# Set a default rng range -scoreboard players set #hats_rng_range hats_math 100 - -# Seed lcg -function hats:math/lcg_new_seed \ No newline at end of file diff --git a/datapack/data/hats/functions/math/lcg_new_seed.mcfunction b/datapack/data/hats/functions/math/lcg_new_seed.mcfunction deleted file mode 100644 index cb2a1ae..0000000 --- a/datapack/data/hats/functions/math/lcg_new_seed.mcfunction +++ /dev/null @@ -1,3 +0,0 @@ -summon minecraft:area_effect_cloud ~ ~ ~ {Tags:["hats.rng_seed"]} -execute store result score #hats_lcg hats_math run data get entity @e[distance=..1,type=minecraft:area_effect_cloud,tag=hats.rng_seed,limit=1] UUIDMost 0.00000000023283064365386962890625 -kill @e[distance=..1,type=minecraft:area_effect_cloud,tag=hats.rng_seed,limit=1] \ No newline at end of file diff --git a/datapack/data/hats/functions/math/rng-rec.mcfunction b/datapack/data/hats/functions/math/rng-rec.mcfunction deleted file mode 100644 index f9c0e23..0000000 --- a/datapack/data/hats/functions/math/rng-rec.mcfunction +++ /dev/null @@ -1,14 +0,0 @@ -# Calculate next lcg value -function hats:math/lcg - -# Store current lcg value in 'rand_num' and 'tmp' -scoreboard players operation #hats_rand_num hats_math = #hats_lcg hats_math -scoreboard players operation #hats_tmp hats_math = #hats_lcg hats_math - -# Calculate random number inside range -scoreboard players operation #hats_rand_num hats_math %= #hats_rng_range hats_math -scoreboard players operation #hats_tmp hats_math -= #hats_rand_num hats_math -scoreboard players operation #hats_tmp hats_math += #hats_m hats_math - -# Loop if value is negative -execute if score #hats_tmp hats_math matches ..-1 run function hats:math/lcg_next \ No newline at end of file diff --git a/datapack/data/hats/functions/math/rng.mcfunction b/datapack/data/hats/functions/math/rng.mcfunction deleted file mode 100644 index 55364a8..0000000 --- a/datapack/data/hats/functions/math/rng.mcfunction +++ /dev/null @@ -1,9 +0,0 @@ -# descr: Calculates a random number. -# Lower (inclusive) bound is 0, upper (exclusive) bound is score 'hats_math' of player '#hats_rng_range' - -# m = range - 1 -scoreboard players operation #hats_m hats_math = #hats_rng_range hats_math -scoreboard players remove #hats_m hats_math 1 - -# Calculate random number inside range -function hats:math/rng-rec \ No newline at end of file diff --git a/datapack/data/hats/functions/uninstall.mcfunction b/datapack/data/hats/functions/uninstall.mcfunction index a2402a5..fda5fa5 100644 --- a/datapack/data/hats/functions/uninstall.mcfunction +++ b/datapack/data/hats/functions/uninstall.mcfunction @@ -1,8 +1,5 @@ # descr: Remove all Hats related from the world -# Remove Scoreboards -# scoreboard objectives remove hats_math - # Remove storage data remove storage minecraft:hats buffer From b7b36ffa87732f5e6cdbbfe067fcc9dd06118b3d Mon Sep 17 00:00:00 2001 From: OraneUtan Date: Sat, 23 May 2020 23:55:52 +0200 Subject: [PATCH 40/58] Added predicates to control if Villager should have profession trait --- .../villager/can_have_profession_trade.json | 33 +++++++++++++++++++ .../villager/chance_has_profession_trade.json | 4 +++ 2 files changed, 37 insertions(+) create mode 100644 datapack/data/hats/predicates/villager/can_have_profession_trade.json create mode 100644 datapack/data/hats/predicates/villager/chance_has_profession_trade.json diff --git a/datapack/data/hats/predicates/villager/can_have_profession_trade.json b/datapack/data/hats/predicates/villager/can_have_profession_trade.json new file mode 100644 index 0000000..a60fe32 --- /dev/null +++ b/datapack/data/hats/predicates/villager/can_have_profession_trade.json @@ -0,0 +1,33 @@ +{ + "condition": "minecraft:alternative", + "terms": [ + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "nbt": "{VillagerData:{profession:\"minecraft:armorer\"}}" + } + }, + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "nbt": "{VillagerData:{profession:\"minecraft:farmer\"}}" + } + }, + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "nbt": "{VillagerData:{profession:\"minecraft:librarian\"}}" + } + }, + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "nbt": "{VillagerData:{profession:\"minecraft:toolsmith\"}}" + } + } + ] +} \ No newline at end of file diff --git a/datapack/data/hats/predicates/villager/chance_has_profession_trade.json b/datapack/data/hats/predicates/villager/chance_has_profession_trade.json new file mode 100644 index 0000000..3aa95a2 --- /dev/null +++ b/datapack/data/hats/predicates/villager/chance_has_profession_trade.json @@ -0,0 +1,4 @@ +{ + "condition": "minecraft:random_chance", + "chance": 0.6 +} \ No newline at end of file From 762f38f55a20cbb4ba021bfc8b626f6070077aaa Mon Sep 17 00:00:00 2001 From: OraneUtan Date: Sun, 24 May 2020 00:02:53 +0200 Subject: [PATCH 41/58] Fix: Villager profession trades show up again In 1.15 it is no longer possible to put a helmet into a Villagers offhand. Moved all profession specific loot tables into one and fixed the bug by using stick hats instead. --- .../hats/functions/dress/villager.mcfunction | 14 +-- ...nction => add_profession_trade.mcfunction} | 14 +-- .../loot_tables/trades/villager/armorer.json | 19 ---- .../loot_tables/trades/villager/farmer.json | 19 ---- .../trades/villager/librarian.json | 35 -------- .../trades/villager/profession.json | 87 +++++++++++++++++++ .../trades/villager/toolsmith.json | 19 ---- 7 files changed, 96 insertions(+), 111 deletions(-) rename datapack/data/hats/functions/dress/villager/{add_special_trade.mcfunction => add_profession_trade.mcfunction} (61%) delete mode 100644 datapack/data/hats/loot_tables/trades/villager/armorer.json delete mode 100644 datapack/data/hats/loot_tables/trades/villager/farmer.json delete mode 100644 datapack/data/hats/loot_tables/trades/villager/librarian.json create mode 100644 datapack/data/hats/loot_tables/trades/villager/profession.json delete mode 100644 datapack/data/hats/loot_tables/trades/villager/toolsmith.json diff --git a/datapack/data/hats/functions/dress/villager.mcfunction b/datapack/data/hats/functions/dress/villager.mcfunction index 7198fb4..283f44f 100644 --- a/datapack/data/hats/functions/dress/villager.mcfunction +++ b/datapack/data/hats/functions/dress/villager.mcfunction @@ -4,18 +4,8 @@ # Add optional favorite cat hat execute if predicate hats:villager/chance_has_fav_cat run function hats:dress/villager/add_fav_cat -#-------------------------------------------------------------# -# Give Villager optinal special trade depending on profession # -#-------------------------------------------------------------# - -# Give Villager random special sell item (or none) depending on profession -execute as @s[nbt={VillagerData:{profession:"minecraft:librarian"}}] run loot replace entity @s weapon.offhand loot hats:trades/villager/librarian -execute as @s[nbt={VillagerData:{profession:"minecraft:armorer"}}] run loot replace entity @s weapon.offhand loot hats:trades/villager/armorer -execute as @s[nbt={VillagerData:{profession:"minecraft:farmer"}}] run loot replace entity @s weapon.offhand loot hats:trades/villager/farmer -execute as @s[nbt={VillagerData:{profession:"minecraft:toolsmith"}}] run loot replace entity @s weapon.offhand loot hats:trades/villager/toolsmith - -# Add special offer if Villager is holding a special item -execute as @s[nbt={HandItems:[{},{tag:{Tags:["is_hat"]}}]}] run function hats:dress/villager/add_special_trade +# Add optional trade depending on profession +execute if predicate hats:villager/can_have_profession_trade if predicate hats:villager/chance_has_profession_trade run function hats:dress/villager/add_profession_trade #--------------------------# # Mark Villager as dressed # diff --git a/datapack/data/hats/functions/dress/villager/add_special_trade.mcfunction b/datapack/data/hats/functions/dress/villager/add_profession_trade.mcfunction similarity index 61% rename from datapack/data/hats/functions/dress/villager/add_special_trade.mcfunction rename to datapack/data/hats/functions/dress/villager/add_profession_trade.mcfunction index eae6abe..d813cfa 100644 --- a/datapack/data/hats/functions/dress/villager/add_special_trade.mcfunction +++ b/datapack/data/hats/functions/dress/villager/add_profession_trade.mcfunction @@ -1,13 +1,13 @@ # executor: Villager beeing dressed # descr: Adds profession dependent special offer to the Villager -# Add special offer -data modify entity @s Offers.Recipes append value {buy:{id:"minecraft:emerald", Count:1b}, sell:{id:"minecraft:leather_helmet",Count:1b,tag:{Tags:["is_hat"]}}} -data modify entity @s Offers.Recipes[-1].sell.tag merge from entity @s HandItems[1].tag +# Add template offer +data modify entity @s Offers.Recipes append value {buy:{id:"minecraft:emerald", Count:1b}, sell:{id:"minecraft:leather_helmet",Count:1b}} + +# Give Villager item depending on profession +loot replace entity @s weapon.offhand loot hats:trades/villager/profession +data modify entity @s Offers.Recipes[-1].sell.tag set from entity @s HandItems[1].tag # Set offer price loot replace entity @s weapon.offhand loot hats:trades/villager/special_price -data modify entity @s Offers.Recipes[-1].buy set from entity @s HandItems[1] - -# Clean up -replaceitem entity @s weapon.offhand minecraft:air \ No newline at end of file +data modify entity @s Offers.Recipes[-1].buy set from entity @s HandItems[1] \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/trades/villager/armorer.json b/datapack/data/hats/loot_tables/trades/villager/armorer.json deleted file mode 100644 index daf50a8..0000000 --- a/datapack/data/hats/loot_tables/trades/villager/armorer.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "type": "generic", - "pools": [ - { - "rolls": 1, - "entries": [ - { - "weight": 5, - "type": "empty" - }, - { - "weight": 7, - "type": "minecraft:loot_table", - "name": "hats:hat/villager/armorer" - } - ] - } - ] -} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/trades/villager/farmer.json b/datapack/data/hats/loot_tables/trades/villager/farmer.json deleted file mode 100644 index 2a3a9c4..0000000 --- a/datapack/data/hats/loot_tables/trades/villager/farmer.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "type": "generic", - "pools": [ - { - "rolls": 1, - "entries": [ - { - "weight": 1, - "type": "empty" - }, - { - "weight": 1, - "type": "minecraft:loot_table", - "name": "hats:hat/villager/farmer" - } - ] - } - ] -} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/trades/villager/librarian.json b/datapack/data/hats/loot_tables/trades/villager/librarian.json deleted file mode 100644 index 10cf4ac..0000000 --- a/datapack/data/hats/loot_tables/trades/villager/librarian.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "type": "generic", - "pools": [ - { - "rolls": 1, - "entries": [ - { - "weight": 3, - "type": "empty" - }, - { - "type": "group", - "name": "glasses", - "children": [ - { - "weight": 1, - "type": "minecraft:loot_table", - "name": "hats:hat/glasses/half_rim" - }, - { - "weight": 1, - "type": "minecraft:loot_table", - "name": "hats:hat/glasses/rainbow" - }, - { - "weight": 1, - "type": "minecraft:loot_table", - "name": "hats:hat/glasses/librarian" - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/trades/villager/profession.json b/datapack/data/hats/loot_tables/trades/villager/profession.json new file mode 100644 index 0000000..74c3766 --- /dev/null +++ b/datapack/data/hats/loot_tables/trades/villager/profession.json @@ -0,0 +1,87 @@ +{ + "type": "minecraft:generic", + "pools": [ + { + "conditions": [ + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "nbt": "{VillagerData:{profession:\"minecraft:armorer\"}}" + } + } + ], + "rolls": 1, + "entries": [ + { + "type": "minecraft:loot_table", + "name": "hats:hat_on_head/villager/armorer" + } + ] + }, + { + "conditions": [ + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "nbt": "{VillagerData:{profession:\"minecraft:farmer\"}}" + } + } + ], + "rolls": 1, + "entries": [ + { + "type": "minecraft:loot_table", + "name": "hats:hat_on_head/villager/farmer" + } + ] + + }, + { + "conditions": [ + + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "nbt": "{VillagerData:{profession:\"minecraft:librarian\"}}" + } + } + ], + "rolls": 1, + "entries": [ + { + "type": "minecraft:loot_table", + "name": "hats:hat_on_head/glasses/half_rim" + }, + { + "type": "minecraft:loot_table", + "name": "hats:hat_on_head/glasses/rainbow" + }, + { + "type": "minecraft:loot_table", + "name": "hats:hat_on_head/glasses/librarian" + } + ] + }, + { + "conditions": [ + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "nbt": "{VillagerData:{profession:\"minecraft:toolsmith\"}}" + } + } + ], + "rolls": 1, + "entries": [ + { + "type": "minecraft:loot_table", + "name": "hats:hat_on_head/frying_pan" + } + ] + } + ] +} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/trades/villager/toolsmith.json b/datapack/data/hats/loot_tables/trades/villager/toolsmith.json deleted file mode 100644 index 8195b5c..0000000 --- a/datapack/data/hats/loot_tables/trades/villager/toolsmith.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "type": "generic", - "pools": [ - { - "rolls": 1, - "entries": [ - { - "weight": 1, - "type": "empty" - }, - { - "weight": 1, - "type": "minecraft:loot_table", - "name": "hats:hat/frying_pan" - } - ] - } - ] -} \ No newline at end of file From 5e6246ad4b3d7e419e919335e221985ee8208756 Mon Sep 17 00:00:00 2001 From: OraneUtan Date: Sun, 24 May 2020 00:04:53 +0200 Subject: [PATCH 42/58] Renamed 'special_price' to 'profession_price' --- .../functions/dress/villager/add_profession_trade.mcfunction | 2 +- .../villager/{special_price.json => profession_price.json} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename datapack/data/hats/loot_tables/trades/villager/{special_price.json => profession_price.json} (100%) diff --git a/datapack/data/hats/functions/dress/villager/add_profession_trade.mcfunction b/datapack/data/hats/functions/dress/villager/add_profession_trade.mcfunction index d813cfa..ba573b1 100644 --- a/datapack/data/hats/functions/dress/villager/add_profession_trade.mcfunction +++ b/datapack/data/hats/functions/dress/villager/add_profession_trade.mcfunction @@ -9,5 +9,5 @@ loot replace entity @s weapon.offhand loot hats:trades/villager/profession data modify entity @s Offers.Recipes[-1].sell.tag set from entity @s HandItems[1].tag # Set offer price -loot replace entity @s weapon.offhand loot hats:trades/villager/special_price +loot replace entity @s weapon.offhand loot hats:trades/villager/profession_price data modify entity @s Offers.Recipes[-1].buy set from entity @s HandItems[1] \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/trades/villager/special_price.json b/datapack/data/hats/loot_tables/trades/villager/profession_price.json similarity index 100% rename from datapack/data/hats/loot_tables/trades/villager/special_price.json rename to datapack/data/hats/loot_tables/trades/villager/profession_price.json From 82b2ecd737279ff9820fbd8ad57fe99c7249d6a7 Mon Sep 17 00:00:00 2001 From: OraneUtan Date: Sun, 24 May 2020 11:45:16 +0200 Subject: [PATCH 43/58] Added trade related to Villagers to the Wandering Trader --- build/generate_special_hat_loot_tables.py | 2 +- .../dress/wandering_trader.mcfunction | 19 ++++----------- .../add_villager_trade.mcfunction | 13 +++++++++++ .../hat_on_head/villager/_rand.json | 1 + .../loot_tables/trades/wandering_trader.json | 19 --------------- .../wandering_trader/villager_price.json | 23 +++++++++++++++++++ .../chance_has_villager_trade.json | 4 ++++ 7 files changed, 47 insertions(+), 34 deletions(-) create mode 100644 datapack/data/hats/functions/dress/wandering_trader/add_villager_trade.mcfunction create mode 100644 datapack/data/hats/loot_tables/hat_on_head/villager/_rand.json delete mode 100644 datapack/data/hats/loot_tables/trades/wandering_trader.json create mode 100644 datapack/data/hats/loot_tables/trades/wandering_trader/villager_price.json create mode 100644 datapack/data/hats/predicates/wandering_trader/chance_has_villager_trade.json diff --git a/build/generate_special_hat_loot_tables.py b/build/generate_special_hat_loot_tables.py index 8cd3a6b..c710cbb 100644 --- a/build/generate_special_hat_loot_tables.py +++ b/build/generate_special_hat_loot_tables.py @@ -73,5 +73,5 @@ def generate_loot_table_rand_for_category(category_name, category_hats, subfolde generate_loot_table_all_for_category(category_name, category_hats, 'hat') generate_loot_table_rand_for_category(category_name, category_hats, 'hat') - if category_name == 'cats': + if category_name == 'cats' or category_name == 'villager': generate_loot_table_rand_for_category(category_name, category_hats, 'hat_on_head') \ No newline at end of file diff --git a/datapack/data/hats/functions/dress/wandering_trader.mcfunction b/datapack/data/hats/functions/dress/wandering_trader.mcfunction index e545933..dec9274 100644 --- a/datapack/data/hats/functions/dress/wandering_trader.mcfunction +++ b/datapack/data/hats/functions/dress/wandering_trader.mcfunction @@ -1,20 +1,11 @@ -# as: The Wandering Trader beeing dressed -# Descr: Dress the Wandering Trader with a random hat and give it hat trades +# executor: The Wandering Trader beeing dressed +# descr: Try to dress the Wandering Trader with a hat and add some trades # Add optional favorite cat hat execute if predicate hats:wandering_trader/chance_has_fav_cat run function hats:dress/wandering_trader/add_fav_cat -#----------------------------------------------# -# Give Wandering Trader optional special trade # -#----------------------------------------------# +# Add optional Villager trade. This trade offers hats related to Villagers +execute if predicate hats:wandering_trader/chance_has_villager_trade run function hats:dress/wandering_trader/add_villager_trade -# Give Wandering Trader random special sell item (or none) -loot replace entity @s weapon.offhand loot hats:trades/wandering_trader - -# Add special offer if Wandering Trader is holding a special item -execute as @s[nbt={HandItems:[{},{tag:{Tags:["is_hat"]}}]}] run function hats:dress/villager/add_special_trade - -#----------------------------------# -# Mark Wandering Trader as dressed # -#----------------------------------# +# Mark Wandering Trader as dressed tag @s add hats.mob.dont_dress \ No newline at end of file diff --git a/datapack/data/hats/functions/dress/wandering_trader/add_villager_trade.mcfunction b/datapack/data/hats/functions/dress/wandering_trader/add_villager_trade.mcfunction new file mode 100644 index 0000000..c11824f --- /dev/null +++ b/datapack/data/hats/functions/dress/wandering_trader/add_villager_trade.mcfunction @@ -0,0 +1,13 @@ +# executor: Wandering Trader beeing dressed +# descr: Adds a hat trade related to Villagers + +# Add template offer that is modified later +data modify entity @s Offers.Recipes append value {buy:{id:"minecraft:emerald", Count:1b}, sell:{id:"minecraft:leather_helmet",Count:1b}} + +# Give trade sell item +loot replace entity @s weapon.offhand loot hats:hat_on_head/villager/_rand +data modify entity @s Offers.Recipes[-1].sell.tag set from entity @s HandItems[1].tag + +# Set offer price +loot replace entity @s weapon.offhand loot hats:trades/wandering_trader/villager_price +data modify entity @s Offers.Recipes[-1].buy set from entity @s HandItems[1] \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat_on_head/villager/_rand.json b/datapack/data/hats/loot_tables/hat_on_head/villager/_rand.json new file mode 100644 index 0000000..9d27094 --- /dev/null +++ b/datapack/data/hats/loot_tables/hat_on_head/villager/_rand.json @@ -0,0 +1 @@ +{"type": "minecraft:generic", "pools": [{"rolls": 1, "entries": [{"type": "minecraft:loot_table", "name": "hats:hat_on_head/villager/armorer"}, {"type": "minecraft:loot_table", "name": "hats:hat_on_head/villager/farmer"}, {"type": "minecraft:loot_table", "name": "hats:hat_on_head/villager/nose"}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/trades/wandering_trader.json b/datapack/data/hats/loot_tables/trades/wandering_trader.json deleted file mode 100644 index d073d47..0000000 --- a/datapack/data/hats/loot_tables/trades/wandering_trader.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "type": "generic", - "pools": [ - { - "rolls": 1, - "entries": [ - { - "weight": 3, - "type": "empty" - }, - { - "weight": 1, - "type": "minecraft:loot_table", - "name": "hats:hat/villager/nose" - } - ] - } - ] -} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/trades/wandering_trader/villager_price.json b/datapack/data/hats/loot_tables/trades/wandering_trader/villager_price.json new file mode 100644 index 0000000..8188e8f --- /dev/null +++ b/datapack/data/hats/loot_tables/trades/wandering_trader/villager_price.json @@ -0,0 +1,23 @@ +{ + "type": "minecraft:generic", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:emerald", + "functions": [ + { + "function": "set_count", + "count": { + "min": 10, + "max": 20 + } + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/datapack/data/hats/predicates/wandering_trader/chance_has_villager_trade.json b/datapack/data/hats/predicates/wandering_trader/chance_has_villager_trade.json new file mode 100644 index 0000000..a61a1d5 --- /dev/null +++ b/datapack/data/hats/predicates/wandering_trader/chance_has_villager_trade.json @@ -0,0 +1,4 @@ +{ + "condition": "minecraft:random_chance", + "chance": 0.3 +} \ No newline at end of file From 4179fcee6253c43b904cc817ea7989f4d62b0791 Mon Sep 17 00:00:00 2001 From: OraneUtan Date: Sun, 24 May 2020 14:20:59 +0200 Subject: [PATCH 44/58] Added buildscript to minify all function files --- build/minify_functions.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 build/minify_functions.py diff --git a/build/minify_functions.py b/build/minify_functions.py new file mode 100644 index 0000000..8d9f366 --- /dev/null +++ b/build/minify_functions.py @@ -0,0 +1,17 @@ +import os + +def get_functions(root): + for root, dirs, files in os.walk(root): + for file in files: + _, extension = os.path.splitext(file) + if extension == '.mcfunction': + yield os.path.join(root, file) + +for function in get_functions('datapack/data/hats/functions'): + print(function) + lines = open(function).readlines() + lines = filter(lambda l: not l.strip().startswith('#'), lines) # Remove comments + lines = filter(lambda l: l.strip(), lines) # Remove blank lines + lines = map(lambda l: l.lstrip(), lines) # Remove whitespace + + open(function, 'w').writelines(lines) \ No newline at end of file From badd60747f5820e5242e4d9f19e1652647b90f8d Mon Sep 17 00:00:00 2001 From: OraneUtan Date: Sun, 24 May 2020 14:35:31 +0200 Subject: [PATCH 45/58] Added build script to minify json files --- build/minify_json_files.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 build/minify_json_files.py diff --git a/build/minify_json_files.py b/build/minify_json_files.py new file mode 100644 index 0000000..482609f --- /dev/null +++ b/build/minify_json_files.py @@ -0,0 +1,17 @@ +import os, json +from itertools import chain + +def get_json_files(root): + for root, dirs, files in os.walk(root): + for file in files: + _, extension = os.path.splitext(file) + if extension == '.json': + yield os.path.join(root, file) + +for json_file in chain(get_json_files('datapack'), get_json_files('resourcepack')): + content = {} + with open(json_file) as file: + content = json.load(file) + + with open(json_file, 'w') as file: + json.dump(content, file, separators=[',', ':']) \ No newline at end of file From 7b13121bcf4f15cd4d68ef7924a5d10a76577c13 Mon Sep 17 00:00:00 2001 From: OraneUtan Date: Sun, 24 May 2020 20:54:12 +0200 Subject: [PATCH 46/58] Chance that a histile mob has a hat is now controled via predicate --- .../hats/functions/dress/drowned.mcfunction | 6 +- .../data/hats/functions/dress/husk.mcfunction | 6 +- .../hats/functions/dress/skeleton.mcfunction | 6 +- .../hats/functions/dress/stray.mcfunction | 6 +- .../hats/functions/dress/zombie.mcfunction | 6 +- .../functions/dress/zombie_pigman.mcfunction | 6 +- .../data/hats/loot_tables/dress/drowned.json | 43 +++----- .../data/hats/loot_tables/dress/husk.json | 100 +++++++----------- .../data/hats/loot_tables/dress/skeleton.json | 84 ++++++--------- .../data/hats/loot_tables/dress/stray.json | 80 +++++--------- .../data/hats/loot_tables/dress/zombie.json | 96 +++++++---------- .../hats/loot_tables/dress/zombie_pigman.json | 7 +- .../predicates/hostile_chance_has_hat.json | 4 + 13 files changed, 166 insertions(+), 284 deletions(-) create mode 100644 datapack/data/hats/predicates/hostile_chance_has_hat.json diff --git a/datapack/data/hats/functions/dress/drowned.mcfunction b/datapack/data/hats/functions/dress/drowned.mcfunction index 9bbd931..4a87248 100644 --- a/datapack/data/hats/functions/dress/drowned.mcfunction +++ b/datapack/data/hats/functions/dress/drowned.mcfunction @@ -1,7 +1,7 @@ -# as: Drowned beeing dressed +# executor: Drowned beeing dressed # descr: Try dressing a Drowned with a hat -loot replace entity @s armor.head loot hats:dress/drowned - +execute if predicate hats:hostile_chance_has_hat run loot replace entity @s armor.head loot hats:dress/drowned execute as @s[nbt={ArmorItems:[{},{},{},{Count:1b}]}] run data modify entity @s ArmorDropChances[3] set value 1.0f + tag @s add hats.mob.dont_dress \ No newline at end of file diff --git a/datapack/data/hats/functions/dress/husk.mcfunction b/datapack/data/hats/functions/dress/husk.mcfunction index db6f9aa..83f7f9d 100644 --- a/datapack/data/hats/functions/dress/husk.mcfunction +++ b/datapack/data/hats/functions/dress/husk.mcfunction @@ -1,7 +1,7 @@ -# as: The Husk beeing dressed +# executor: The Husk beeing dressed # descr: Try dressing a Husk with a hat -loot replace entity @s armor.head loot hats:dress/husk - +execute if predicate hats:hostile_chance_has_hat run loot replace entity @s armor.head loot hats:dress/husk execute as @s[nbt={ArmorItems:[{},{},{},{Count:1b}]}] run data modify entity @s ArmorDropChances[3] set value 1.0f + tag @s add hats.mob.dont_dress \ No newline at end of file diff --git a/datapack/data/hats/functions/dress/skeleton.mcfunction b/datapack/data/hats/functions/dress/skeleton.mcfunction index dfba8fc..74a113d 100644 --- a/datapack/data/hats/functions/dress/skeleton.mcfunction +++ b/datapack/data/hats/functions/dress/skeleton.mcfunction @@ -1,7 +1,7 @@ -# as: The Skeleton beeing dressed +# executor: The Skeleton beeing dressed # descr: Try dressing a Skeleton with a hat -loot replace entity @s armor.head loot hats:dress/skeleton - +execute if predicate hats:hostile_chance_has_hat run loot replace entity @s armor.head loot hats:dress/skeleton execute as @s[nbt={ArmorItems:[{},{},{},{Count:1b}]}] run data modify entity @s ArmorDropChances[3] set value 1.0f + tag @s add hats.mob.dont_dress \ No newline at end of file diff --git a/datapack/data/hats/functions/dress/stray.mcfunction b/datapack/data/hats/functions/dress/stray.mcfunction index 2c6a59e..e0caa5f 100644 --- a/datapack/data/hats/functions/dress/stray.mcfunction +++ b/datapack/data/hats/functions/dress/stray.mcfunction @@ -1,7 +1,7 @@ -# as: The Stray beeing dressed +# executor: The Stray beeing dressed # descr: Try dressing a Stray with a hat -loot replace entity @s armor.head loot hats:dress/stray - +execute if predicate hats:hostile_chance_has_hat run loot replace entity @s armor.head loot hats:dress/stray execute as @s[nbt={ArmorItems:[{},{},{},{Count:1b}]}] run data modify entity @s ArmorDropChances[3] set value 1.0f + tag @s add hats.mob.dont_dress \ No newline at end of file diff --git a/datapack/data/hats/functions/dress/zombie.mcfunction b/datapack/data/hats/functions/dress/zombie.mcfunction index b1613e2..3007203 100644 --- a/datapack/data/hats/functions/dress/zombie.mcfunction +++ b/datapack/data/hats/functions/dress/zombie.mcfunction @@ -1,7 +1,7 @@ -# as: The Zombie beeing dressed +# executor: The Zombie beeing dressed # descr: Dress a Zombie with a hat -loot replace entity @s armor.head loot hats:dress/zombie - +execute if predicate hats:hostile_chance_has_hat run loot replace entity @s armor.head loot hats:dress/zombie execute as @s[nbt={ArmorItems:[{},{},{},{Count:1b}]}] run data modify entity @s ArmorDropChances[3] set value 1.0f + tag @s add hats.mob.dont_dress \ No newline at end of file diff --git a/datapack/data/hats/functions/dress/zombie_pigman.mcfunction b/datapack/data/hats/functions/dress/zombie_pigman.mcfunction index a8c0d4a..bd5ff4f 100644 --- a/datapack/data/hats/functions/dress/zombie_pigman.mcfunction +++ b/datapack/data/hats/functions/dress/zombie_pigman.mcfunction @@ -1,7 +1,7 @@ -# as: The Zombie Pigman beeing dressed +# executor: The Zombie Pigman beeing dressed # descr: Dress the Zombie Pigman with a hat -loot replace entity @s armor.head loot hats:dress/zombie_pigman - +execute if predicate hats:hostile_chance_has_hat run loot replace entity @s armor.head loot hats:dress/zombie_pigman execute as @s[nbt={ArmorItems:[{},{},{},{Count:1b}]}] run data modify entity @s ArmorDropChances[3] set value 1.0f + tag @s add hats.mob.dont_dress \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/dress/drowned.json b/datapack/data/hats/loot_tables/dress/drowned.json index 49dcd7a..7d56bf5 100644 --- a/datapack/data/hats/loot_tables/dress/drowned.json +++ b/datapack/data/hats/loot_tables/dress/drowned.json @@ -5,40 +5,23 @@ "rolls": 1, "entries": [ { - "type": "empty", - "weight": 40 + "type": "minecraft:loot_table", + "name": "hats:hat_on_head/squid" }, + { - "type": "group", - "name": "misc", - "children": [ - { - "weight": 1, - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/squid" - } - ] + "weight": 2, + "type": "minecraft:loot_table", + "name": "hats:hat_on_head/accessories/snorkel_mask_blue" }, { - "type": "group", - "name": "accessories", - "children": [ - { - "weight": 4, - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/accessories/snorkel_mask_blue" - }, - { - "weight": 4, - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/accessories/snorkel_mask_red" - }, - { - "weight": 4, - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/accessories/googly_eyes" - } - ] + "weight": 2, + "type": "minecraft:loot_table", + "name": "hats:hat_on_head/accessories/snorkel_mask_red" + }, + { + "type": "minecraft:loot_table", + "name": "hats:hat_on_head/accessories/googly_eyes" } ] } diff --git a/datapack/data/hats/loot_tables/dress/husk.json b/datapack/data/hats/loot_tables/dress/husk.json index ba1984f..c37d45f 100644 --- a/datapack/data/hats/loot_tables/dress/husk.json +++ b/datapack/data/hats/loot_tables/dress/husk.json @@ -5,77 +5,51 @@ "rolls": 1, "entries": [ { - "type": "empty", - "weight": 60 + "weight": 2, + "type": "minecraft:loot_table", + "name": "hats:hat_on_head/tophats/yellow" }, { - "type": "group", - "name": "tophats", - "children": [ - { - "weight": 1, - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/tophats/yellow" - }, - { - "weight": 1, - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/tophats/lime" - }, - { - "weight": 1, - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/tophats/pink" - }, - { - "weight": 1, - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/tophats/gray" - } - ] + "weight": 2, + "type": "minecraft:loot_table", + "name": "hats:hat_on_head/tophats/lime" }, { - "type": "group", - "name": "misc", - "children": [ - { - "weight": 4, - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/fez" - } - ] + "weight": 2, + "type": "minecraft:loot_table", + "name": "hats:hat_on_head/tophats/pink" }, { - "type": "group", - "name": "glasses", - "children": [ - { - "weight": 4, - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/glasses/sunglasses" - } - ] + "weight": 2, + "type": "minecraft:loot_table", + "name": "hats:hat_on_head/tophats/gray" }, + { - "type": "group", - "name": "accessories", - "children": [ - { - "weight": 4, - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/accessories/steve_mask" - }, - { - "weight": 4, - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/accessories/alex_mask" - }, - { - "weight": 4, - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/accessories/googly_eyes" - } - ] + "type": "minecraft:loot_table", + "name": "hats:hat_on_head/fez" + }, + + { + "weight": 2, + "type": "minecraft:loot_table", + "name": "hats:hat_on_head/glasses/sunglasses" + }, + + { + "weight": 2, + "type": "minecraft:loot_table", + "name": "hats:hat_on_head/accessories/steve_mask" + }, + { + "weight": 2, + "type": "minecraft:loot_table", + "name": "hats:hat_on_head/accessories/alex_mask" + }, + { + "weight": 2, + "type": "minecraft:loot_table", + "name": "hats:hat_on_head/accessories/googly_eyes" } ] } diff --git a/datapack/data/hats/loot_tables/dress/skeleton.json b/datapack/data/hats/loot_tables/dress/skeleton.json index 624cde2..613f4ae 100644 --- a/datapack/data/hats/loot_tables/dress/skeleton.json +++ b/datapack/data/hats/loot_tables/dress/skeleton.json @@ -5,66 +5,42 @@ "rolls": 1, "entries": [ { - "type": "empty", - "weight": 60 + "type": "minecraft:loot_table", + "name": "hats:hat_on_head/tophats/light_gray" }, { - "type": "group", - "name": "tophats", - "children": [ - { - "weight": 1, - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/tophats/light_gray" - }, - { - "weight": 1, - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/tophats/cyan" - }, - { - "weight": 1, - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/tophats/purple" - }, - { - "weight": 1, - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/tophats/blue" - } - ] + "type": "minecraft:loot_table", + "name": "hats:hat_on_head/tophats/cyan" }, { - "type": "group", - "name": "glasses", - "children": [ - { - "weight": 4, - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/glasses/harry_potter" - } - ] + "type": "minecraft:loot_table", + "name": "hats:hat_on_head/tophats/purple" }, { - "type": "group", - "name": "accessories", - "children": [ - { - "weight": 4, - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/accessories/steve_mask" - }, - { - "weight": 4, - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/accessories/alex_mask" - }, - { - "weight": 4, - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/accessories/googly_eyes" - } - ] + "type": "minecraft:loot_table", + "name": "hats:hat_on_head/tophats/blue" + }, + + { + "weight": 2, + "type": "minecraft:loot_table", + "name": "hats:hat_on_head/glasses/harry_potter" + }, + + { + "weight": 2, + "type": "minecraft:loot_table", + "name": "hats:hat_on_head/accessories/steve_mask" + }, + { + "weight": 2, + "type": "minecraft:loot_table", + "name": "hats:hat_on_head/accessories/alex_mask" + }, + { + "weight": 2, + "type": "minecraft:loot_table", + "name": "hats:hat_on_head/accessories/googly_eyes" } ] } diff --git a/datapack/data/hats/loot_tables/dress/stray.json b/datapack/data/hats/loot_tables/dress/stray.json index eaaf05e..0d94cff 100644 --- a/datapack/data/hats/loot_tables/dress/stray.json +++ b/datapack/data/hats/loot_tables/dress/stray.json @@ -5,66 +5,38 @@ "rolls": 1, "entries": [ { - "type": "empty", - "weight": 60 + "type": "minecraft:loot_table", + "name": "hats:hat_on_head/tophats/brown" }, { - "type": "group", - "name": "tophats", - "children": [ - { - "weight": 1, - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/tophats/brown" - }, - { - "weight": 1, - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/tophats/green" - }, - { - "weight": 1, - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/tophats/red" - }, - { - "weight": 1, - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/tophats/black" - } - ] + "type": "minecraft:loot_table", + "name": "hats:hat_on_head/tophats/green" }, { - "type": "group", - "name": "misc", - "children": [ - { - "weight": 4, - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/arrow" - } - ] + "type": "minecraft:loot_table", + "name": "hats:hat_on_head/tophats/red" }, { - "type": "group", - "name": "accessories", - "children": [ - { - "weight": 4, - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/accessories/steve_mask" - }, - { - "weight": 4, - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/accessories/alex_mask" - }, - { - "weight": 4, - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/accessories/googly_eyes" - } - ] + "type": "minecraft:loot_table", + "name": "hats:hat_on_head/tophats/black" + }, + + { + "type": "minecraft:loot_table", + "name": "hats:hat_on_head/arrow" + }, + + { + "type": "minecraft:loot_table", + "name": "hats:hat_on_head/accessories/steve_mask" + }, + { + "type": "minecraft:loot_table", + "name": "hats:hat_on_head/accessories/alex_mask" + }, + { + "type": "minecraft:loot_table", + "name": "hats:hat_on_head/accessories/googly_eyes" } ] } diff --git a/datapack/data/hats/loot_tables/dress/zombie.json b/datapack/data/hats/loot_tables/dress/zombie.json index 01061d4..1893514 100644 --- a/datapack/data/hats/loot_tables/dress/zombie.json +++ b/datapack/data/hats/loot_tables/dress/zombie.json @@ -5,67 +5,50 @@ "rolls": 1, "entries": [ { - "type": "empty", - "weight": 60 + "type": "minecraft:loot_table", + "name": "hats:hat_on_head/tophats/white" }, { - "type": "group", - "name": "tophats", - "children": [ - { - "weight": 1, - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/tophats/white" - }, - { - "weight": 1, - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/tophats/orange" - }, - { - "weight": 1, - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/tophats/magenta" - }, - { - "weight": 1, - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/tophats/light_blue" - } - ] + "type": "minecraft:loot_table", + "name": "hats:hat_on_head/tophats/orange" }, { - "type": "group", - "name": "glasses", - "children": [ - { - "weight": 4, - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/glasses/half_rim" - } - ] + "type": "minecraft:loot_table", + "name": "hats:hat_on_head/tophats/magenta" }, { - "type": "group", - "name": "accessories", - "children": [ - { - "weight": 4, - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/accessories/steve_mask" - }, - { - "weight": 4, - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/accessories/alex_mask" - }, - { - "weight": 4, - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/accessories/googly_eyes" - } - ] + "type": "minecraft:loot_table", + "name": "hats:hat_on_head/tophats/light_blue" }, + + { + "weight": 2, + "type": "minecraft:loot_table", + "name": "hats:hat_on_head/glasses/half_rim" + }, + + { + "weight": 2, + "type": "minecraft:loot_table", + "name": "hats:hat_on_head/accessories/steve_mask" + }, + { + "weight": 2, + "type": "minecraft:loot_table", + "name": "hats:hat_on_head/accessories/alex_mask" + }, + { + "weight": 2, + "type": "minecraft:loot_table", + "name": "hats:hat_on_head/accessories/googly_eyes" + }, + + { + "weight": 2, + "type": "minecraft:loot_table", + "name": "hats:hat_on_head/halloween/jason_mask" + }, + { "weight": 4, "type": "minecraft:loot_table", @@ -78,11 +61,6 @@ } } ] - }, - { - "weight": 4, - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/halloween/jason_mask" } ] } diff --git a/datapack/data/hats/loot_tables/dress/zombie_pigman.json b/datapack/data/hats/loot_tables/dress/zombie_pigman.json index 36f5948..179b9e3 100644 --- a/datapack/data/hats/loot_tables/dress/zombie_pigman.json +++ b/datapack/data/hats/loot_tables/dress/zombie_pigman.json @@ -4,14 +4,9 @@ { "rolls": 1, "entries": [ - { - "type": "empty", - "weight": 5 - }, { "type": "minecraft:loot_table", - "name": "hats:hat_on_head/halloween/wiggly_ghast", - "weight": 1 + "name": "hats:hat_on_head/halloween/wiggly_ghast" } ] } diff --git a/datapack/data/hats/predicates/hostile_chance_has_hat.json b/datapack/data/hats/predicates/hostile_chance_has_hat.json new file mode 100644 index 0000000..77d411e --- /dev/null +++ b/datapack/data/hats/predicates/hostile_chance_has_hat.json @@ -0,0 +1,4 @@ +{ + "condition": "minecraft:random_chance", + "chance": 0.12 +} \ No newline at end of file From 01d4c2d2c1f5d41037fce92252ea3a373ccb2d68 Mon Sep 17 00:00:00 2001 From: OraneUtan Date: Mon, 25 May 2020 23:33:35 +0200 Subject: [PATCH 47/58] Hat fixing now ignores hats on the Players head Previously, if the Player put on a hat and it would be converted to a stick hat, the fixing process was triggered. Thats not necessarily bad, because it stops after checking for stick hats in the hotbar and inventory, but it still executes all 34 inventory copying commands. Instead, the process now immediately fails if there is only a stick hat in the Players head slot. --- ....mcfunction => fix_players_stick_hats.mcfunction} | 12 +++--------- .../fix_players_stick_hats_if_necessary.mcfunction | 12 ++++++++++++ ...n => fix_players_stick_hats_in_hotbar.mcfunction} | 0 ...> fix_players_stick_hats_in_inventory.mcfunction} | 0 ...> fix_players_stick_hats_if_necessary.mcfunction} | 4 ++-- .../triggers/player_received_stick_hat.mcfunction | 2 +- 6 files changed, 18 insertions(+), 12 deletions(-) rename datapack/data/hats/functions/hat_mechanism/{fix_stick_hats_of_player.mcfunction => fix_players_stick_hats.mcfunction} (94%) create mode 100644 datapack/data/hats/functions/hat_mechanism/fix_players_stick_hats_if_necessary.mcfunction rename datapack/data/hats/functions/hat_mechanism/{fix_stick_hats_in_players_hotbar.mcfunction => fix_players_stick_hats_in_hotbar.mcfunction} (100%) rename datapack/data/hats/functions/hat_mechanism/{fix_stick_hats_in_players_inventory.mcfunction => fix_players_stick_hats_in_inventory.mcfunction} (100%) rename datapack/data/hats/functions/proxies/{fix_stick_hats_of_player.mcfunction => fix_players_stick_hats_if_necessary.mcfunction} (59%) diff --git a/datapack/data/hats/functions/hat_mechanism/fix_stick_hats_of_player.mcfunction b/datapack/data/hats/functions/hat_mechanism/fix_players_stick_hats.mcfunction similarity index 94% rename from datapack/data/hats/functions/hat_mechanism/fix_stick_hats_of_player.mcfunction rename to datapack/data/hats/functions/hat_mechanism/fix_players_stick_hats.mcfunction index b902b22..b9cee66 100644 --- a/datapack/data/hats/functions/hat_mechanism/fix_stick_hats_of_player.mcfunction +++ b/datapack/data/hats/functions/hat_mechanism/fix_players_stick_hats.mcfunction @@ -1,9 +1,7 @@ -# as: Player +# executor: Player who has a stick hat in his inventory that needs to be fixed # descr: When a Player takes of their hat, they have #hat_on_head item in their inventory. # Replace that item with an equivalent #hat item -data modify storage hats buffer.all set from entity @s Inventory - # Extract items in hotbar from buffer.all data modify storage minecraft:hats buffer.hotbar append from storage minecraft:hats buffer.all[{Slot:0b}] data modify storage minecraft:hats buffer.hotbar append from storage minecraft:hats buffer.all[{Slot:1b}] @@ -15,7 +13,7 @@ data modify storage minecraft:hats buffer.hotbar append from storage minecraft:h data modify storage minecraft:hats buffer.hotbar append from storage minecraft:hats buffer.all[{Slot:7b}] data modify storage minecraft:hats buffer.hotbar append from storage minecraft:hats buffer.all[{Slot:8b}] -execute if data storage minecraft:hats buffer.hotbar[{id:"minecraft:stick", tag:{Tags:["is_hat"]}}] run function hats:hat_mechanism/fix_stick_hats_in_players_hotbar +execute if data storage minecraft:hats buffer.hotbar[{id:"minecraft:stick", tag:{Tags:["is_hat"]}}] run function hats:hat_mechanism/fix_players_stick_hats_in_hotbar # Extract items in inventory from buffer.all data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:9b}] @@ -46,8 +44,4 @@ data modify storage minecraft:hats buffer.inventory append from storage minecraf data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:34b}] data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:35b}] -execute if data storage minecraft:hats buffer.inventory[{id:"minecraft:stick", tag:{Tags:["is_hat"]}}] run function hats:hat_mechanism/fix_stick_hats_in_players_inventory - -# Clean up -setblock ~ 0 ~ minecraft:air -data remove storage minecraft:hats buffer \ No newline at end of file +execute if data storage minecraft:hats buffer.inventory[{id:"minecraft:stick", tag:{Tags:["is_hat"]}}] run function hats:hat_mechanism/fix_players_stick_hats_in_inventory \ No newline at end of file diff --git a/datapack/data/hats/functions/hat_mechanism/fix_players_stick_hats_if_necessary.mcfunction b/datapack/data/hats/functions/hat_mechanism/fix_players_stick_hats_if_necessary.mcfunction new file mode 100644 index 0000000..03174bd --- /dev/null +++ b/datapack/data/hats/functions/hat_mechanism/fix_players_stick_hats_if_necessary.mcfunction @@ -0,0 +1,12 @@ +# executor: Player whose stick hats are going to be fixed +# descr: Determines if the Player has any stick hats that need to be fixed and then fixes them + +# Store the Players inventory +data modify storage hats buffer.all set from entity @s Inventory +# Stick hats on the Players head shold not get fixed +data remove storage minecraft:hats buffer.all[{Slot:103b}] + +execute if data storage minecraft:hats buffer.all[{id:"minecraft:stick", tag:{Tags:["is_hat"]}}] run function hats:hat_mechanism/fix_players_stick_hats + +# Clean up +data remove storage minecraft:hats buffer \ No newline at end of file diff --git a/datapack/data/hats/functions/hat_mechanism/fix_stick_hats_in_players_hotbar.mcfunction b/datapack/data/hats/functions/hat_mechanism/fix_players_stick_hats_in_hotbar.mcfunction similarity index 100% rename from datapack/data/hats/functions/hat_mechanism/fix_stick_hats_in_players_hotbar.mcfunction rename to datapack/data/hats/functions/hat_mechanism/fix_players_stick_hats_in_hotbar.mcfunction diff --git a/datapack/data/hats/functions/hat_mechanism/fix_stick_hats_in_players_inventory.mcfunction b/datapack/data/hats/functions/hat_mechanism/fix_players_stick_hats_in_inventory.mcfunction similarity index 100% rename from datapack/data/hats/functions/hat_mechanism/fix_stick_hats_in_players_inventory.mcfunction rename to datapack/data/hats/functions/hat_mechanism/fix_players_stick_hats_in_inventory.mcfunction diff --git a/datapack/data/hats/functions/proxies/fix_stick_hats_of_player.mcfunction b/datapack/data/hats/functions/proxies/fix_players_stick_hats_if_necessary.mcfunction similarity index 59% rename from datapack/data/hats/functions/proxies/fix_stick_hats_of_player.mcfunction rename to datapack/data/hats/functions/proxies/fix_players_stick_hats_if_necessary.mcfunction index 923d13d..1b80031 100644 --- a/datapack/data/hats/functions/proxies/fix_stick_hats_of_player.mcfunction +++ b/datapack/data/hats/functions/proxies/fix_players_stick_hats_if_necessary.mcfunction @@ -1,5 +1,5 @@ # executor: World # descr: This function is scheduled as a proxy, so that another function call can be scheduled with a desired context -# Execute proxied function as Players with sitck hats in their inventory -execute as @a[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"]}}]}] run function hats:hat_mechanism/fix_stick_hats_of_player \ No newline at end of file +# Execute proxied function as Players with stick hats in their inventory +execute as @a[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"]}}]}] run function hats:hat_mechanism/fix_players_stick_hats_if_necessary \ No newline at end of file diff --git a/datapack/data/hats/functions/triggers/player_received_stick_hat.mcfunction b/datapack/data/hats/functions/triggers/player_received_stick_hat.mcfunction index c728311..e1976ff 100644 --- a/datapack/data/hats/functions/triggers/player_received_stick_hat.mcfunction +++ b/datapack/data/hats/functions/triggers/player_received_stick_hat.mcfunction @@ -1,7 +1,7 @@ # executor: Player getting advancement # descr: Called by advancement when the players inventory contains a stick hat. Replaces it with a helmet hat -execute if entity @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"]}}]}] run schedule function hats:proxies/fix_stick_hats_of_player 1t +execute if entity @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"]}}]}] run schedule function hats:proxies/fix_players_stick_hats_if_necessary 1t # Reset trigger advancement revoke @s only hats:triggers/player_received_stick_hat \ No newline at end of file From 9fc87bcecb4c9e3a911e0a467e5adf6a66efcdfb Mon Sep 17 00:00:00 2001 From: OraneUtan Date: Tue, 26 May 2020 11:30:07 +0200 Subject: [PATCH 48/58] Optimized by removing hotbar items instead of copying specific slots --- .../fix_players_stick_hats.mcfunction | 74 ++++++++----------- ...players_stick_hats_if_necessary.mcfunction | 6 +- ...players_stick_hats_in_inventory.mcfunction | 62 ++++++++-------- 3 files changed, 66 insertions(+), 76 deletions(-) diff --git a/datapack/data/hats/functions/hat_mechanism/fix_players_stick_hats.mcfunction b/datapack/data/hats/functions/hat_mechanism/fix_players_stick_hats.mcfunction index b9cee66..84b2d79 100644 --- a/datapack/data/hats/functions/hat_mechanism/fix_players_stick_hats.mcfunction +++ b/datapack/data/hats/functions/hat_mechanism/fix_players_stick_hats.mcfunction @@ -1,47 +1,37 @@ -# executor: Player who has a stick hat in his inventory that needs to be fixed -# descr: When a Player takes of their hat, they have #hat_on_head item in their inventory. -# Replace that item with an equivalent #hat item +# executor: Player who have a stick hat in their inventory that needs to be fixed +# descr: Replaces any stick hats in the Players inventory with leather helmet hats -# Extract items in hotbar from buffer.all -data modify storage minecraft:hats buffer.hotbar append from storage minecraft:hats buffer.all[{Slot:0b}] -data modify storage minecraft:hats buffer.hotbar append from storage minecraft:hats buffer.all[{Slot:1b}] -data modify storage minecraft:hats buffer.hotbar append from storage minecraft:hats buffer.all[{Slot:2b}] -data modify storage minecraft:hats buffer.hotbar append from storage minecraft:hats buffer.all[{Slot:3b}] -data modify storage minecraft:hats buffer.hotbar append from storage minecraft:hats buffer.all[{Slot:4b}] -data modify storage minecraft:hats buffer.hotbar append from storage minecraft:hats buffer.all[{Slot:5b}] -data modify storage minecraft:hats buffer.hotbar append from storage minecraft:hats buffer.all[{Slot:6b}] -data modify storage minecraft:hats buffer.hotbar append from storage minecraft:hats buffer.all[{Slot:7b}] -data modify storage minecraft:hats buffer.hotbar append from storage minecraft:hats buffer.all[{Slot:8b}] +# Extract hotbar from buffer.inv +data modify storage minecraft:hats buffer.hotbar append from storage minecraft:hats buffer.inv[{Slot:0b}] +data modify storage minecraft:hats buffer.hotbar append from storage minecraft:hats buffer.inv[{Slot:1b}] +data modify storage minecraft:hats buffer.hotbar append from storage minecraft:hats buffer.inv[{Slot:2b}] +data modify storage minecraft:hats buffer.hotbar append from storage minecraft:hats buffer.inv[{Slot:3b}] +data modify storage minecraft:hats buffer.hotbar append from storage minecraft:hats buffer.inv[{Slot:4b}] +data modify storage minecraft:hats buffer.hotbar append from storage minecraft:hats buffer.inv[{Slot:5b}] +data modify storage minecraft:hats buffer.hotbar append from storage minecraft:hats buffer.inv[{Slot:6b}] +data modify storage minecraft:hats buffer.hotbar append from storage minecraft:hats buffer.inv[{Slot:7b}] +data modify storage minecraft:hats buffer.hotbar append from storage minecraft:hats buffer.inv[{Slot:8b}] execute if data storage minecraft:hats buffer.hotbar[{id:"minecraft:stick", tag:{Tags:["is_hat"]}}] run function hats:hat_mechanism/fix_players_stick_hats_in_hotbar -# Extract items in inventory from buffer.all -data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:9b}] -data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:10b}] -data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:11b}] -data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:12b}] -data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:13b}] -data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:14b}] -data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:15b}] -data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:16b}] -data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:17b}] -data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:18b}] -data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:19b}] -data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:20b}] -data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:21b}] -data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:22b}] -data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:23b}] -data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:24b}] -data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:25b}] -data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:26b}] -data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:27b}] -data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:28b}] -data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:29b}] -data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:30b}] -data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:31b}] -data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:32b}] -data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:33b}] -data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:34b}] -data modify storage minecraft:hats buffer.inventory append from storage minecraft:hats buffer.all[{Slot:35b}] +# Remove item in offhand from buffer.inv +data remove storage minecraft:hats buffer.inv[{Slot:-106b}] -execute if data storage minecraft:hats buffer.inventory[{id:"minecraft:stick", tag:{Tags:["is_hat"]}}] run function hats:hat_mechanism/fix_players_stick_hats_in_inventory \ No newline at end of file +# Remove equiped armor from buffer.inv. Head slot was already removed +data remove storage minecraft:hats buffer.inv[{Slot:100b}] +data remove storage minecraft:hats buffer.inv[{Slot:101b}] +data remove storage minecraft:hats buffer.inv[{Slot:102b}] + +# Remove hotbar items from buffer.inv +data remove storage minecraft:hats buffer.inv[{Slot:8b}] +data remove storage minecraft:hats buffer.inv[{Slot:7b}] +data remove storage minecraft:hats buffer.inv[{Slot:6b}] +data remove storage minecraft:hats buffer.inv[{Slot:5b}] +data remove storage minecraft:hats buffer.inv[{Slot:4b}] +data remove storage minecraft:hats buffer.inv[{Slot:3b}] +data remove storage minecraft:hats buffer.inv[{Slot:2b}] +data remove storage minecraft:hats buffer.inv[{Slot:1b}] +data remove storage minecraft:hats buffer.inv[{Slot:0b}] + +# Now only items in the Players inventory should be left in buffer.inv +execute if data storage minecraft:hats buffer.inv[{id:"minecraft:stick", tag:{Tags:["is_hat"]}}] run function hats:hat_mechanism/fix_players_stick_hats_in_inventory \ No newline at end of file diff --git a/datapack/data/hats/functions/hat_mechanism/fix_players_stick_hats_if_necessary.mcfunction b/datapack/data/hats/functions/hat_mechanism/fix_players_stick_hats_if_necessary.mcfunction index 03174bd..5545a6b 100644 --- a/datapack/data/hats/functions/hat_mechanism/fix_players_stick_hats_if_necessary.mcfunction +++ b/datapack/data/hats/functions/hat_mechanism/fix_players_stick_hats_if_necessary.mcfunction @@ -2,11 +2,11 @@ # descr: Determines if the Player has any stick hats that need to be fixed and then fixes them # Store the Players inventory -data modify storage hats buffer.all set from entity @s Inventory +data modify storage hats buffer.inv set from entity @s Inventory # Stick hats on the Players head shold not get fixed -data remove storage minecraft:hats buffer.all[{Slot:103b}] +data remove storage minecraft:hats buffer.inv[{Slot:103b}] -execute if data storage minecraft:hats buffer.all[{id:"minecraft:stick", tag:{Tags:["is_hat"]}}] run function hats:hat_mechanism/fix_players_stick_hats +execute if data storage minecraft:hats buffer.inv[{id:"minecraft:stick", tag:{Tags:["is_hat"]}}] run function hats:hat_mechanism/fix_players_stick_hats # Clean up data remove storage minecraft:hats buffer \ No newline at end of file diff --git a/datapack/data/hats/functions/hat_mechanism/fix_players_stick_hats_in_inventory.mcfunction b/datapack/data/hats/functions/hat_mechanism/fix_players_stick_hats_in_inventory.mcfunction index 7cb4b8f..06c5544 100644 --- a/datapack/data/hats/functions/hat_mechanism/fix_players_stick_hats_in_inventory.mcfunction +++ b/datapack/data/hats/functions/hat_mechanism/fix_players_stick_hats_in_inventory.mcfunction @@ -1,44 +1,44 @@ # executor: Player whos inventory is getting fixed # descr: Fixes all stick hats in the Players inventory slots # requirements: -# - storage buffer.inventory has to be populated -# - at least one stick hat has to exist in buffer.inventory +# - storage buffer.inv has to be populated +# - at least one stick hat has to exist in buffer.inv # Correct slot data -data modify storage minecraft:hats buffer.inventory[{Slot:9b}].Slot set value 0b -data modify storage minecraft:hats buffer.inventory[{Slot:10b}].Slot set value 1b -data modify storage minecraft:hats buffer.inventory[{Slot:11b}].Slot set value 2b -data modify storage minecraft:hats buffer.inventory[{Slot:12b}].Slot set value 3b -data modify storage minecraft:hats buffer.inventory[{Slot:13b}].Slot set value 4b -data modify storage minecraft:hats buffer.inventory[{Slot:14b}].Slot set value 5b -data modify storage minecraft:hats buffer.inventory[{Slot:15b}].Slot set value 6b -data modify storage minecraft:hats buffer.inventory[{Slot:16b}].Slot set value 7b -data modify storage minecraft:hats buffer.inventory[{Slot:17b}].Slot set value 8b -data modify storage minecraft:hats buffer.inventory[{Slot:18b}].Slot set value 9b -data modify storage minecraft:hats buffer.inventory[{Slot:19b}].Slot set value 10b -data modify storage minecraft:hats buffer.inventory[{Slot:20b}].Slot set value 11b -data modify storage minecraft:hats buffer.inventory[{Slot:21b}].Slot set value 12b -data modify storage minecraft:hats buffer.inventory[{Slot:22b}].Slot set value 13b -data modify storage minecraft:hats buffer.inventory[{Slot:23b}].Slot set value 14b -data modify storage minecraft:hats buffer.inventory[{Slot:24b}].Slot set value 15b -data modify storage minecraft:hats buffer.inventory[{Slot:25b}].Slot set value 16b -data modify storage minecraft:hats buffer.inventory[{Slot:26b}].Slot set value 17b -data modify storage minecraft:hats buffer.inventory[{Slot:27b}].Slot set value 18b -data modify storage minecraft:hats buffer.inventory[{Slot:28b}].Slot set value 19b -data modify storage minecraft:hats buffer.inventory[{Slot:29b}].Slot set value 20b -data modify storage minecraft:hats buffer.inventory[{Slot:30b}].Slot set value 21b -data modify storage minecraft:hats buffer.inventory[{Slot:31b}].Slot set value 22b -data modify storage minecraft:hats buffer.inventory[{Slot:32b}].Slot set value 23b -data modify storage minecraft:hats buffer.inventory[{Slot:33b}].Slot set value 24b -data modify storage minecraft:hats buffer.inventory[{Slot:34b}].Slot set value 25b -data modify storage minecraft:hats buffer.inventory[{Slot:35b}].Slot set value 26b +data modify storage minecraft:hats buffer.inv[{Slot:9b}].Slot set value 0b +data modify storage minecraft:hats buffer.inv[{Slot:10b}].Slot set value 1b +data modify storage minecraft:hats buffer.inv[{Slot:11b}].Slot set value 2b +data modify storage minecraft:hats buffer.inv[{Slot:12b}].Slot set value 3b +data modify storage minecraft:hats buffer.inv[{Slot:13b}].Slot set value 4b +data modify storage minecraft:hats buffer.inv[{Slot:14b}].Slot set value 5b +data modify storage minecraft:hats buffer.inv[{Slot:15b}].Slot set value 6b +data modify storage minecraft:hats buffer.inv[{Slot:16b}].Slot set value 7b +data modify storage minecraft:hats buffer.inv[{Slot:17b}].Slot set value 8b +data modify storage minecraft:hats buffer.inv[{Slot:18b}].Slot set value 9b +data modify storage minecraft:hats buffer.inv[{Slot:19b}].Slot set value 10b +data modify storage minecraft:hats buffer.inv[{Slot:20b}].Slot set value 11b +data modify storage minecraft:hats buffer.inv[{Slot:21b}].Slot set value 12b +data modify storage minecraft:hats buffer.inv[{Slot:22b}].Slot set value 13b +data modify storage minecraft:hats buffer.inv[{Slot:23b}].Slot set value 14b +data modify storage minecraft:hats buffer.inv[{Slot:24b}].Slot set value 15b +data modify storage minecraft:hats buffer.inv[{Slot:25b}].Slot set value 16b +data modify storage minecraft:hats buffer.inv[{Slot:26b}].Slot set value 17b +data modify storage minecraft:hats buffer.inv[{Slot:27b}].Slot set value 18b +data modify storage minecraft:hats buffer.inv[{Slot:28b}].Slot set value 19b +data modify storage minecraft:hats buffer.inv[{Slot:29b}].Slot set value 20b +data modify storage minecraft:hats buffer.inv[{Slot:30b}].Slot set value 21b +data modify storage minecraft:hats buffer.inv[{Slot:31b}].Slot set value 22b +data modify storage minecraft:hats buffer.inv[{Slot:32b}].Slot set value 23b +data modify storage minecraft:hats buffer.inv[{Slot:33b}].Slot set value 24b +data modify storage minecraft:hats buffer.inv[{Slot:34b}].Slot set value 25b +data modify storage minecraft:hats buffer.inv[{Slot:35b}].Slot set value 26b # Replace all stick Hats with helmet hats -data modify storage minecraft:hats buffer.inventory[{id:"minecraft:stick", tag:{Tags:["is_hat"]}}].id set value "minecraft:leather_helmet" +data modify storage minecraft:hats buffer.inv[{id:"minecraft:stick", tag:{Tags:["is_hat"]}}].id set value "minecraft:leather_helmet" # Replaced Players inventory with modified inventory setblock ~ 0 ~ minecraft:yellow_shulker_box -data modify block ~ 0 ~ Items set from storage minecraft:hats buffer.inventory +data modify block ~ 0 ~ Items set from storage minecraft:hats buffer.inv loot replace entity @s inventory.0 27 mine ~ 0 ~ minecraft:diamond_pickaxe{drop_contents:1b} # Clean up From a0db462fcc999f0cecc91829fef60e1e87455cfe Mon Sep 17 00:00:00 2001 From: OraneUtan Date: Tue, 26 May 2020 12:15:53 +0200 Subject: [PATCH 49/58] Replaced costly nbt selectors with tag selectors --- .../proxies/fix_players_stick_hats_if_necessary.mcfunction | 5 +++-- .../functions/triggers/player_received_stick_hat.mcfunction | 5 ++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/datapack/data/hats/functions/proxies/fix_players_stick_hats_if_necessary.mcfunction b/datapack/data/hats/functions/proxies/fix_players_stick_hats_if_necessary.mcfunction index 1b80031..4830d42 100644 --- a/datapack/data/hats/functions/proxies/fix_players_stick_hats_if_necessary.mcfunction +++ b/datapack/data/hats/functions/proxies/fix_players_stick_hats_if_necessary.mcfunction @@ -1,5 +1,6 @@ # executor: World # descr: This function is scheduled as a proxy, so that another function call can be scheduled with a desired context -# Execute proxied function as Players with stick hats in their inventory -execute as @a[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"]}}]}] run function hats:hat_mechanism/fix_players_stick_hats_if_necessary \ No newline at end of file +# Execute proxied function as Players that received a stick hat +execute as @a[tag=hats.player.received_stick_hat] run function hats:hat_mechanism/fix_players_stick_hats_if_necessary +tag @a remove hats.player.received_stick_hat \ No newline at end of file diff --git a/datapack/data/hats/functions/triggers/player_received_stick_hat.mcfunction b/datapack/data/hats/functions/triggers/player_received_stick_hat.mcfunction index e1976ff..5259acf 100644 --- a/datapack/data/hats/functions/triggers/player_received_stick_hat.mcfunction +++ b/datapack/data/hats/functions/triggers/player_received_stick_hat.mcfunction @@ -1,7 +1,10 @@ # executor: Player getting advancement # descr: Called by advancement when the players inventory contains a stick hat. Replaces it with a helmet hat -execute if entity @s[nbt={Inventory:[{id:"minecraft:stick",tag:{Tags:["is_hat"]}}]}] run schedule function hats:proxies/fix_players_stick_hats_if_necessary 1t +# Tag Player that he received a stick hat +tag @s add hats.player.received_stick_hat +# Fix the stick hat in the next tick. Changing the inventory on an advancement trigger is buggy +schedule function hats:proxies/fix_players_stick_hats_if_necessary 1t # Reset trigger advancement revoke @s only hats:triggers/player_received_stick_hat \ No newline at end of file From 5afcb9dd0dad7fa6b40b3543f83dfe6863fe2831 Mon Sep 17 00:00:00 2001 From: OraneUtan Date: Tue, 26 May 2020 12:38:50 +0200 Subject: [PATCH 50/58] Zombies only wear Jason Masks at dark night --- datapack/data/hats/loot_tables/dress/zombie.json | 12 +++++++++--- datapack/data/hats/predicates/is_spooky_hours.json | 7 +++++++ 2 files changed, 16 insertions(+), 3 deletions(-) create mode 100644 datapack/data/hats/predicates/is_spooky_hours.json diff --git a/datapack/data/hats/loot_tables/dress/zombie.json b/datapack/data/hats/loot_tables/dress/zombie.json index 1893514..0655292 100644 --- a/datapack/data/hats/loot_tables/dress/zombie.json +++ b/datapack/data/hats/loot_tables/dress/zombie.json @@ -44,9 +44,15 @@ }, { - "weight": 2, + "weight": 4, "type": "minecraft:loot_table", - "name": "hats:hat_on_head/halloween/jason_mask" + "name": "hats:hat_on_head/halloween/jason_mask", + "conditions": [ + { + "condition": "minecraft:reference", + "name": "hats:is_spooky_hours" + } + ] }, { @@ -61,7 +67,7 @@ } } ] - } + } ] } ] diff --git a/datapack/data/hats/predicates/is_spooky_hours.json b/datapack/data/hats/predicates/is_spooky_hours.json new file mode 100644 index 0000000..d18cc53 --- /dev/null +++ b/datapack/data/hats/predicates/is_spooky_hours.json @@ -0,0 +1,7 @@ +{ + "condition": "minecraft:time_check", + "value": { + "min": 16000, + "max": 20000 + } +} \ No newline at end of file From ee0747bca3c8fc231b065eb6efe50ef375d9a431 Mon Sep 17 00:00:00 2001 From: OraneUtan Date: Tue, 26 May 2020 13:58:17 +0200 Subject: [PATCH 51/58] Wiggly ghast can now only be found in mansions at night Zombie Pigman can no longer wear the Wiggly Ghast. Instead only Zombies, Vindicators and Skeleton can wear them if it is dark night and they are in a mansion. --- .../dress/dress_mobs_near_player.mcfunction | 2 +- .../hats/functions/dress/mob_as_ghost.mcfunction | 8 ++++++++ .../data/hats/functions/dress/skeleton.mcfunction | 8 ++++++-- .../hats/functions/dress/vindicator.mcfunction | 5 +++++ .../data/hats/functions/dress/zombie.mcfunction | 8 ++++++-- .../hats/functions/dress/zombie_pigman.mcfunction | 7 ------- .../data/hats/loot_tables/dress/zombie_pigman.json | 14 -------------- .../data/hats/predicates/chance_mob_is_ghost.json | 4 ++++ datapack/data/hats/predicates/is_dark_night.json | 7 +++++++ datapack/data/hats/predicates/is_in_mansion.json | 6 ++++++ 10 files changed, 43 insertions(+), 26 deletions(-) create mode 100644 datapack/data/hats/functions/dress/mob_as_ghost.mcfunction create mode 100644 datapack/data/hats/functions/dress/vindicator.mcfunction delete mode 100644 datapack/data/hats/functions/dress/zombie_pigman.mcfunction delete mode 100644 datapack/data/hats/loot_tables/dress/zombie_pigman.json create mode 100644 datapack/data/hats/predicates/chance_mob_is_ghost.json create mode 100644 datapack/data/hats/predicates/is_dark_night.json create mode 100644 datapack/data/hats/predicates/is_in_mansion.json diff --git a/datapack/data/hats/functions/dress/dress_mobs_near_player.mcfunction b/datapack/data/hats/functions/dress/dress_mobs_near_player.mcfunction index 711b325..3f7e5ef 100644 --- a/datapack/data/hats/functions/dress/dress_mobs_near_player.mcfunction +++ b/datapack/data/hats/functions/dress/dress_mobs_near_player.mcfunction @@ -7,7 +7,7 @@ execute as @e[type=skeleton,distance=0..64,tag=!hats.mob.dont_dress,nbt=!{ArmorI execute as @e[type=drowned,distance=0..64,tag=!hats.mob.dont_dress,nbt=!{ArmorItems:[{},{},{},{Count:1b}]}] at @s run function hats:dress/drowned execute as @e[type=stray,distance=0..64,tag=!hats.mob.dont_dress,nbt=!{ArmorItems:[{},{},{},{Count:1b}]}] at @s run function hats:dress/stray execute as @e[type=wandering_trader,distance=0..64,tag=!hats.mob.dont_dress] at @s run function hats:dress/wandering_trader -execute as @e[type=zombie_pigman,distance=0..64,tag=!hats.mob.dont_dress,nbt=!{ArmorItems:[{},{},{},{Count:1b}]}] at @s run function hats:dress/zombie_pigman +execute as @e[type=minecraft:vindicator,distance=0..64,tag=!hats.mob.dont_dress,nbt=!{ArmorItems:[{},{},{},{Count:1b}]}] at @s run function hats:dress/vindicator # Only dress Villagers with a profession execute as @e[type=villager,distance=0..64,tag=!hats.mob.dont_dress,nbt=!{VillagerData:{profession:"minecraft:none"}}] at @s run function hats:dress/villager \ No newline at end of file diff --git a/datapack/data/hats/functions/dress/mob_as_ghost.mcfunction b/datapack/data/hats/functions/dress/mob_as_ghost.mcfunction new file mode 100644 index 0000000..80092e7 --- /dev/null +++ b/datapack/data/hats/functions/dress/mob_as_ghost.mcfunction @@ -0,0 +1,8 @@ +# executor: Mob that is going to be dressed as a ghost +# requires: Executor must have ArmorItems nbt and a hat slot +# descr: Dresses a mob with a ghost hat and gives it invisibility + +loot replace entity @s armor.head loot hats:hat_on_head/halloween/wiggly_ghast +data modify entity @s ArmorDropChances[3] set value 1.0f +effect give @s minecraft:invisibility 99999 1 true +tag @s add hats.mob.is_ghost \ No newline at end of file diff --git a/datapack/data/hats/functions/dress/skeleton.mcfunction b/datapack/data/hats/functions/dress/skeleton.mcfunction index 74a113d..903a31a 100644 --- a/datapack/data/hats/functions/dress/skeleton.mcfunction +++ b/datapack/data/hats/functions/dress/skeleton.mcfunction @@ -1,7 +1,11 @@ # executor: The Skeleton beeing dressed # descr: Try dressing a Skeleton with a hat -execute if predicate hats:hostile_chance_has_hat run loot replace entity @s armor.head loot hats:dress/skeleton -execute as @s[nbt={ArmorItems:[{},{},{},{Count:1b}]}] run data modify entity @s ArmorDropChances[3] set value 1.0f +# Try to make the Skeleton a ghost +execute if predicate hats:is_in_mansion if predicate hats:is_dark_night if predicate hats:chance_mob_is_ghost run function hats:dress/mob_as_ghost + +# Else try to give the Skeleton a hat +execute as @s[tag=!hats.mob.is_ghost] if predicate hats:hostile_chance_has_hat run loot replace entity @s armor.head loot hats:dress/skeleton +execute as @s[tag=!hats.mob.is_ghost] run data modify entity @s ArmorDropChances[3] set value 1.0f tag @s add hats.mob.dont_dress \ No newline at end of file diff --git a/datapack/data/hats/functions/dress/vindicator.mcfunction b/datapack/data/hats/functions/dress/vindicator.mcfunction new file mode 100644 index 0000000..cfb785e --- /dev/null +++ b/datapack/data/hats/functions/dress/vindicator.mcfunction @@ -0,0 +1,5 @@ +# executor: Vindicator being dressed + +execute if predicate hats:is_in_mansion if predicate hats:is_dark_night if predicate hats:chance_mob_is_ghost run function hats:dress/mob_as_ghost + +tag @s add hats.mob.dont_dress \ No newline at end of file diff --git a/datapack/data/hats/functions/dress/zombie.mcfunction b/datapack/data/hats/functions/dress/zombie.mcfunction index 3007203..0db589d 100644 --- a/datapack/data/hats/functions/dress/zombie.mcfunction +++ b/datapack/data/hats/functions/dress/zombie.mcfunction @@ -1,7 +1,11 @@ # executor: The Zombie beeing dressed # descr: Dress a Zombie with a hat -execute if predicate hats:hostile_chance_has_hat run loot replace entity @s armor.head loot hats:dress/zombie -execute as @s[nbt={ArmorItems:[{},{},{},{Count:1b}]}] run data modify entity @s ArmorDropChances[3] set value 1.0f +# Try to make the Zombie a ghost +execute if predicate hats:is_in_mansion if predicate hats:is_dark_night if predicate hats:chance_mob_is_ghost run function hats:dress/mob_as_ghost + +# Else try to give the Zombie a hat +execute as @s[tag=!hats.mob.is_ghost] if predicate hats:hostile_chance_has_hat run loot replace entity @s armor.head loot hats:dress/zombie +execute as @s[tag=!hats.mob.is_ghost] run data modify entity @s ArmorDropChances[3] set value 1.0f tag @s add hats.mob.dont_dress \ No newline at end of file diff --git a/datapack/data/hats/functions/dress/zombie_pigman.mcfunction b/datapack/data/hats/functions/dress/zombie_pigman.mcfunction deleted file mode 100644 index bd5ff4f..0000000 --- a/datapack/data/hats/functions/dress/zombie_pigman.mcfunction +++ /dev/null @@ -1,7 +0,0 @@ -# executor: The Zombie Pigman beeing dressed -# descr: Dress the Zombie Pigman with a hat - -execute if predicate hats:hostile_chance_has_hat run loot replace entity @s armor.head loot hats:dress/zombie_pigman -execute as @s[nbt={ArmorItems:[{},{},{},{Count:1b}]}] run data modify entity @s ArmorDropChances[3] set value 1.0f - -tag @s add hats.mob.dont_dress \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/dress/zombie_pigman.json b/datapack/data/hats/loot_tables/dress/zombie_pigman.json deleted file mode 100644 index 179b9e3..0000000 --- a/datapack/data/hats/loot_tables/dress/zombie_pigman.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "type": "generic", - "pools": [ - { - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "hats:hat_on_head/halloween/wiggly_ghast" - } - ] - } - ] -} \ No newline at end of file diff --git a/datapack/data/hats/predicates/chance_mob_is_ghost.json b/datapack/data/hats/predicates/chance_mob_is_ghost.json new file mode 100644 index 0000000..bc0e24f --- /dev/null +++ b/datapack/data/hats/predicates/chance_mob_is_ghost.json @@ -0,0 +1,4 @@ +{ + "condition": "minecraft:random_chance", + "chance": 0.22 +} \ No newline at end of file diff --git a/datapack/data/hats/predicates/is_dark_night.json b/datapack/data/hats/predicates/is_dark_night.json new file mode 100644 index 0000000..f116564 --- /dev/null +++ b/datapack/data/hats/predicates/is_dark_night.json @@ -0,0 +1,7 @@ +{ + "condition": "minecraft:time_check", + "value": { + "min": 14000, + "max": 22000 + } +} \ No newline at end of file diff --git a/datapack/data/hats/predicates/is_in_mansion.json b/datapack/data/hats/predicates/is_in_mansion.json new file mode 100644 index 0000000..ecf3577 --- /dev/null +++ b/datapack/data/hats/predicates/is_in_mansion.json @@ -0,0 +1,6 @@ +{ + "condition": "minecraft:location_check", + "predicate": { + "feature": "mansion" + } +} \ No newline at end of file From 8474927f5376275f5d08fbe5ada259b9729e5115 Mon Sep 17 00:00:00 2001 From: OraneUtan Date: Tue, 26 May 2020 19:40:19 +0200 Subject: [PATCH 52/58] Renamed chance predicate that mobs have hats --- datapack/data/hats/functions/dress/drowned.mcfunction | 2 +- datapack/data/hats/functions/dress/husk.mcfunction | 2 +- datapack/data/hats/functions/dress/skeleton.mcfunction | 2 +- datapack/data/hats/functions/dress/stray.mcfunction | 2 +- datapack/data/hats/functions/dress/zombie.mcfunction | 2 +- ...tile_chance_has_hat.json => chance_hostile_mob_has_hat.json} | 0 6 files changed, 5 insertions(+), 5 deletions(-) rename datapack/data/hats/predicates/{hostile_chance_has_hat.json => chance_hostile_mob_has_hat.json} (100%) diff --git a/datapack/data/hats/functions/dress/drowned.mcfunction b/datapack/data/hats/functions/dress/drowned.mcfunction index 4a87248..b2eb7f7 100644 --- a/datapack/data/hats/functions/dress/drowned.mcfunction +++ b/datapack/data/hats/functions/dress/drowned.mcfunction @@ -1,7 +1,7 @@ # executor: Drowned beeing dressed # descr: Try dressing a Drowned with a hat -execute if predicate hats:hostile_chance_has_hat run loot replace entity @s armor.head loot hats:dress/drowned +execute if predicate hats:chance_hostile_mob_has_hat run loot replace entity @s armor.head loot hats:dress/drowned execute as @s[nbt={ArmorItems:[{},{},{},{Count:1b}]}] run data modify entity @s ArmorDropChances[3] set value 1.0f tag @s add hats.mob.dont_dress \ No newline at end of file diff --git a/datapack/data/hats/functions/dress/husk.mcfunction b/datapack/data/hats/functions/dress/husk.mcfunction index 83f7f9d..244d386 100644 --- a/datapack/data/hats/functions/dress/husk.mcfunction +++ b/datapack/data/hats/functions/dress/husk.mcfunction @@ -1,7 +1,7 @@ # executor: The Husk beeing dressed # descr: Try dressing a Husk with a hat -execute if predicate hats:hostile_chance_has_hat run loot replace entity @s armor.head loot hats:dress/husk +execute if predicate hats:chance_hostile_mob_has_hat run loot replace entity @s armor.head loot hats:dress/husk execute as @s[nbt={ArmorItems:[{},{},{},{Count:1b}]}] run data modify entity @s ArmorDropChances[3] set value 1.0f tag @s add hats.mob.dont_dress \ No newline at end of file diff --git a/datapack/data/hats/functions/dress/skeleton.mcfunction b/datapack/data/hats/functions/dress/skeleton.mcfunction index 903a31a..fd51444 100644 --- a/datapack/data/hats/functions/dress/skeleton.mcfunction +++ b/datapack/data/hats/functions/dress/skeleton.mcfunction @@ -5,7 +5,7 @@ execute if predicate hats:is_in_mansion if predicate hats:is_dark_night if predicate hats:chance_mob_is_ghost run function hats:dress/mob_as_ghost # Else try to give the Skeleton a hat -execute as @s[tag=!hats.mob.is_ghost] if predicate hats:hostile_chance_has_hat run loot replace entity @s armor.head loot hats:dress/skeleton +execute as @s[tag=!hats.mob.is_ghost] if predicate hats:chance_hostile_mob_has_hat run loot replace entity @s armor.head loot hats:dress/skeleton execute as @s[tag=!hats.mob.is_ghost] run data modify entity @s ArmorDropChances[3] set value 1.0f tag @s add hats.mob.dont_dress \ No newline at end of file diff --git a/datapack/data/hats/functions/dress/stray.mcfunction b/datapack/data/hats/functions/dress/stray.mcfunction index e0caa5f..8d88cc7 100644 --- a/datapack/data/hats/functions/dress/stray.mcfunction +++ b/datapack/data/hats/functions/dress/stray.mcfunction @@ -1,7 +1,7 @@ # executor: The Stray beeing dressed # descr: Try dressing a Stray with a hat -execute if predicate hats:hostile_chance_has_hat run loot replace entity @s armor.head loot hats:dress/stray +execute if predicate hats:chance_hostile_mob_has_hat run loot replace entity @s armor.head loot hats:dress/stray execute as @s[nbt={ArmorItems:[{},{},{},{Count:1b}]}] run data modify entity @s ArmorDropChances[3] set value 1.0f tag @s add hats.mob.dont_dress \ No newline at end of file diff --git a/datapack/data/hats/functions/dress/zombie.mcfunction b/datapack/data/hats/functions/dress/zombie.mcfunction index 0db589d..2299f44 100644 --- a/datapack/data/hats/functions/dress/zombie.mcfunction +++ b/datapack/data/hats/functions/dress/zombie.mcfunction @@ -5,7 +5,7 @@ execute if predicate hats:is_in_mansion if predicate hats:is_dark_night if predicate hats:chance_mob_is_ghost run function hats:dress/mob_as_ghost # Else try to give the Zombie a hat -execute as @s[tag=!hats.mob.is_ghost] if predicate hats:hostile_chance_has_hat run loot replace entity @s armor.head loot hats:dress/zombie +execute as @s[tag=!hats.mob.is_ghost] if predicate hats:chance_hostile_mob_has_hat run loot replace entity @s armor.head loot hats:dress/zombie execute as @s[tag=!hats.mob.is_ghost] run data modify entity @s ArmorDropChances[3] set value 1.0f tag @s add hats.mob.dont_dress \ No newline at end of file diff --git a/datapack/data/hats/predicates/hostile_chance_has_hat.json b/datapack/data/hats/predicates/chance_hostile_mob_has_hat.json similarity index 100% rename from datapack/data/hats/predicates/hostile_chance_has_hat.json rename to datapack/data/hats/predicates/chance_hostile_mob_has_hat.json From d6d89b055d4956522a5262e5d20909fa3f9b4962 Mon Sep 17 00:00:00 2001 From: OraneUtan Date: Tue, 26 May 2020 23:34:06 +0200 Subject: [PATCH 53/58] Added profession trade to cartographer --- .../trades/villager/profession.json | 18 ++++++++++++++++++ .../villager/can_have_profession_trade.json | 7 +++++++ 2 files changed, 25 insertions(+) diff --git a/datapack/data/hats/loot_tables/trades/villager/profession.json b/datapack/data/hats/loot_tables/trades/villager/profession.json index 74c3766..c371c89 100644 --- a/datapack/data/hats/loot_tables/trades/villager/profession.json +++ b/datapack/data/hats/loot_tables/trades/villager/profession.json @@ -81,6 +81,24 @@ "type": "minecraft:loot_table", "name": "hats:hat_on_head/frying_pan" } + ] + }, + { + "conditions": [ + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "nbt": "{VillagerData:{profession:\"minecraft:cartographer\"}}" + } + } + ], + "rolls": 1, + "entries": [ + { + "type": "minecraft:loot_table", + "name": "hats:hat_on_head/tophats/black_monocle" + } ] } ] diff --git a/datapack/data/hats/predicates/villager/can_have_profession_trade.json b/datapack/data/hats/predicates/villager/can_have_profession_trade.json index a60fe32..3a7ef7c 100644 --- a/datapack/data/hats/predicates/villager/can_have_profession_trade.json +++ b/datapack/data/hats/predicates/villager/can_have_profession_trade.json @@ -28,6 +28,13 @@ "predicate": { "nbt": "{VillagerData:{profession:\"minecraft:toolsmith\"}}" } + }, + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "nbt": "{VillagerData:{profession:\"minecraft:cartographer\"}}" + } } ] } \ No newline at end of file From 8ea2b7c20b27c6640f64046b54edae1851235c55 Mon Sep 17 00:00:00 2001 From: OraneUtan Date: Wed, 27 May 2020 10:41:35 +0200 Subject: [PATCH 54/58] Added german translation --- resourcepack/assets/minecraft/lang/de_de.json | 103 ++++++++++++++++++ resourcepack/assets/minecraft/lang/en_us.json | 8 +- 2 files changed, 107 insertions(+), 4 deletions(-) create mode 100644 resourcepack/assets/minecraft/lang/de_de.json diff --git a/resourcepack/assets/minecraft/lang/de_de.json b/resourcepack/assets/minecraft/lang/de_de.json new file mode 100644 index 0000000..c846d14 --- /dev/null +++ b/resourcepack/assets/minecraft/lang/de_de.json @@ -0,0 +1,103 @@ +{ + "advancements.hats.root.title": "Hats", + "advancements.hats.root.description": "Sammel sie alle!", + + "advancements.hats.fez.title": "Fez", + "advancements.hats.fez.description": "", + + "advancements.hats.cats.root.title": "Pelzige Freunde", + "advancements.hats.cats.root.description": "Finde einen pelzigen Freund", + "advancements.hats.cats.collect_all.title": "Verrückt nach Katzen", + "advancements.hats.cats.collect_all.description": "Sammel alle Katzen", + + "advancements.hats.tophats.root.title": "Gehobene Kreise", + "advancements.hats.tophats.root.description": "Karrierestart mit Zylinder", + "advancements.hats.tophats.collect_all_colors.title": "Hochadel", + "advancements.hats.tophats.collect_all_colors.description": "Sammel alle Zylinder Farben", + "advancements.hats.tophats.get_monocle.title": "Besonders ausgefallen", + "advancements.hats.tophats.get_monocle.description": "Erhalte einen Zylinder mit Monokel", + + "advancements.hats.glasses.root.title": "+20 Sichtweite", + "advancements.hats.glasses.root.description": "Erweitere deinen Horizont", + "advancements.hats.glasses.collect_all.title": "Öffne dein 3. Auge", + "advancements.hats.glasses.collect_all.description": "Sammel alle Brillen", + + "advancements.hats.player_masks.title": "Nein. Überhaupt nicht auffällig.", + "advancements.hats.player_masks.description": "Tarne dich", + + "advancements.hats.mario.root.title": "Wahooo!", + "advancements.hats.mario.root.description": "Erhalte einen Mario Hut", + "advancements.hats.mario.collect_all.title": "1UP!", + "advancements.hats.mario.collect_all.description": "Sammel alle Mario Hüte", + + + + "item.hats.fez.name": "Fez", + "item.hats.squid.name": "Tintenfisch", + "item.hats.arrow.name": "Pfeil Attrape", + "item.hats.frying_pan.name": "Bratpfanne", + + "item.hats.cats.ocelot.name": "Ozelot", + "item.hats.cats.tabby.name": "Getigerte Katze", + "item.hats.cats.tuxedo.name": "Schwarze Katze", + "item.hats.cats.red.name": "Rote Katze", + "item.hats.cats.siamese.name": "Siam Katze", + "item.hats.cats.british_shorthair.name": "Britisch-Kurzhaar", + "item.hats.cats.calico.name": "Calico", + "item.hats.cats.persian.name": "Perser", + "item.hats.cats.ragdoll.name": "Ragdoll", + "item.hats.cats.white.name": "Weiße Katze", + "item.hats.cats.jellie.name": "Jellie", + "item.hats.cats.black.name": "Panther Katze", + + "item.hats.tophats.white.name": "Weißer Zylinder", + "item.hats.tophats.orange.name": "Oranger Zylinder", + "item.hats.tophats.magenta.name": "Magenta Zylinder", + "item.hats.tophats.light_blue.name": "Hellblauer Zylinder", + "item.hats.tophats.yellow.name": "Gelber Zylinder", + "item.hats.tophats.lime.name": "Hellgrüner Zylinder", + "item.hats.tophats.pink.name": "Rosa Zylinder", + "item.hats.tophats.gray.name": "Grauer Zylinder", + "item.hats.tophats.light_gray.name": "Hellgrau Zylinder", + "item.hats.tophats.cyan.name": "Türkiser Zylinder", + "item.hats.tophats.purple.name": "Violetter Zylinder", + "item.hats.tophats.blue.name": "Blauer Zylinder", + "item.hats.tophats.brown.name": "Brauner Zylinder", + "item.hats.tophats.green.name": "Grüner Zylinder", + "item.hats.tophats.red.name": "Roter Zylinder", + "item.hats.tophats.black.name": "Schwarzer Zylinder", + "item.hats.tophats.rainbow.name": "Regenbogen Zylinder", + "item.hats.tophats.black_monocle.name": "Zylinder mit Monokel", + + "item.hats.glasses.sunglasses.name": "Sonnenbrille", + "item.hats.glasses.harry_potter.name": "Harry Potter Brille", + "item.hats.glasses.half_rim.name": "Halbrandbrille", + "item.hats.glasses.rainbow.name": "Regenbogenbrille", + "item.hats.glasses.librarian.name": "Bibliothekaren Brille", + "item.hats.glasses.three_d.name": "3D Brille", + + "item.hats.accessories.ninja_headband.name": "Ninja Stirnband", + "item.hats.accessories.steve_mask.name": "Steve Maske", + "item.hats.accessories.alex_mask.name": "Alex Maske", + "item.hats.accessories.snorkel_mask_blue.name": "Blaue Schnorchelmaske", + "item.hats.accessories.snorkel_mask_red.name": "Rote Schnorchelmaske", + "item.hats.accessories.googly_eyes.name": "Wackelaugen", + + "item.hats.villager.armorer.name": "Rüstungsschmied Visier", + "item.hats.villager.farmer.name": "Bauern Strohhut", + "item.hats.villager.nose.name": "Dorfbewohner Nase", + + "item.hats.mario.mario_cap.name": "Mario Kappe", + "item.hats.mario.luigi_cap.name": "Luigi Kappe", + "item.hats.mario.cappy.name": "Cappy", + "item.hats.mario.toad_red.name": "Roter Toad", + "item.hats.mario.toad_blue.name": "Blauer Toad", + "item.hats.mario.toad_yellow.name": "Gelber Toad", + "item.hats.mario.toad_green.name": "Grüner Toad", + "item.hats.mario.mario.name": "Mario Cosplay", + "item.hats.mario.luigi.name": "Luigi Cosplay", + + "item.hats.halloween.wiggly_ghast.name": "Wackelnder Geist", + "item.hats.halloween.native_american_headband.name": "Indianer Kopfband", + "item.hats.halloween.jason_mask.name": "Jason Maske" +} \ No newline at end of file diff --git a/resourcepack/assets/minecraft/lang/en_us.json b/resourcepack/assets/minecraft/lang/en_us.json index f8e8606..5df04e6 100644 --- a/resourcepack/assets/minecraft/lang/en_us.json +++ b/resourcepack/assets/minecraft/lang/en_us.json @@ -17,9 +17,9 @@ "advancements.hats.tophats.get_monocle.title": "Extra fancy", "advancements.hats.tophats.get_monocle.description": "Obtain the monocle Tophat", - "advancements.hats.glasses.root.title": "Blindness cured", - "advancements.hats.glasses.root.description": "Help yourself to some glasses", - "advancements.hats.glasses.collect_all.title": "5D vision", + "advancements.hats.glasses.root.title": "+20 Vision", + "advancements.hats.glasses.root.description": "Expand your horizon", + "advancements.hats.glasses.collect_all.title": "Open your third eye", "advancements.hats.glasses.collect_all.description": "Collect all glasses", "advancements.hats.player_masks.title": "Not suspicious", @@ -34,7 +34,7 @@ "item.hats.fez.name": "Fez", "item.hats.squid.name": "Squid", - "item.hats.arrow.name": "Arrow Prop", + "item.hats.arrow.name": "Fake Arrow", "item.hats.frying_pan.name": "Frying Pan", "item.hats.cats.ocelot.name": "Ocelot", From ecc8395fe8b189013f9f7ee2f0192c6669b653d4 Mon Sep 17 00:00:00 2001 From: OraneUtan Date: Wed, 27 May 2020 12:22:40 +0200 Subject: [PATCH 55/58] Root items for custom models can now be configured in registry --- build/generate_base_item_models.py | 30 ++++---------------------- build/registry.py | 34 ++++++++++++++++++++++++++---- hat_registry.yml | 19 +++++++++++++++++ 3 files changed, 53 insertions(+), 30 deletions(-) diff --git a/build/generate_base_item_models.py b/build/generate_base_item_models.py index 7c83ff8..7be448b 100644 --- a/build/generate_base_item_models.py +++ b/build/generate_base_item_models.py @@ -8,33 +8,11 @@ def minecraft_item_model_overwrite(custom_model_data, model_path): """ Creates a custom model overwrite for minecraft item models """ return { "predicate": { "custom_model_data": custom_model_data }, "model": model_path } -def minecraft_item_model(base_model, overrides=None): - """ Creates a minecraft item model """ - if overrides: - base_model['overrides'] = overrides - return base_model - registry = Registry() hats = list(registry.all_hats()) overrides = [minecraft_item_model_overwrite(hat.custom_model_data, hat.model_path) for hat in hats] -# Create item model for hats -with open("resourcepack/assets/minecraft/models/item/leather_helmet.json", "w+") as file: - leather_helmet = minecraft_item_model({ - "parent": "item/generated", - "textures": { - "layer0": "item/leather_helmet", - "layer1": "item/leather_helmet_overlay" - } - }, overrides) - json.dump(leather_helmet, file, separators=(',', ':')) - -# Create item model for hats on entities heads -with open("resourcepack/assets/minecraft/models/item/stick.json", "w+") as file: - stick = minecraft_item_model({ - "parent": "item/handheld", - "textures": { - "layer0": "item/stick" - } - }, overrides) - json.dump(stick, file, separators=(',', ':')) \ No newline at end of file +for key, item_model in registry.overwritten_item_models.items(): + item_model.model["overrides"] = overrides + with open(item_model.path, "w+") as file: + json.dump(item_model.model, file, separators=(',', ':')) \ No newline at end of file diff --git a/build/registry.py b/build/registry.py index 7e4a191..e84e9c5 100644 --- a/build/registry.py +++ b/build/registry.py @@ -4,10 +4,12 @@ class Registry: def __init__(self): self.registry = load_yaml_file("hat_registry.yml") + self.overwritten_item_models = Registry._parse_root_items(self.registry) + self.categories = Registry._parse_categories(self.registry) def all_hats(self): - for category_name, category_hats in map(lambda category: list(category.items())[0], self.registry['categories']): - for hat in self._parse_hats(category_name, category_hats): + for category_name, category_hats in self.categories.items(): + for hat in category_hats: yield hat def categories(self): @@ -15,7 +17,16 @@ def categories(self): hats = list(self._parse_hats(category_name, category_hats)) yield (category_name, hats) - def _parse_hats(self, category_name, json_hats): + @classmethod + def _parse_categories(cls, registry): + categories = dict() + for category_name, category_hats in map(lambda category: list(category.items())[0], registry['categories']): + hats = list(Registry._parse_hats(category_name, category_hats)) + categories[category_name] = hats + return categories + + @classmethod + def _parse_hats(cls, category_name, json_hats): for hat_name, hat_data in map(lambda category_entry: list(category_entry.items())[0], json_hats): custom_model_data = hat_data['custom_model_data'] @@ -30,6 +41,22 @@ def _parse_hats(self, category_name, json_hats): translation = f"item.hats.{category_name}.{hat_name}" yield Hat(hat_name, category_name, custom_model_data, model, type, translation) + @classmethod + def _parse_root_items(cls, registry): + root_items = dict() + for key, val in registry["overwritten-item-models"].items(): + id = val["id"] + if id.startswith("minecraft"): + id = id[len("minecraft:"):] + root_items.update({key:ItemModel(val["id"], f"resourcepack/assets/minecraft/models/item/{id}.json", val["model"])}) + return root_items + +@dataclass +class ItemModel: + id: str + path: str + model: dict + @dataclass class Hat: name: str @@ -39,7 +66,6 @@ class Hat: type: str translation: str - def load_yaml_file(path): with open(path) as file: return yaml.load(file, Loader=yaml.Loader) \ No newline at end of file diff --git a/hat_registry.yml b/hat_registry.yml index 3bc84ce..5636a26 100644 --- a/hat_registry.yml +++ b/hat_registry.yml @@ -75,3 +75,22 @@ categories: - wiggly_ghast: { custom_model_data: 7773180 } - native_american_headband: { custom_model_data: 7773181 } - jason_mask: { custom_model_data: 7773182 } + +overwritten-item-models: + normal: + id: "minecraft:leather_helmet" + model: { + parent: "item/generated", + textures: { + layer0: "item/leather_helmet", + layer1: "item/leather_helmet_overlay" + } + } + on_head: + id: "minecraft:stick" + model: { + parent: "item/handheld", + textures: { + layer0: "item/stick" + } + } \ No newline at end of file From 3c151a1bb3a892be4c4fc1667d7316cecf226bd8 Mon Sep 17 00:00:00 2001 From: OraneUtan Date: Wed, 27 May 2020 12:46:48 +0200 Subject: [PATCH 56/58] Simplified solution for categorizing hat names --- build/registry.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/build/registry.py b/build/registry.py index e84e9c5..c11da45 100644 --- a/build/registry.py +++ b/build/registry.py @@ -29,16 +29,15 @@ def _parse_categories(cls, registry): def _parse_hats(cls, category_name, json_hats): for hat_name, hat_data in map(lambda category_entry: list(category_entry.items())[0], json_hats): custom_model_data = hat_data['custom_model_data'] - + if category_name == "*": - # Category "*" contains all uncategorized hats -> don't add a category to any paths - model = f"item/hats/{hat_name}" - type = f"hats.hat.type.{hat_name}" - translation = f"item.hats.{hat_name}" + categorized_name = f"{hat_name}" else: - model = f"item/hats/{category_name}/{hat_name}" - type = f"hats.hat.type.{category_name}.{hat_name}" - translation = f"item.hats.{category_name}.{hat_name}" + categorized_name = f"{category_name}{{0}}{hat_name}" + + model = f"item/hats/{categorized_name.format('/')}" + type = f"hats.hat.type.{categorized_name.format('.')}" + translation = f"item.hats.{categorized_name.format('.')}" yield Hat(hat_name, category_name, custom_model_data, model, type, translation) @classmethod From 946fc1538a68bafd679b87db23fd2624631869c7 Mon Sep 17 00:00:00 2001 From: OraneUtan Date: Wed, 27 May 2020 13:13:29 +0200 Subject: [PATCH 57/58] Registry now supports adding lore to loot_tables --- build/generate_hat_loot_tables.py | 37 ++++++++++++++++++------------- build/registry.py | 8 ++++++- 2 files changed, 29 insertions(+), 16 deletions(-) diff --git a/build/generate_hat_loot_tables.py b/build/generate_hat_loot_tables.py index f05430d..bd6ff51 100644 --- a/build/generate_hat_loot_tables.py +++ b/build/generate_hat_loot_tables.py @@ -7,22 +7,32 @@ def hat_loot_table(hat, base_item): else: translation = f"{hat.category}.{hat.name}" + functions = [ + { + "function": "minecraft:set_name", + "name": { + "translate": f"item.hats.{translation}.name" + } + }, + { + "function": "set_nbt", + "tag": f'{{CustomModelData:{hat.custom_model_data}, Tags:["is_hat", "hats.hat", "{hat.type}"]}}' + } + ] + + # Add lore lines if any exist + if hat.lore: + lines = [{"translate": f"{line}"} for line in hat.lore] + functions.append({ + "function": "minecraft:set_lore", + "lore": lines + }) + return { "type": "minecraft:generic", "pools": [ { - "functions": [ - { - "function": "minecraft:set_name", - "name": { - "translate": f"item.hats.{translation}.name" - } - }, - { - "function": "set_nbt", - "tag": f'{{CustomModelData:{hat.custom_model_data}, Tags:["is_hat", "hats.hat", "{hat.type}"]}}' - } - ], + "functions": functions, "rolls": 1, "entries": [ { @@ -35,9 +45,6 @@ def hat_loot_table(hat, base_item): ] } -hats_root_model = "resourcepack/assets/minecraft/models/item/leather_helmet.json" -hats_on_head_root_model = "resourecpack/assets/minecraft/models/item/stick.json" - registry = Registry() hats = list(registry.all_hats()) diff --git a/build/registry.py b/build/registry.py index c11da45..a9d1909 100644 --- a/build/registry.py +++ b/build/registry.py @@ -38,7 +38,12 @@ def _parse_hats(cls, category_name, json_hats): model = f"item/hats/{categorized_name.format('/')}" type = f"hats.hat.type.{categorized_name.format('.')}" translation = f"item.hats.{categorized_name.format('.')}" - yield Hat(hat_name, category_name, custom_model_data, model, type, translation) + + lore = None + if "num_lore_lines" in hat_data: + lore = [f"item.hats.{categorized_name.format('.')}.lore{i+1}" for i in range(hat_data.get("num_lore_lines", 0))] + + yield Hat(hat_name, category_name, custom_model_data, model, type, translation, lore) @classmethod def _parse_root_items(cls, registry): @@ -64,6 +69,7 @@ class Hat: model_path: str type: str translation: str + lore: list def load_yaml_file(path): with open(path) as file: From ab0ecd116def2c527172f9554f66cc154a7157ca Mon Sep 17 00:00:00 2001 From: OraneUtan Date: Wed, 27 May 2020 13:55:30 +0200 Subject: [PATCH 58/58] Added lore to nose, alex-/steve-mask and arrow --- .../data/hats/loot_tables/hat/accessories/alex_mask.json | 2 +- .../data/hats/loot_tables/hat/accessories/steve_mask.json | 2 +- datapack/data/hats/loot_tables/hat/arrow.json | 2 +- datapack/data/hats/loot_tables/hat/villager/nose.json | 2 +- .../loot_tables/hat_on_head/accessories/alex_mask.json | 2 +- .../loot_tables/hat_on_head/accessories/steve_mask.json | 2 +- datapack/data/hats/loot_tables/hat_on_head/arrow.json | 2 +- .../data/hats/loot_tables/hat_on_head/villager/nose.json | 2 +- hat_registry.yml | 8 ++++---- resourcepack/assets/minecraft/lang/de_de.json | 4 ++++ resourcepack/assets/minecraft/lang/en_us.json | 4 ++++ 11 files changed, 20 insertions(+), 12 deletions(-) diff --git a/datapack/data/hats/loot_tables/hat/accessories/alex_mask.json b/datapack/data/hats/loot_tables/hat/accessories/alex_mask.json index a319c47..c1ac12a 100644 --- a/datapack/data/hats/loot_tables/hat/accessories/alex_mask.json +++ b/datapack/data/hats/loot_tables/hat/accessories/alex_mask.json @@ -1 +1 @@ -{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.accessories.alex_mask.name"}},{"function":"set_nbt","tag":"{CustomModelData:3152, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.accessories.alex_mask\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat","expand":true}]}]} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.accessories.alex_mask.name"}},{"function":"set_nbt","tag":"{CustomModelData:3152, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.accessories.alex_mask\"]}"},{"function":"minecraft:set_lore","lore":[{"translate":"item.hats.accessories.alex_mask.lore1"}]}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat/accessories/steve_mask.json b/datapack/data/hats/loot_tables/hat/accessories/steve_mask.json index d49e3a3..e6923df 100644 --- a/datapack/data/hats/loot_tables/hat/accessories/steve_mask.json +++ b/datapack/data/hats/loot_tables/hat/accessories/steve_mask.json @@ -1 +1 @@ -{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.accessories.steve_mask.name"}},{"function":"set_nbt","tag":"{CustomModelData:3151, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.accessories.steve_mask\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat","expand":true}]}]} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.accessories.steve_mask.name"}},{"function":"set_nbt","tag":"{CustomModelData:3151, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.accessories.steve_mask\"]}"},{"function":"minecraft:set_lore","lore":[{"translate":"item.hats.accessories.steve_mask.lore1"}]}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat/arrow.json b/datapack/data/hats/loot_tables/hat/arrow.json index 4e6e02a..2cca233 100644 --- a/datapack/data/hats/loot_tables/hat/arrow.json +++ b/datapack/data/hats/loot_tables/hat/arrow.json @@ -1 +1 @@ -{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.arrow.name"}},{"function":"set_nbt","tag":"{CustomModelData:3002, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.arrow\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat","expand":true}]}]} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.arrow.name"}},{"function":"set_nbt","tag":"{CustomModelData:3002, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.arrow\"]}"},{"function":"minecraft:set_lore","lore":[{"translate":"item.hats.arrow.lore1"}]}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat/villager/nose.json b/datapack/data/hats/loot_tables/hat/villager/nose.json index 33c5c43..2cf6e3c 100644 --- a/datapack/data/hats/loot_tables/hat/villager/nose.json +++ b/datapack/data/hats/loot_tables/hat/villager/nose.json @@ -1 +1 @@ -{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.villager.nose.name"}},{"function":"set_nbt","tag":"{CustomModelData:3162, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.villager.nose\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat","expand":true}]}]} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.villager.nose.name"}},{"function":"set_nbt","tag":"{CustomModelData:3162, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.villager.nose\"]}"},{"function":"minecraft:set_lore","lore":[{"translate":"item.hats.villager.nose.lore1"}]}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat_on_head/accessories/alex_mask.json b/datapack/data/hats/loot_tables/hat_on_head/accessories/alex_mask.json index d190c45..a392277 100644 --- a/datapack/data/hats/loot_tables/hat_on_head/accessories/alex_mask.json +++ b/datapack/data/hats/loot_tables/hat_on_head/accessories/alex_mask.json @@ -1 +1 @@ -{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.accessories.alex_mask.name"}},{"function":"set_nbt","tag":"{CustomModelData:3152, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.accessories.alex_mask\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat_on_head","expand":true}]}]} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.accessories.alex_mask.name"}},{"function":"set_nbt","tag":"{CustomModelData:3152, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.accessories.alex_mask\"]}"},{"function":"minecraft:set_lore","lore":[{"translate":"item.hats.accessories.alex_mask.lore1"}]}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat_on_head","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat_on_head/accessories/steve_mask.json b/datapack/data/hats/loot_tables/hat_on_head/accessories/steve_mask.json index 0ac8e69..5364fd3 100644 --- a/datapack/data/hats/loot_tables/hat_on_head/accessories/steve_mask.json +++ b/datapack/data/hats/loot_tables/hat_on_head/accessories/steve_mask.json @@ -1 +1 @@ -{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.accessories.steve_mask.name"}},{"function":"set_nbt","tag":"{CustomModelData:3151, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.accessories.steve_mask\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat_on_head","expand":true}]}]} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.accessories.steve_mask.name"}},{"function":"set_nbt","tag":"{CustomModelData:3151, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.accessories.steve_mask\"]}"},{"function":"minecraft:set_lore","lore":[{"translate":"item.hats.accessories.steve_mask.lore1"}]}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat_on_head","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat_on_head/arrow.json b/datapack/data/hats/loot_tables/hat_on_head/arrow.json index 8cfdaa5..264c9e7 100644 --- a/datapack/data/hats/loot_tables/hat_on_head/arrow.json +++ b/datapack/data/hats/loot_tables/hat_on_head/arrow.json @@ -1 +1 @@ -{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.arrow.name"}},{"function":"set_nbt","tag":"{CustomModelData:3002, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.arrow\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat_on_head","expand":true}]}]} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.arrow.name"}},{"function":"set_nbt","tag":"{CustomModelData:3002, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.arrow\"]}"},{"function":"minecraft:set_lore","lore":[{"translate":"item.hats.arrow.lore1"}]}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat_on_head","expand":true}]}]} \ No newline at end of file diff --git a/datapack/data/hats/loot_tables/hat_on_head/villager/nose.json b/datapack/data/hats/loot_tables/hat_on_head/villager/nose.json index 278143b..3d727a6 100644 --- a/datapack/data/hats/loot_tables/hat_on_head/villager/nose.json +++ b/datapack/data/hats/loot_tables/hat_on_head/villager/nose.json @@ -1 +1 @@ -{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.villager.nose.name"}},{"function":"set_nbt","tag":"{CustomModelData:3162, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.villager.nose\"]}"}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat_on_head","expand":true}]}]} \ No newline at end of file +{"type":"minecraft:generic","pools":[{"functions":[{"function":"minecraft:set_name","name":{"translate":"item.hats.villager.nose.name"}},{"function":"set_nbt","tag":"{CustomModelData:3162, Tags:[\"is_hat\", \"hats.hat\", \"hats.hat.type.villager.nose\"]}"},{"function":"minecraft:set_lore","lore":[{"translate":"item.hats.villager.nose.lore1"}]}],"rolls":1,"entries":[{"type":"tag","name":"hats:hat_on_head","expand":true}]}]} \ No newline at end of file diff --git a/hat_registry.yml b/hat_registry.yml index 5636a26..4d2ac6d 100644 --- a/hat_registry.yml +++ b/hat_registry.yml @@ -2,7 +2,7 @@ categories: - "*": - fez: { custom_model_data: 3000 } - squid: { custom_model_data: 3001 } - - arrow: { custom_model_data: 3002 } + - arrow: { custom_model_data: 3002, num_lore_lines: 1 } - frying_pan: { custom_model_data: 3003 } - tophats: @@ -49,8 +49,8 @@ categories: - accessories: - ninja_headband: { custom_model_data: 3150 } - - steve_mask: { custom_model_data: 3151 } - - alex_mask: { custom_model_data: 3152 } + - steve_mask: { custom_model_data: 3151, num_lore_lines: 1 } + - alex_mask: { custom_model_data: 3152, num_lore_lines: 1 } - snorkel_mask_blue: { custom_model_data: 3153 } - snorkel_mask_red: { custom_model_data: 3154 } - googly_eyes: { custom_model_data: 3155 } @@ -58,7 +58,7 @@ categories: - villager: - armorer: { custom_model_data: 3160 } - farmer: { custom_model_data: 3161 } - - nose: { custom_model_data: 3162 } + - nose: { custom_model_data: 3162, num_lore_lines: 1 } - mario: - mario_cap: { custom_model_data: 3170 } diff --git a/resourcepack/assets/minecraft/lang/de_de.json b/resourcepack/assets/minecraft/lang/de_de.json index c846d14..f8ae979 100644 --- a/resourcepack/assets/minecraft/lang/de_de.json +++ b/resourcepack/assets/minecraft/lang/de_de.json @@ -35,6 +35,7 @@ "item.hats.fez.name": "Fez", "item.hats.squid.name": "Tintenfisch", "item.hats.arrow.name": "Pfeil Attrape", + "item.hats.arrow.lore1": ">>-o.o->", "item.hats.frying_pan.name": "Bratpfanne", "item.hats.cats.ocelot.name": "Ozelot", @@ -78,7 +79,9 @@ "item.hats.accessories.ninja_headband.name": "Ninja Stirnband", "item.hats.accessories.steve_mask.name": "Steve Maske", + "item.hats.accessories.steve_mask.lore1": "Tag 30: Status \"Unentdeckt\"", "item.hats.accessories.alex_mask.name": "Alex Maske", + "item.hats.accessories.alex_mask.lore1": "Tag 30: Status \"Unentdeckt\"", "item.hats.accessories.snorkel_mask_blue.name": "Blaue Schnorchelmaske", "item.hats.accessories.snorkel_mask_red.name": "Rote Schnorchelmaske", "item.hats.accessories.googly_eyes.name": "Wackelaugen", @@ -86,6 +89,7 @@ "item.hats.villager.armorer.name": "Rüstungsschmied Visier", "item.hats.villager.farmer.name": "Bauern Strohhut", "item.hats.villager.nose.name": "Dorfbewohner Nase", + "item.hats.villager.nose.lore1": "Hab deine Nase :P", "item.hats.mario.mario_cap.name": "Mario Kappe", "item.hats.mario.luigi_cap.name": "Luigi Kappe", diff --git a/resourcepack/assets/minecraft/lang/en_us.json b/resourcepack/assets/minecraft/lang/en_us.json index 5df04e6..a326b1f 100644 --- a/resourcepack/assets/minecraft/lang/en_us.json +++ b/resourcepack/assets/minecraft/lang/en_us.json @@ -35,6 +35,7 @@ "item.hats.fez.name": "Fez", "item.hats.squid.name": "Squid", "item.hats.arrow.name": "Fake Arrow", + "item.hats.arrow.lore1": ">>-o.o->", "item.hats.frying_pan.name": "Frying Pan", "item.hats.cats.ocelot.name": "Ocelot", @@ -78,7 +79,9 @@ "item.hats.accessories.ninja_headband.name": "Ninja Headband", "item.hats.accessories.steve_mask.name": "Steve Mask", + "item.hats.accessories.steve_mask.lore1": "Greetings fellow Player", "item.hats.accessories.alex_mask.name": "Alex Mask", + "item.hats.accessories.alex_mask.lore1": "Greetings fellow Player", "item.hats.accessories.snorkel_mask_blue.name": "Blue Snorkel Mask", "item.hats.accessories.snorkel_mask_red.name": "Red Snorkel Mask", "item.hats.accessories.googly_eyes.name": "Googly Eyes", @@ -86,6 +89,7 @@ "item.hats.villager.armorer.name": "Armorer Mask", "item.hats.villager.farmer.name": "Farmers Strawhat", "item.hats.villager.nose.name": "Villager Nose", + "item.hats.villager.nose.lore1": "Got your nose :P", "item.hats.mario.mario_cap.name": "Mario Cap", "item.hats.mario.luigi_cap.name": "Luigi Cap",