#(Raindropz) Check entity data
37 messages ยท Page 1 of 1 (latest)
(Raindropz) Check entity data
Hi I'm AutoThreadBot! Don't mind me, I'll just be adding the helper team to this thread so they can see it. A human will get to you soon.
You can block this bot if you don't want to see these messages, I won't mind.
<@&525394568410038282>
I want to check the entity that a player is looking at, and then run something based on that - think of something like the WAILA mod, but for entities with specific data
So if a player is looking at a zombie, show a title that says "ZOMBIE"
is there a way to check the data of an entity
yes! tags
in this case, you're trying to see the entity type
sooo
!t entity_type
!t entitytag.entity_type
example, if you did <player.entity_type>, it would return "player"
i recommend you taking a look at all the available tags to see what's possible with them
!t all
Find all Tags at https://meta.denizenscript.com/Docs/Tags/
I tried /ex narrate <player.target> which gave me the entity I'm looking at, albeit with a bit more information attached lol
But besides the actual entity type, ideally I need the entity data too
!t PlayerTag.target
Returns the entity that the player is looking at, within a maximum range of 50 blocks,
or null if the player is not looking at an entity.
Optionally, specify an entity type matcher to only count matches as possible targets.
EntityTag
That returns an EntityTag object, which you can then read information from using tags, e.g. <player.target.entity_type>
!g
View the Denizen Beginner's Guide at https://guide.denizenscript.com/
i dont know what vanilla's entity data consists of, but i'm 100% sure tags cover all of that and more
I heavily recommend going over the guide, it teaches all of the basic concepts
Looks something like this
!t entity.describe
Returns the entity's full description, including all properties.
properties
EntityTag
!t entity.property_map
Returns the object's property map.
properties
MapTag