#How do i make a mob always know where you are?

1 messages · Page 1 of 1 (latest)

elder schooner
#

Hi, I've been searching this but no luck at all.
Thought that would be the job of a datapack, I wanted to make a specific mob or any mob of a certain class to always know my location, even behind walls and even if it doesn't sees me.

(Plus, I know nothing about datapacks, like ZERO, so if anyone has directions I'd be thankful!)

sharp surge
#

you can modify the data of the angry at field and the anger time field if the mob is a nuteral mob

elder schooner
#

anrgy at field? 🤔

sharp surge
#

what mob are you trying to work with?

elder schooner
elder schooner
sharp surge
#

hmm then I think you've run into the limitations of what is possible with datapacks

#

there is no way to directly access the AI pathfinding of a mob

#

only through data fields

elder schooner
#

Can i make it at least always angry at me? If i recall mobs always know where you are when they're aggro with you, zombie as an example

sharp surge
#

yea you can hit it with a snowball that has the owner field set to the uuid of the player

elder schooner
#

Owner field? 🤔

#

I'm quite unsure as to how i'd even start doing that

sharp surge
#

if you do data get <entity> you can see a lot of fields which you can modify using /data modify

#
Minecraft Wiki

Data may refer to:

/data command
data pack - A collection of data used to configure a number of features of Minecraft.
data folder - data folder for each world

elder schooner
#

Oh damn didn't knew that existed, will try that out
Is that also how you set the snowball you said?

sharp surge
#

you can use data modify entity <the_snowball> set from entity <player> UUID

elder schooner
#

I'm quite confused on that

sharp surge
#

I have to recommend our beginners guide for datapacks to you

worldly bloomBOT
elder schooner
#

Will take a look at it, thank you!

rich kernel
#

There is a much more elegant way to do it actually

#

You can use data modify entity <warden> last_hurt_by_mob set from entity <player> UUID... This will make the Warden think that the player just hit it! You can do something super similar with the damage command too

#

You just have to figure out how to use selectors (@s, @e, @n, @p, and all the specific fields/filters in square brackets after them) to make the Warden and the player get referenced properly

#

If the command/function is run/executed as the Warden, use @s for the warden and maybe something like @p for the nearest player

#

P.S. If you're using the data modify command, don't run it constantly or else the warden will glitch out and not be able to do anything bc its data is constantly being reset

#

Hope this helps!! :D ✨🌸

elder schooner
elder schooner
#

or like till the mob's anger wear out?

rich kernel
#

I would recommend every 10 seconds or so ^w^

elder schooner
#

Doesn't seem to work at all sadly

#

/damage seems to work tho i'll keep testing with it

still zodiac
#

A warden has special anger mechanics that work with a suspects list/array. You can try the wiki or perform data get on a warden that is angry.

#

The snowball or damage method is probably going to be easier

rich kernel
#

wait I might have gotten the command wrong...

#

It could be entity instead of mob

elder schooner
elder schooner
elder schooner
#

Thank y'all!