I am working on an MCPE addon that is supposed to make zombie villagers tame. However, when I hit the zombie villager, it attacks me even though I removed the "minecraft:behavior.hurt_by_target" Also, the tamed zombie villager will not follow or listen to me. Here is the code:
I am working on an MCPE addon that is supposed to make zombie villagers tame. However, when I hit the zombie villager, it attacks me even though I removed the "minecraft:behavior.hurt_by_target" Also, the tamed zombie villager will not follow or listen to me. Here is the code:
{
"minecraft:entity": {
"format_version": "1.1.0",
"component_groups": {
"baby": {
"minecraft:is_baby": { },
"minecraft:scale": {
"value":0.5
},
"minecraft:movement": {
"value": 0.35
}
},
"sit": {
"minecraft:behavior.stay_while_sitting": {
"priority": 1
}
},
"adult": {
"minecraft:movement": {
"value": 0.23
},
"minecraft:behavior.mount_pathing": {
"priority": 5,
"speed_multiplier": 1.25,
"target_dist": 0.0,
"track_target": true
}
},
"leashed": {
"minecraft:behavior.move_towards_restriction": {
"priority": 2,
"speed_multiplier": 0.5
}
},
"tame": {
"minecraft:is_tamed": {
},
"minecraft:behavior.follow_owner": {
"priority": 1,
"speed_multiplier": 1.2,
"start_distance": 8,
"stop_distance": 1
},
"minecraft:behavior.owner_hurt_by_target": {
"priority": 1
},
"minecraft:behavior.owner_hurt_target":{
"priority": 2
},
"minecraft:sittable": {
"sit_event": {
"event": "minecraft:on_sit",
"target": "self"
},
"stand_event": {
"event": "minecraft:on_stand",
"target": "self"
}
},
"minecraft:leashable": {
"soft_distance": 4.0,
"hard_distance": 7.0,
"max_distance": 16.0,
"on_leash": {
"event": "minecraft:on_leash",
"target": "self"
},
"on_unleash": {
"event": "minecraft:on_unleash",
"target": "self"
}
}
},
"wild": {
"minecraft:tameable": {
"probability": 0.21,
"tameItems": ["diamond","emerald","iron_block","gold_ingot"],
"tame_event": {
"event": "minecraft:on_tame",
"target": "self"
}
}
},
"jockey": {
"minecraft:behavior.find_mount": {
"priority": 1,
"within_radius": 16
}
},
"from_abandoned_village": {
"minecraft:behavior.restrict_sun": {
"priority": 3
},
"minecraft:behavior.flee_sun": {
"priority": 4,
"speed_multiplier": 1
}
},
"farmer": {
"minecraft:type_family": {
"family": [ "farmer", "villager" ]
},
"minecraft:variant": {
"value": 0
}
},
"fisherman": {
"minecraft:type_family": {
"family": [ "fisherman", "villager" ]
},
"minecraft:variant": {
"value": 0
}
},
"shepherd": {
"minecraft:type_family": {
"family": [ "shepherd", "villager" ]
},
"minecraft:variant": {
"value": 0
}
},
"fletcher": {
"minecraft:type_family": {
"family": [ "fletcher", "villager" ]
},
"minecraft:variant": {
"value": 0
}
},
"librarian": {
"minecraft:type_family": {
"family": [ "librarian", "villager" ]
},
"minecraft:variant": {
"value": 1
}
},
"cartographer": {
"minecraft:type_family": {
"family": [ "cartographer", "villager" ]
},
"minecraft:variant": {
"value": 1
}
},
"cleric": {
"minecraft:type_family": {
"family": [ "cleric", "villager" ]
},
"minecraft:variant": {
"value": 2
}
},
"armorer": {
"minecraft:type_family": {
"family": [ "armorer", "villager" ]
},
"minecraft:variant": {
"value": 3
}
},
"weaponsmith": {
"minecraft:type_family": {
"family": [ "weaponsmith", "villager" ]
},
"minecraft:variant": {
"value": 3
}
},
"toolsmith": {
"minecraft:type_family": {
"family": [ "toolsmith", "villager" ]
},
"minecraft:variant": {
"value": 3
}
},
"butcher": {
"minecraft:type_family": {
"family": [ "butcher", "villager" ]
},
"minecraft:variant": {
"value": 4
}
},
"leatherworker": {
"minecraft:type_family": {
"family": [ "leatherworker", "villager" ]
},
"minecraft:variant": {
"value": 4
}
}
},
"components": {
"minecraft:identifier": {
"id": "minecraft:zombie_villager"
},
"minecraft:healable": {
"items": [
{
"item": "porkchop",
"heal_amount": -3
},
{
"item": "cooked_porkchop",
"heal_amount": -10
},
{
"item": "cookie",
"heal_amount": -3
},
{
"item": "pumpkin_pie",
"heal_amount": -30
},
{
"item": "cake",
"heal_amount": -50
},
{
"item": "bread",
"heal_amount": -8
},
{
"item": "golden_carrot",
"heal_amount": -20
},
{
"item": "cooked_salmon",
"heal_amount": -10
},
{
"item": "beef",
"heal_amount": -3
},
{
"item": "cooked_beef",
"heal_amount": -10
},
{
"item": "chicken",
"heal_amount": -2
},
{
"item": "cooked_chicken",
"heal_amount": -10
},
{
"item": "muttonRaw",
"heal_amount": -2
},
{
"item": "muttonCooked",
"heal_amount": -10
},
{
"item": "baked_potato",
"heal_amount": -13
},
{
"item": "rabbit",
"heal_amount": -3
},
{
"item": "cooked_rabbit",
"heal_amount": -10
},
{
"item": "rabbit_stew",
"heal_amount": -23
}
]
},
"minecraft:navigation.walk": {
"can_float": true,
"can_pass_doors": true,
"can_open_doors": true
},
"minecraft:movement.basic": {
},
"minecraft:jump.static": {
},
"minecraft:can_climb": {
},
"minecraft:breathable": {
"totalSupply": 45,
"suffocateTime": 0
},
"minecraft:loot": {
"table": "loot_tables/entities/zombie.json"
},
"minecraft:collision_box": {
"width": 0.6,
"height": 1.8
},
"minecraft:health": {
"value": 250,
"max": 250
},
"minecraft:attack": {
"damage": 10
},
"minecraft:nameable": {
"alwaysShow": true
},
"minecraft:behavior.float": {
"priority": 0
},
"minecraft:behavior.move_towards_restriction": {
"priority": 7,
"speed_multiplier": 1
},
"minecraft:behavior.random_stroll": {
"priority": 8,
"speed_multiplier": 1
},
"minecraft:behavior.look_at_player": {
"priority": 9,
"look_distance": 6,
"probability": 0.02
},
"minecraft:behavior.melee_attack": {
"priority": 3,
"speed_mulitplier": 1.0,
"track_target": false
},
"minecraft:behavior.random_look_around": {
"priority": 9
},
"minecraft:behavior.nearest_attackable_target": {
"priority": 2,
"entity_types": [
{
"filters": { "other_with_families": [ "monster", "wither", "dragon" ] },
"max_dist": 35
}
]
}
},
"events": {
"minecraft:on_tame": {
"remove": {
"component_groups": [
"wild"
]
},
"add": {
"component_groups": [
"tame"
]
}
},
"minecraft:on_leash": {
"add":{
"component_groups": [
"leashed"
]
}
},
"minecraft:on_unleash": {
"remove":{
"component_groups": [
"leashed"
]
}
},
"minecraft:on_sit": {
"add":{
"component_groups": [
"sit"
]
}
},
"minecraft:on_stand": {
"remove":{
"component_groups": [
"sit"
]
}
},
"minecraft:entity_spawned": {
"sequence": [
{
"filters": { "without_components": "minecraft:variant" },
"randomize": [
{
"weight": 9500,
"remove": {
},
"add": {
"component_groups": [
"adult", "wild"
]
}
},
{
"weight": 425,
"remove": {
},
"add": {
"component_groups": [
"baby", "wild"
]
}
},
{
"weight": 75,
"remove": {
},
"add": {
"component_groups": [
"baby",
"jockey", "wild"
]
}
}
]
},
{
"filters": { "without_components": "minecraft:variant" },
"randomize": [
{
"weight": 5,
"add": { "component_groups": [ "farmer" ] }
},
{
"weight": 5,
"add": { "component_groups": [ "fisherman" ] }
},
{
"weight": 5,
"add": { "component_groups": [ "shepherd" ] }
},
{
"weight": 5,
"add": { "component_groups": [ "fletcher" ] }
},
{
"weight": 20,
"add": { "component_groups": [ "librarian" ] }
},
{
"weight": 20,
"add": { "component_groups": [ "cartographer" ] }
},
{
"weight": 20,
"add": { "component_groups": [ "cleric" ] }
},
{
"weight": 6,
"add": { "component_groups": [ "armorer" ] }
},
{
"weight": 6,
"add": { "component_groups": [ "weaponsmith" ] }
},
{
"weight": 6,
"add": { "component_groups": [ "toolsmith" ] }
},
{
"weight": 10,
"add": { "component_groups": [ "butcher" ] }
},
{
"weight": 10,
"add": { "component_groups": [ "leatherworker" ] }
}
]
}
]
},
"minecraft:entity_transformed": {
"filters": { "other_without_components": "minecraft:variant" },
"sequence": [
{
"filters": { "other_with_components": "minecraft:is_baby" },
"add": { "component_groups": [ "baby" ] }
},
{
"filters": { "other_without_components": "minecraft:is_baby" },
"add": { "component_groups": [ "adult" ] }
},
{
"filters": { "other_with_families": "farmer" },
"add": { "component_groups": [ "farmer" ] }
},
{
"filters": { "other_with_families": "fisherman" },
"add": { "component_groups": [ "fisherman" ] }
},
{
"filters": { "other_with_families": "shepherd" },
"add": { "component_groups": [ "shepherd" ] }
},
{
"filters": { "other_with_families": "fletcher" },
"add": { "component_groups": [ "fletcher" ] }
},
{
"filters": { "other_with_families": "librarian" },
"add": { "component_groups": [ "librarian" ] }
},
{
"filters": { "other_with_families": "cartographer" },
"add": { "component_groups": [ "cartographer" ] }
},
{
"filters": { "other_with_families": "cleric" },
"add": { "component_groups": [ "cleric" ] }
},
{
"filters": { "other_with_families": "armorer" },
"add": { "component_groups": [ "armorer" ] }
},
{
"filters": { "other_with_families": "weaponsmith" },
"add": { "component_groups": [ "weaponsmith" ] }
},
{
"filters": { "other_with_families": "toolsmith" },
"add": { "component_groups": [ "toolsmith" ] }
},
{
"filters": { "other_with_families": "butcher" },
"add": { "component_groups": [ "butcher" ] }
},
{
"filters": { "other_with_families": "leatherworker" },
"add": { "component_groups": [ "leatherworker" ] }
}
]
},
"minecraft:become_cleric": {
"add": { "component_groups": [ "cleric" ] }
},
"from_village": {
"add": { "component_groups": [ "from_abandoned_village" ] }
}
}
}
}
YouTube: https://www.youtube.com/channel/UCzGDRYWcrGreMmQFo_d5N5Q
Facebook:https://goo.gl/s0r12d
Website:https://theusaf.weebly.com
JavaScript Projects: https://theusaf.github.io
Link Shortener: https://shortr.github.io
Twitter:https://www.twitter.com/theusafyt