Mob Transform Recipe
Mob transform recipes allow you to define transformation rules between mob entities, including complex transformations based on tag conditions.
Basic Structure
{
"type": "anvilcraft:mob_transform",
"input": "minecraft:cow",
"results": [
{
"entity": "minecraft:pig",
"probability": 1.0
}
],
"tagPredicates": [],
"tagModifications": [],
"transformOptions": []
}Field Description
type
Fixed value anvilcraft:mob_transform, identifies this as a mob transform recipe.
input
The original mob entity type to transform, e.g., "minecraft:cow".
results
List of possible transformation results:
entity: Target mob entity typeprobability: Transformation probability (0.0 to 1.0)
tagPredicates
Conditions for triggering transformation, based on entity NBT tag values.
tagModifications
Modifications to entity NBT tags after transformation.
transformOptions
Special options controlling transformation behavior.
Tag Predicates
Tag predicates are used to define conditions for triggering transformation, based on entity NBT tag values.
Numeric Tag Predicate
{
"tagPath": "Health",
"comparison": ">",
"value": 10.0
}Supported comparison operators:
>: Greater than<: Less than>=: Greater than or equal<=: Less than or equal==: Equal!=: Not equal
Distance Predicate
{
"type": "distance_to_nearest_player",
"comparison": "<",
"value": 5.0
}Tag Modifications
Tag modifications are used to modify entity NBT tags after transformation.
Set Tag Value
{
"operation": "SET",
"tagPath": "CustomName",
"value": "{\"text\":\"Transformed Cow\"}"
}Add to Numeric Tag
{
"operation": "ADD",
"tagPath": "Health",
"value": 10.0
}Multiply Numeric Tag
{
"operation": "MULTIPLY",
"tagPath": "Health",
"value": 2.0
}Remove Tag
{
"operation": "REMOVE",
"tagPath": "CustomName"
}Transform Options
Transform options control special aspects of transformation behavior:
PRESERVE_EQUIPMENT: Preserve equipmentCOPY_POSITION: Copy positionCOPY_NAME: Copy namePRESERVE_EFFECTS: Preserve effects
Usage Examples
Basic Transformation
{
"type": "anvilcraft:mob_transform",
"input": "minecraft:cow",
"results": [
{
"entity": "minecraft:pig",
"probability": 1.0
}
]
}Transformation with Probability
{
"type": "anvilcraft:mob_transform",
"input": "minecraft:cow",
"results": [
{
"entity": "minecraft:pig",
"probability": 0.7
},
{
"entity": "minecraft:sheep",
"probability": 0.3
}
]
}Conditional Transformation
{
"type": "anvilcraft:mob_transform",
"input": "minecraft:zombie",
"results": [
{
"entity": "minecraft:skeleton",
"probability": 1.0
}
],
"tagPredicates": [
{
"tagPath": "Health",
"comparison": ">",
"value": 10.0
}
]
}Modifying Entity Tags
{
"type": "anvilcraft:mob_transform",
"input": "minecraft:pig",
"results": [
{
"entity": "minecraft:cow",
"probability": 1.0
}
],
"tagModifications": [
{
"operation": "SET",
"tagPath": "CustomName",
"value": "{\"text\":\"Transformed Cow\"}"
}
]
}Using Transform Options
{
"type": "anvilcraft:mob_transform",
"input": "minecraft:chicken",
"results": [
{
"entity": "minecraft:bat",
"probability": 1.0
}
],
"transformOptions": [
"PRESERVE_EQUIPMENT",
"COPY_POSITION"
]
}Complex Tag Conditions
{
"type": "anvilcraft:mob_transform",
"input": "minecraft:skeleton",
"results": [
{
"entity": "minecraft:wither_skeleton",
"probability": 1.0
}
],
"tagPredicates": [
{
"tagPath": "Health",
"comparison": ">",
"value": 15.0
},
{
"type": "distance_to_nearest_player",
"comparison": "<",
"value": 5.0
}
],
"tagModifications": [
{
"operation": "SET",
"tagPath": "HandItems",
"value": "[{id: \"minecraft:stone_sword\", Count: 1b}]"
}
]
}