How to increase Bedrock Zombie vision range? [closed]

I would like zombies in Minecraft to be able to detect players from much farther away than the usual 16 blocks. How could I make this happen?


Using the simple method; Attributes? No.

In the JAVA version, this would normally be done using NBT tags and attributes. The attribute that changes this behaviour is called Name:generic.followRange, and would be modified for a summoned monster using

/summon <m> <x> <y> <z> {
    Attributes: [{Name.generic.followRange,Base:<r>}]
}

Example use:

/summon zombie -212 70 -89 {
    Attributes: [{Name.generic.followRange,Base:32}]
}

(remove the returns and whitespace, it's there for formatting)

These unfortunately cannot be easily changed in the base non-java version of the game. There are some workarounds to some of the attributes, but not the one you are interested in.

Also see the main answer to How do you add NBT tags to commands in Minecraft Pocket/Bedrock Edition?.

Alt. Method #2: Mods

Now you may noticed that I wrote the 'base' version of the game: You can of course design your own entities in an Add-on or mod; this works for both Bedrock and Java edition.

The relevant attribute is listed at the official wiki, as being

<entity>->component_groups->minecraft:behavior.nearest_attackable_target->entity_types->max_dist = 16

This is read from a json file in the minecraft installation folder. Mods can override these json files by replacing (parts of them) with their own data. You would have to:

  1. Create a modpack (manifest).
  2. Find all the references to max_dist within the zombie's data section of the entity file.
  3. Override these to the value of your desire by creating your own entity json file containing those parts you want to change. This resource is for building a mob from scratch, you would only need the override parts.
  4. Test/verify that things work the way you want them to.
  5. Add the modpack to your server and clients. Enjoy your more dangerous zombies.

The advantages of this method over using the attributes include that it modifies all zombies in the game, not just those spawned with the adapted values. The disadvantages are the amount of code involved and getting clients to use the mod.

It would look something like this. (Note: untested!)

{
    "format_version": "<game version>",
    "minecraft:entity": {
        "description": {
            "identifier": "<copy from original>",
            "is_spawnable": true,
            "is_summonable": true,
            "is_experimental": false
        },
        "component_groups": {
            "minecraft:behavior.nearest_attackable_target": {
                "priority": 1,
                "within_radius": 32,
                "entity_types" [{
                    "max_dist": 32
                }]
            }
        }
    }
}