#Burgvoir is not doing its delayed attack and animation properly.

99 messages · Page 1 of 1 (latest)

last vector
#

Hello! My burgvoir is meant to be doing a animation when it’s about max_dist 10, though I don’t want it to attack me. Is it possible to get them to play an animation when I’m dist 10 from them? Currently at the moment, I have set it up so it would his at me when doing it’s delayed attack, but it does not work. So any help is appreciated. ❤️

I think the environment sensor is what I want, though idk how to set that up.

https://media.discordapp.net/attachments/1031885137706754060/1035858015330500628/IMG_0949.mov < Video of the problem.
https://srcb.in/8JylSHKyBP < Animation Controllers code.
https://srcb.in/6FVrGS2IrC < Behaviour Code

ornate kestrel
#

Not scripting

last vector
#

Sorry. I didn’t know. chicken_t

last vector
#

Bump.

swift geyser
#

Well I see a few issues in the behavior file file to start:

  1. minecraft:behavior.move_towards_dwelling_restriction
    This makes village dwellers try to move to inside a village. It does nothing for your mob.
  2. In behavior.nearest_attackable_target you have
    filters": {
    "any_of": [
    {},
    I believe that {} makes it target any entity, so the other filters are pointless. Is that just for testing?
  3. You have minecraft:behavior.move_to_water and minecraft:behavior.move_to_land in the same component group. These conflict with each other and will get it stuck in a loop.
  4. You have minecraft:behavior.random_swim in the base components. It seems like it should be in the burgvoir_swimming_navigation component group, but in fact it is probably not needed since you already have minecraft:behavior.swim_wander there.
  5. minecraft:movement.glide
    This is for flying mobs. I don’t think you need it.
  6. You have minecraft:behavior.melee_attack in addition to the delayed_attack component. This probably makes regular mele attacks happen before the delayed attack, which could be where your intended behavior is going wrong.
last vector
# swift geyser Well I see a few issues in the behavior file file to start: 1. minecraft:behavio...

1.
Oh? I did not know that lol- I guess I’ll have to change it to be tempted by the food I want it to. So it would approach me slowly like a cat.
2.
Hmmm- I’m not sure? I haven’t exactly tested it out on the fish yet, but it did work when I had the player as a option to attack.
3.
I did notice it didn’t seem to work, though I don’t know how to set it up exactly. So I am not sure what to do there.
4.
Yeah, it seems to work just fine!
5.
I added the glide as I want it to glide when it’s falling. I had planned for them to jump out of the water and glide like a flying fish. Though I have no idea how to get it to work the way I want.
6.
Yeah, that may be it, though I don’t really want it to attack me anyways, unless it’s being hit. Which is the way it is, so I will remove the delayed_attack if I can find a way to get the hiss to work without them having to attack me.

swift geyser
#

Do you want it to hiss only at players? And only when wild, or also when tame? Or only at the owner when take, or at non-owner players?

last vector
swift geyser
#

Ok. But it should actually attack fish, baby turtles, and skeletons like you have filters for, or no?

last vector
#

Oh, no it shouldn’t attack skeletons. Though the fish and turtles are right. :>

#

I didn’t realise I had skeletons in there. 👀

last vector
#

Boop!

swift geyser
#

I was trying out sequencing the hold_ground and avoid_mob_type behaviors on a chicken, but it reacts slowly when using avoid_mob_type.

Is it important for your hiss that it stops moving and looks at the player? It would be a lot simpler to just add an animation at the beginning of the running away b/c you can use query.is_avoiding_mobs to trigger it.

last vector
last vector
#

Bump.

last vector
swift geyser
#

Yes. It’s getting it to stand still during the animations that is the challenge. But I guess if their wandering is low priority then they aren’t likely to be moving while doing something else.

Entity sensor is probably what you’d want to use for that. Targeting could be used with target nearby sensor or on target acquired behavior too, but probably best not to have it target something you want it to run away from. I think that was why it was difficult trying to use targeting with hold ground.

last vector
#

Yeah, which is why I want to make the distance of when it plays pretty far, about 10-20 max dist. Because the run from the mob distance is lower than 10.

swift geyser
#

Well you could make that farther.

last vector
#

Yeah.

#

How do you like- setup the entity sensor? As everytime I try to setup a event or something it doesn’t want to work.

swift geyser
#

entity_sensor can be confusing because what it checks for is at least one entity that matches the filters you put in.
I think you'd want it like this:

"minecraft:entity_sensor":{
"minimum_count": 1,
"sensor_range": 10,
"event_filters": {"test": "is_player", "subject": "other"},
"event": "whatever"
}

#

The avoid_mob behavior seems to have a bit of a delay before it runs. Maybe that's long enough to run your animation without a complex sequence of behavior events?

last vector
#

Ahh I see.

#

Perhaps?

#

I’ll try it out. ^^

last vector
last vector
#

Alright, thanks!

last vector
swift geyser
#

Yes. Behaviors can’t trigger client-side actions directly. You need to make an event in the behavior file that adds/removes component groups with components that the client entity can query for.

last vector
#

Hmm, alright-

last vector
swift geyser
#

I don’t think you’d want to change any of those for the hiss.

last vector
#

Ahh okay, What do I do then? I don’t understand the “events” very well Tbh.

swift geyser
#

Components are the funtional parts of an entity--its properties and behaviors. Events are used to change the parts of an entity, mostly by adding and removing component groups, which are just collections of components.

#

So you need to make a separate component group that has some component in it that the client entity can query for. You tried that with the delayed attack behavior but that wasn't a good fit for the distance and reaction you wanted. Something like a variant number may work, or a component like "sheared".

last vector
#

Hmmm…

swift geyser
#

I got one thing wrong in the entity sensor above. There is no filter test for "is_player". You have to filter for
"test": "is_family", "value": "player", "subject": "other"

#

Here's an example I worked up with a chicken.

#

In the behavior entity I have these component groups

"scanning": {
  "minecraft:variant": {
    "value": 0
  },
  "minecraft:entity_sensor":{
    "minimum_count": 1,
    "sensor_range": 10,
    "event_filters": { "test": "is_family", "subject": "other", "value": "player" },
    "event": "give_warning"
  }
},
"warning": {
  "minecraft:variant": {
    "value": 1
  },
  "minecraft:timer": {
    "looping": false,
    "time": 2.0,
    "time_down_event": {
      "event": "scan"
      }
  }
},```
#

And these events

      "scan": {
        "remove": {
          "component_groups": [
            "warning"
            ]
        },
        "add": {
          "component_groups": [
            "scanning"
          ]
        },
        "run_command": { "command": "say scanning" }
      },
      "give_warning": {
        "remove": {
          "component_groups": [
            "scanning"
          ]
        },
        "add": {
          "component_groups": [
            "warning"
          ]
        },
        "run_command": { "command": "say hey" }
      }```
(The run_command is just for debugging and requries holiday creator experiments tab.)
#

Then in the client (resource pack) animations I added

    "animation.chicken.freak": {
      "loop": true,
      "bones": {
        "head": {
          "scale": 4.0
        }
      }
    },```
#

And in the client entity I added this under "animations"
"freak": "animation.chicken.freak"

#

And under "scripts": { "animate": [
{ "freak": "query.variant" }

#

I also gave the chicken an avoid_mob behavior to run away from players, which I just put in the components section.

#
     "minecraft:behavior.avoid_mob_type": {
        "priority": 1,
        "entity_types": [
          {
            "filters": { "test" :  "is_family", "subject" : "other", "value" :  "player"},
            "max_dist": 10,
            "max_flee": 12,
            "walk_speed_multiplier": 1.5,
            "sprint_speed_multiplier": 2.0,
            "on_escape_event": {
              "event": "scan",
              "target": "self"
            }
          }
        ]
      }```
last vector
#

Ahh alright!

last vector
#

I might've put them in the wrong spot, idk.

swift geyser
#

Yes you did

last vector
#

Ahh crap- lol, I have done this before by accident so that’s why I asked. :’)

