#detecting uuid with execute if
1 messages · Page 1 of 1 (latest)
<@&1201956957406109788>
💬 While you wait, take this time to provide more context and details.
✅ Once your question has been resolved (or you no longer need it), please click Resolve Question or run /resolve
<@&1166082198152159386> <@&1202694677766348840>
Please note that you still might not immediately get a response since all helpers are human beings and volunteers (and also might be sleeping right now)
Detect in what way?
Do you want to store the UUID somewhere? Compare it to another UUID?
compare uuids
i got were to store the uuids
but idk how to compare them
How did you store them?
Don't believe there's really a good way to compare strings like that
You'll want to instead store the UUIDs as scores (you can either do each of the four UUID numbers as a separate score for maximum accuracy, or just one of them, up to you). Then you can compare them with execute if score
is there a way to do what i asked
it doesnt need to be complicated
like
what is the data path to a uuid
and how do i detect its number
Yes, the way I described
You detect it in the same way you stored it. What you actually want to know is how to compare it. And the way is by storing it to a score
so scorebored?
Yes
it just outputs it to 4
You can't target the entire UUID NBT because it's a list, it'll just output the number of entries in it. You need to do UUID[0] for just the first number, UUID[1] for the second, etc
if you really wanted to streamline it as much as possible you could probably take a function macro that takes target selectors as inputs
i am using macros
for this
but generally when i need to do this i just compare 4 scores for each uuid number separately in 4 ifs
is there a way to check for if i uuid is a specific number via data?
generally i would suggest foregoing macros and storing the uuids of entities you will be comparing with 4 scoreboards
yeah you can store it as score and then set a fake player to the value you want to check it (or use another entity/player’s value) for an if score = score statement
basically you can only compare scores but you can turn the data into a score
without scores and using macros
no
i mean
technically you could maybe see whether merging succeeds? but no 2 entities should have the same uuid to begin with
i know
i need it for a projectile
essentially
i stored the uuid into a marker's name
and i was wondering if there is a way to compare that
i would strongly suggest using an incremental id system for that type of thing, simpler and less laggy to work with
but if you really wanna use uuid without scores or macros, yeah you might be able to see whether data modify merge can be used to determine that
let me refrace it, is there a way to detect what uuid a entity has via execute if or selectors?
not without using scoreboards and/or macros
well scoreboards are really the simplest way though
i just dont want my lines to be long asf
and its for a damage command
so the only way for the cause to be the original entity
is via macros
.
Or an enchantment
often, that's difficult if you want at least some complexity in your datapack.
you could use the wraparound feature in most code editors if only the scrolling is annoying you.
for my use case
using macros is my only option i think
or split the line into multiples with \ at the end
you can use a predicate to check the scores
this reduces the line size considerably
i want to use it for the damage command
so essentially
and?
i want another entity to execute the command
becouse that will be the easiest way to do so
there is no way to compare if the entity is @s or @e i beleave
you dont need to use a macro for that. just apply a temporary tag to the original entity which you can reference in the damage command
i know
but if two people use it at ones
not possible
even if they run it in the same tick, everything gets executed sequentially, not parallel.
its not instant
ah, that's what you mean
i need an original entity
what exactly are you trying to create?
gyro's steel balls from sbr
sbr?
jojos bizzare adventure part
7
you apply the tag during the damage function and remove it during the damage function. the easiest way is gonna be with scoreboards as said before
cant you check for uuid with execute if data?
only with macros, as you have to check for the exact nbt
i know
im using macros
but what exactly is the path/way
UUID
there is no previous tag thta's it nested in
there also is no sub path
UUID is an array of 4 integer values
is there a way to check for the values inside?
UUID[0] <- first integer
UUID[1] <- second integer
UUID[2] <- ...
UUID[4] <- ...
alr
The I; at the beginning is just and indicator to show you what type of array that is.
is there a way to store the name of the player?
- create a loot table that drops a player head and apply the
fill_player_headfunction. - drop loot table (spawn or insert into an inventory)
- read the
namenbt inside theprofiletag
any way to compare them?
store the first name in a storage and overwrite it with the second name. if the overwrite command returns 0, nothing changed and it's the same name. If it returns 1, the data changed and that means they are different names.
can you show in a function?
[35mdata [34mmodify storage [33mnamespace:compare [0mname [34mset from entity [36m@n[33m[[37mtype[34m=[33mminecraft:item[34m, [37mtag[34m=[32mhead[33m] [0mprofile.name
[35mexecute [34mstore [0msuccess [34mscore [36m#success [0mtemp [34mrun [35mdata [34mmodify storage [33mnamespace:compare [0mname [34mset from entity [36m@n[33m[[37mtype[34m=[33mminecraft:item[34m, [37mtag[34m=[32mother_head[33m] [0mprofile.name
[35mexecute [34mif score [36m#success [0mtemp [34mmatches [32m0 [34mrun [35msay [0mSame name
[35mexecute [34mif score [36m#success [0mtemp [34mmatches [32m1 [34mrun [35msay [0mDifferent names
profile.name is not the correct path. Depending on if you get it from an item on the ground or from an inventory, you have to use Item.profile.name or Items.profile.name
in a system where you need to link entities and detect which entities are linked
i really would suggest a fully-score based id system 👀
me too
it is way more efficient than doing constant macro execution or nbt checks (the two heaviest and most performance impacting things)
Your question, #1305962788753113128 (detecting uuid with execute if), was resolved!
#1305962788753113128 message
1d19h26m