-
Notifications
You must be signed in to change notification settings - Fork 8
Data Pack support
Extra Golems for 1.17.1+ allows users to add golems using data packs and resource packs. Each golem is defined by two JSON files. By simply adding these files, any golem imaginable can appear in-game!
The first file required for a golem is the JSON that defines its attributes and behavior (health, attack damage, building blocks, multitexture settings, AI, etc.). This information is sent from the server to the client when using multiplayer. These files are stored in a data pack.
This file is stored as data/<mod_id>/golem_stats/<material>.json. <mod_id> is a unique namespace for the golem. <material> is a block or material, but can be anything so long as the name is unique.
Here is a list of all accepted values in the data file.
-
attributes(Required): The attributes of the golem. See Attributes -
swim_ability(Optional): How the golem interacts with water. Values are"sink"(the golem sinks in water),"float"(the golem floats in water), or"swim"(the golem swims in water). Defaults to"sink". -
glow(Optional): Maximum light level provided by the golem. Values are0-15. Defaults to0. -
power(Optional): Maximum power level provided by the golem. Values are0-15. Defaults to0. -
hidden(Optional): Whether to omit the golem from the Extra Golems Guide Book. Defaults tofalse. -
sound(Optional): The sound played when the golem moves or attacks. Values are a sound resource location. Defaults to"minecraft:block.stone.step". -
blocks(Required if not multitexture): The blocks or block tags that are used to build the golem. Accepts a list (or single entry) of resource locations. Block IDs are in the form"mod:block_name"and block tags are in the form"#mod:tag_name" -
heal_items(Optional): A map of items or item tags that can heal the golem, along with the percentage of health restored by each one. Accepts resource location and number pairs. Block IDs are in the form"mod:block_name"and block tags are in the form"#mod:tag_name" -
multitexture(Optional): The multiple textures settings of the golem. See Multitexture data -
behavior(Optional): The list of the golem's behaviors. See Behavior
The attributes of the golem. Contains the following values:
-
health(Optional): The maximum health of the golem. Defaults to100.0. -
attack(Optional): The attack damage dealt by the golem. Defaults to15.0. -
attack_knockback(Optional): The knockback strength of the golem. Defaults to0.0. -
speed(Optional): The movement speed of the golem. Defaults to0.25. -
knockback_resistance(Optional): The knockback resistance of the golem. Defaults to0.4. -
armor(Optional): The armor stat of the golem. Defaults to0.0 -
immune_to_fire(Optional): Whether the golem is immune to fire damage. Defaults tofalse. -
immune_to_explosions(Optional): Whether the golem is immune to blast damage. Defaults tofalse. -
hurt_by_fall(Optional): Whether the golem takes damage when falling. Defaults tofalse. -
hurt_by_water(Optional): Whether the golem takes damage when in water or rain. Defaults tofalse. -
hurt_by_heat(Optional): Whether the golem takes damage when in warm biomes. Defaults tofalse.
When the multitexture value is added to a data file, the golem is able to change textures. This makes it easier to create golems that have identical stats and behavior but have different textures. Here are the values that are used:
-
texture_count(Required): The number of textures -
cycle(Optional): Whether the golem changes to the next texture when clicked on by the player. Defaults tofalse. -
textures(Required): A map of texture IDs, along with various settings associated with each one. Each value is in the form"<texture_id>": <entry>. See Multitexture data entry
Each multitexture entry specifies the following:
-
blocks(Optional): The blocks or block tags that are associated with this texture. Accepts a list (or single entry) of resource locations. Block IDs are in the form"mod:block_name"and block tags are in the form"#mod:tag_name" -
loot_table(Optional): The loot table resource location to use when the golem with this texture is killed. If unspecified, the golem's main loot table is used. See (Loot table)[#loot-table]. -
light(Optional): The light provided by the golem when it has this texture. Can only be used ifglowwas defined earlier to specify a maximum light level. Defaults to0.
TO DO
This list is used to add special behavior to the golem such as shooting arrows, passive potion effects, lighting enemies on fire, freezing water, and more. Multiple behaviors of the same type can be added, but some behaviors will only use the first entry (for example, the crafting menu behavior).
-
type(Required): Determines which behavior is added to the golem and what other information will be needed. Accepts a resource location ID of a behavior. Acceptable values are listed below.-
golems:aoe_dry: Allows the golem to remove water/waterlogged blocks -
golems:aoe_freeze: Allows the golem to freeze water and lava -
golems:aoe_grow: Allows the golem to grow nearby crops -
golems:burn_in_sun: Causes the golem to burn in sunlight and seek shelter during the day -
golems:change_texture: Causes a multitexture golem to change its texture based on conditions such as being wet/dry, fueled/empty, or randomly each tick -
golems:crafting_menu: Allows a player to open a crafting menu when clicking on the golem -
golems:explode: Causes the golem to create explosions when killed and sometimes when attacking or hurt -
golems:follow: Causes the golem to detect and follow a specific type of entity -
golems:hurt: Allows the golem to react when hurt, such as fire, potion effects, or summoning an entity -
golems:attack: Allows the golem to use a special attack, such as fire, potion effects, or summoning an entity -
golems:place_blocks: Allows the golem to passively place specific blocks -
golems:passive_effect: Gives the golem a potion effect chosen from a list -
golems:shoot_arrows: Allows the golem to pick up, store, and shoot arrows -
golems:split_on_death: Causes the golem to spawn mini-golems upon death -
golems:teleport: Causes the golem to teleport randomly when hurt, attacking, or idle -
golems:tempt: Causes the golem to follow players who are holding specific items -
golems:use_fuel: Causes the golem to require fuel to move and attack
-
Allows the golem to remove water/waterlogged blocks.
-
type:"golems:aoe_dry" -
range: The radius of affected blocks. Defaults to 0. -
interval: The (average) number of ticks between water-absorbing cycles. Defaults to 0. -
sphere:trueto affect a spherical area around the golem,falseto affect a disk-shaped area below the golem. Defaults tofalse.
Used in the Sponge Golem.
Allows the golem to change lava to obsidian/cobblestone and water to ice/packed ice.
-
type:"golems:aoe_freeze" -
range: The radius of affected blocks. Defaults to 0. -
interval: The (average) number of ticks between liquid-freezing cycles. Defaults to 0. -
sphere:trueto affect a spherical area around the golem,falseto affect a disk-shaped area below the golem. Defaults tofalse. -
frosted:trueto replace water with frosted (temporary) ice. Defaults tofalse.
Used in the Ice Golem.
Allows the golem to grow nearby crops.
-
type:"golems:aoe_grow" -
range: The radius of affected blocks. Defaults to 0. -
interval: The (average) number of ticks between crop-growing cycles. Defaults to 0. -
chance: The percent chance [0.0 - 1.0] for each nearby crop to grow
Used in the Hay Golem.
Causes the golem to burn in sunlight and seek shelter during the day.
-
type:"golems:burn_in_sun" -
priority: The goal priority, usually1 -
chance: The percent chance [0.0 - 1.0] for the golem to light on fire each tick that it is in direct sunlight
Used in the Bone Golem.
Causes a multitexture golem to change its texture based on conditions such as being wet/dry, fueled/empty, or randomly each tick.
-
type:"golems:change_texture" -
tick: Causes the golem to try to change its texture each tick.-
chance: The percent chance [0.0 - 1.0] for the golem to change its texture -
textures: A map of texture IDs. The key is the current texture and the value is the desired texture if the random chance passed. If a key-value pair is not specified for a texture ID, then the texture will not change.
-
-
wet: Causes the golem to try to change its texture each tick that it is wet. When present, thedrymap must also be specified.-
chance: Same as above -
textures: Same as above
-
-
dry: Causes the golem to try to change its texture each tick that it is not wet. When present, thewetmap must also be specified.-
chance: Same as above -
textures: Same as above
-
-
fuel: Causes the golem to try to change its texture each tick that it is has fuel. When present, thefuel_emptymap must also be specified.-
chance: Same as above -
textures: Same as above
-
-
fuel_empty: Causes the golem to try to change its texture each tick that it does not have fuel. When present, thefuelmap must also be specified.-
chance: Same as above -
textures: Same as above
-
Used in the Coral Golem, Furnace Golem, and Copper Golem.
Allows a player to open a crafting menu when clicking on the golem.
-
type:"golems:crafting_menu"There are no other parameters.
Used in the Crafting Golem.
Causes the golem to create explosions when killed and sometimes when attacking or hurt.
-
type:"golems:explode" -
range: The radial size of the explosion. Defaults to0.0 -
fuse: The minimum time to wait after being ignited before causing an explosion. Defaults to0 -
chance_on_hurt: The percent chance [0.0 - 1.0] for the golem to light its fuse when hurt -
chance_on_attack: The percent chance [0.0 - 1.0] for the golem to light its fuse when attacking
Used in the TNT Golem.
Causes the golem to detect and follow a specific type of entity.
-
type:"golems:follow" -
priority: The goal priority, usually3 -
entity: The"modid:entity_name"of the entity to follow
Used in the Emerald Golem.
Allows the golem to react when hurt, such as fire, potion effects, or summoning an entity
-
type:"golems:hurt" -
fire: If present, allows the golem to set fire to either itself or its enemy-
target: Can be"self"to apply fire to the golem, or"enemy"to apply fire to its attack target -
chance: The percent chance [0.0 - 1.0] for the golem to apply fire -
time: The amount of time (in seconds) that the entity will be on fire
-
-
effect: If present, allows the golem to apply a potion effect to itself or its enemy-
target: Can be"self"to apply the effect to the golem, or"enemy"to apply the effect to its attack target -
chance: The percent chance [0.0 - 1.0] for the golem to apply fire -
effects: The possible potion effects. One will be chosen at random from the list.-
Potion: The"modid:potion_name"of the effect -
Amplifier: The effect amplifier -
Duration: The duration of the effect in ticks
-
-
-
summon: If present, allows the golem to summon an entity-
target: Can be"enemy"to make the summoned entity angry at the golem's enemy -
summon_pos: Can be"self"to summon the entity on the golem or"enemy" to summon the entity on its attack target -
chance: The percent chance [0.0 - 1.0] for the golem to summon the entity -
bonus_chance_in_rain: The additional percent chance [0.0 - 1.0] for the golem to summon the entity while it is raining -
entity: A Compound NBT Tag containing the entityidand other data, if any
-
Used in the Magma Golem, Honeycomb Golem, Lapis Golem, and others.
Allows the golem to use a special attack, such as fire, potion effects, or summoning an entity
Used in the Magma Golem, Honeycomb Golem, Lapis Golem, and others.
TO DO
Here is a complete example of a valid golem data JSON.
TO DO
Loot tables are expected to be saved as data/<mod_id>/loot_tables/entities/<material>.json. <mod_id> is the namespace for the golem. <material> is the material of the golem.
For multitexture golems, the loot table can be specified per-texture. If no texture is specified, the above loot table will be expected.
Loot table explanations and tools:
The second file required for a golem is the JSON that defines how it is rendered in-game (texture, vines, eyes, color, etc.). This information is only present on the client when using multiplayer. These files are stored in a resource pack.
This file is stored as assets/<mod_id>/golem_models/<material>.json. <mod_id> is a unique namespace for the golem and must match the mod_id from the data file. <material> is a block or material and must match the material from the data file.
Here is a complete example of a valid golem resource JSON.
TO DO