-
Notifications
You must be signed in to change notification settings - Fork 0
Customization
With datapack, you can define:
- whether a mob may spawn with a shield
- the chance that it spawns with one
- the minimum local difficulty required
- which shield item it uses
- how long it keeps blocking
- how long its shield cooldown lasts
- how often it checks whether it should continue blocking
Place your JSON files under:
data/<namespace>/mob_shield/<path>.json
Examples:
data/minecraft/mob_shield/zombie.json
data/minecraft/mob_shield/piglin.json
data/yourmod/mob_shield/custom_mob.json
These files are resolved by path into entity-type-style ids. For example:
data/minecraft/mob_shield/zombie.json -> minecraft:zombie
data/yourmod/mob_shield/foo/bar.json -> yourmod:foo/bar
In practice, this means the file path should match the mob id you want to configure.
{
"use_duration": 60,
"cooldown_duration": 60,
"check_continue_to_use_interval": 30,
"shield_id": "minecraft:shield",
"shield_stack": "{id:\"minecraft:shield\",count:1}",
"chance": 0.15,
"min_difficulty": 2.25
}
-
use_durationHow long the mob keeps actively using the shield. -
cooldown_durationHow long the mob waits before it can use the shield again. -
check_continue_to_use_intervalHow often the mob checks whether it should continue blocking. -
shield_idThe item id of the shield to equip when the mob spawns with one. Ifshield_stackis not provided, invalid, or results in an empty item stack, the mod uses this item id as the fallback shield item. If the item is missing or invalid, the mod falls back tominecraft:shield. -
shield_stackOptional full ItemStack SNBT string used to define the exact shield stack equipped by the mob. This allows custom NBT/component data such as banner patterns, names, damage, or other item data supported by the current Minecraft version. If this field is present and can be parsed into a non-empty ItemStack, it takes priority overshield_id. -
chanceThe spawn chance for that mob to receive a shield in its offhand. -
min_difficultyMinimum local difficulty required before the mob may spawn with a shield.
min_difficulty uses Minecraft's effective local difficulty, not just the selected world difficulty setting.
For reference:
- The raw regional difficulty is always 0.0 on Peaceful and ranges from 0.75 to 1.5 on Easy, 1.5 to 4.0 on Normal, and 2.25 to 6.75 on Hard. (ref: Minecraft Wiki)
- lower values allow shield spawning earlier or under easier conditions
- higher values make shielded spawns rarer and more progression-sensitive