swift geyser
#

Looks like you put them inside some other component.

swift geyser
#

Or you’re missing commas or brackets.

last vector
#

Hmmmm- alright, I’ll take a look when I’m on my pc again.

last vector
last vector
swift geyser
#

Sorry, I just noticed the pastebin link in that message. The errors are because you put the component groups that I shared inside your components section, instead of component_groups.

#

And you need to make the watching group get added by the entity_spawned event.

last vector
#

Ohh-

last vector
#

Ran into some errors in the Behaviours again. Had to revert back all the way back to the original behaviour code from when I started this question post.

#

Since the code broke when I tried to edit it again.

#

But I added stuff back and only have this now.

swift geyser
#

Do you have the holiday creator experiments toggle on? It’s required for run_command.

last vector
#

I’ll have to check tomorrow, but I’m sure I had it on.

swift geyser
#

Oh you could remove the on_escape_event part, too. I couldn’t get it to work.

last vector
#

Oh alright lol-

last vector
#
      "initial_state": "idle",
      "states": {
        "idle": {
          "animations": ["idle"],
          "transitions": [
            {
              "hiss": "query.is_scan"
            }
          ]
        },
        "hiss": {
          "blend_transition": 0.2,
          "animations": ["hiss"],
          "transitions": [
            {
              "idle": "!query.is_moving && !query.is_in_water && query.is_on_ground && !query.is_scan"
            },
            {
              "walk": "query.is_moving && !query.is_in_water && query.is_on_ground && !query.is_scan"
            }
          ]
        }
      }
    }
  }
}```
#

I do have holiday creator experiments on.

#

I have tried it out in game and removed the on escape thing as well.

#

They won't hiss or run the commands.

swift geyser
#

You need to use query.variant in the animation controller, not query.is_scan. That’s why the two component groups I made have minecraft:variant components. You can’t make up a custom query function or query for an event. The available query functions are predefined/hard-coded.

#

Also, why do you have it only stop hissing when it’s moving on ground? And do you want it to stop hissing only when moving and it has hissed for 2 seconds? The component groups and events I gave you return the variant number to 0 after 2 seconds—that’s what the minecraft:timer is set to. You could change that if you want. If you want it to keep hissing until it is moving then you don’t need to query for the variant, and then the timer component in the warning group would just be a cooldown time for how long until it can hiss again. You could make that a random interval as well, if you want.

#

The run_command not working, though, means the events are not running. You’ll have to check on where “scanning” should get added at first.

last vector
#

Ahh I see, I’ve never used query.variant. I’ll try that!

#

Hmm-

last vector
#

I'll see if I can fiddle around until the commands work.

#
      "minecraft:entity_spawned": {
        "randomize": [
          {
            "weight": 9,
            "remove": {},
            "add": {
              "component_groups": [
                "minecraft:burgvoir_adult",
                "minecraft:burgvoir_wild"
              ]
            }
          },
          {
            "weight": 1,
            "remove": {},
            "add": {
              "component_groups": [
                "minecraft:burgvoir_baby",
                "minecraft:burgvoir_wild"
              ]
            }
          }
        ]
      },```
