#Get type of entity
1 messages · Page 1 of 1 (latest)
<@&1201956957406109788>
💬 While you wait, take this time to provide more context and details.
🙇 If nobody has answered you by <t:1724077282:t>, feel free to use the Summon Helpers button to ping our helper team.
✅ Once your question has been resolved (or you no longer need it), please click Resolve Question or run /resolve
I think you have to hardcode them
dangit
You can use a binary search to make it more efficient
You would need to use tags
wdym
if you want entities to have an nbt id, just use /data to give them a custom id in the nbt
or just summon them with said data
Entities can't have custom NBT
nah, only markers
tags then
I still then have to hardcode for each tag
I'll just hardcode a file like:```ansi
[35mexecute [34mif entity [36m@s[33m[[37mtype[34m=[33mminecraft:allay] [34mrun [35mreturn [34mrun [35mdata [34mmodify storage [33mgenome:temp [34mentity set value [32m"allay"
[35mexecute [34mif entity [36m@s[33m[[37mtype[34m=[33mminecraft:armadillo] [34mrun [35mreturn [34mrun [35mdata [34mmodify storage [33mgenome:temp [34mentity set value [32m"armadillo"
[35m..[0m.
Yeah
huh
I'm glad to say that I've had this problem before and I have found a solution!
a function is just a list of commands ran in order
ok
You can use the ride command to make the entity a passenger and get the id via the Passengers nbt
ooh
is that more efficient than this though? because entities might make it lag more idk
Well, it's only one summon, one ride, one data get & one kill (that is if you don't keep the "vehicle" entity for other times you need to get an entity's id) instead 50+ execute if entity @s
It's at least way more substainable & readable I think
This was gonna be my suggestion, yeah
okie thank you everyone