#Making Hostile Mobs Follow Through Fire

1 messages · Page 1 of 1 (latest)

coral vale
#

How to make a hostile mob that doesn't try to avoid fire when following its target. It should be easy (zombies do that), but for some reason almost nothing works. You can add fire_immune component to the entity, and then it can follow through the fire, but I don't want to make my entity immune to fire.

I tried zombie runtime_identifier, matching the format_version of the vanilla zombie, setting the avoid_damage_blocks to false. Nothing works, the entity never walks into fire intentionally (sometimes it can clip into fire block because it has relatively big collision box).

violet geode
#

just add "avoid_damage_blocks": false, in your navigation component

coral vale
#

I tried zombie runtime_identifier, matching the format_version of the vanilla zombie, setting the avoid_damage_blocks to false. Nothing works...
As I mentioned that doesn't seem to do anything. Have you tried using it?

violet geode
#

send the code

#

runtime identifier will not work

coral vale
#

send the code
Can't do.

My claim is that it's impossible to make an entity that paths through fire without fire_immune. You can copy nearest_attackable_target and melee_attack to a pig behavior or an entity that uses a copy of pig behavior and that's a good enough minimal bug reproduction project. Have you tried using the solution you suggested?

violet geode
#

It is not a solution, I don't know what components may be influencing the behavior of your entity, the only option left for me is brainstorming.

coral vale
#
{
    "format_version": "1.21.0",
    "minecraft:entity": {
        "description": {
            "identifier": "something:something",
            "is_spawnable": false,
            "is_summonable": true,
            "is_experimental": false
        },
        "components": {
            "minecraft:attack": {
                "damage": 1
            },
            "minecraft:collision_box": {
                "width": 1,
                "height": 1
            },
            "minecraft:jump.static": {
                "jump_power": 0.42
            },
            "minecraft:health": {
                "value": 10,
                "max": 10
            },
            "minecraft:movement.basic": {},
            "minecraft:movement": {
                "value": 0.15
            },
            "minecraft:navigation.walk": {
                "avoid_damage_blocks": false
            },
            "minecraft:behavior.melee_box_attack": {
                "priority": 3
            },
            "minecraft:behavior.nearest_attackable_target": {
                "priority": 2,
                "must_see": true,
                "reselect_targets": true,
                "within_radius": 25.0,
                "must_see_forget_duration": 17.0,
                "entity_types": [
                    {
                        "filters": {
                            "test": "is_family",
                            "subject": "other",
                            "value": "player"
                        },
                        "max_dist": 35
                    }
                ]
            },
            "minecraft:physics": {
                "has_gravity": true
            }
        }
    }
}

Minimal example

#

Reproduction steps:

  1. Build ring of fire ~5x5
  2. Summon the entity inside the ring
  3. Go to survival mode outside of the ring
  4. Observe the entity trying to go towards you but never corssing the fire.
  5. Repeat with a zombie. Zombies can go through fire.
violet geode
#

I see, you're right, it seems that it's the only way.

#

Using fire_immune would be the only way, and the worst thing is that you can't remove immunity with groups of components.

vale relic
#

I'm thinking of faking fire damage in some way like with animation controllers, using "in_block" in "minecraft:environment_sensor" or with scripts. So that it takes damage when it is in these fire blocks.

violet geode
#

I guess the important thing is not that it takes damage but that it catches fire so that it can burn players when it attacks.

#

If it was just the damage it would have been very simple

#

The only idea I have is that the mob is riding another entity that is immune to fire, then the rider would burn and could cross the fire. Maybe it could also be done the other way around, that the rider is immune and uses the zombie as if it were a horse, maybe it would work.

coral vale
#

For my specific case, the problem is not important enough to address it with workarounds like implementing fake fire. Potential complications from havin a system that fakes entity burning outweigh the benefits. I just wanted to make a hostile entity more aggressive.