#
        "remove": {},
        "add": {
          "component_groups": [
            "minecraft:burgvoir_baby",
            "minecraft:burgvoir_tame"
          ]
        }
      },"minecraft:ageable_grow_up": {
        "remove": {
          "component_groups": ["minecraft:burgvoir_baby"]
        },
        "add": {
          "component_groups": ["minecraft:burgvoir_adult"]
        }
      },
      "minecraft:ageable_set_baby": {
        "remove": {
          "component_groups": ["minecraft:burgvoir_adult"]
        },
        "add": {
          "component_groups": ["minecraft:burgvoir_baby"]
        }
      },
      "minecraft:on_tame": {
        "remove": {
          "component_groups": ["minecraft:burgvoir_wild"]
        },
        "add": {
          "component_groups": ["minecraft:burgvoir_tame"]
        }
      },
      "scan": {
        "remove": {
          "component_groups": ["warning"]
        },
        "add": {
          "component_groups": ["scanning"]
        },
        "run_command": { "command": "say scanning" }
      },
      "give_warning": {
        "remove": {
          "component_groups": ["scanning"]
        },
        "add": {
          "component_groups": ["warning"]
        },
        "run_command": { "command": "say hey" }
      }
    }
  }
}```
#

Here is my Events from my behaviours.

#

Wait- I think I got it.

#

nvm didn't work.

#

oof-

#

I tried adding }'s above the start of the "scan":

#

It got rid of the errors, but added "Expected comma/closing brace".

#

Tried playing and it still didn't work.

swift geyser
#

When you get errors on the behavior file it usually does not load the file at all, so of course it won’t work. You have to debug the errors first.

swift geyser
swift geyser
woeful adder
#

Please don't go raiding other people's threads. These exist for helping others

swift geyser
#

Thanks

last vector
#

Alrighty, I’ll try and fix that when I get on my pc again.