#detecting uuid with execute if

1 messages · Page 1 of 1 (latest)

blazing sable
#

how do i do that?

balmy flumeBOT
#

<@&1201956957406109788>

Someone will come and help soon!

💬 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

balmy flumeBOT
# balmy flume <@&1201956957406109788>

<@&1166082198152159386> <@&1202694677766348840>

🙇 Helpers Arise!

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)

timid thunder
#

Detect in what way?

#

Do you want to store the UUID somewhere? Compare it to another UUID?

blazing sable
#

compare uuids

blazing sable
#

but idk how to compare them

timid thunder
#

How did you store them?

blazing sable
#

its for a projectile

timid thunder
#

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

blazing sable
#

it doesnt need to be complicated

#

like

#

what is the data path to a uuid

#

and how do i detect its number

timid thunder
timid thunder
blazing sable
#

so scorebored?

timid thunder
#

Yes

blazing sable
timid thunder
#

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

carmine mirage
#

if you really wanted to streamline it as much as possible you could probably take a function macro that takes target selectors as inputs

carmine mirage
#

but generally when i need to do this i just compare 4 scores for each uuid number separately in 4 ifs

blazing sable
carmine mirage
#

generally i would suggest foregoing macros and storing the uuids of entities you will be comparing with 4 scoreboards

carmine mirage
#

basically you can only compare scores but you can turn the data into a score

blazing sable
carmine mirage
#

no

#

i mean

#

technically you could maybe see whether merging succeeds? but no 2 entities should have the same uuid to begin with

blazing sable
#

i know

blazing sable
#

essentially

#

i stored the uuid into a marker's name

#

and i was wondering if there is a way to compare that

carmine mirage
#

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

blazing sable
carmine mirage
#

not without using scoreboards and/or macros

#

well scoreboards are really the simplest way though

blazing sable
#

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

timid thunder
#

Or an enchantment

final crater
#

you could use the wraparound feature in most code editors if only the scrolling is annoying you.

blazing sable
#

using macros is my only option i think

final crater
final crater
#

this reduces the line size considerably

blazing sable
#

so essentially

final crater
#

and?

blazing sable
#

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

final crater
#

what?

#

what do you meany by that?
What does comparing @s and @e mean?

obsidian wave
#

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

blazing sable
#

i know

blazing sable
final crater
#

even if they run it in the same tick, everything gets executed sequentially, not parallel.

final crater
#

ah, that's what you mean

blazing sable
#

i need an original entity

final crater
#

what exactly are you trying to create?

blazing sable
final crater
#

sbr?

obsidian wave
#

jojos bizzare adventure part

blazing sable
#

7

obsidian wave
blazing sable
final crater
blazing sable
#

im using macros

#

but what exactly is the path/way

final crater
#

UUID

blazing sable
#

but like UUID:?

#

UUID.?

final crater
#

there is no previous tag thta's it nested in

#

there also is no sub path

#

UUID is an array of 4 integer values

blazing sable
final crater
#
UUID[0] <- first integer
UUID[1] <- second integer
UUID[2] <- ...
UUID[4] <- ...
blazing sable
#

i know

#

but like

#

how do i check the string inside

final crater
#

there is no string inside

#

only those 4 integers

blazing sable
#

alr

final crater
#

The I; at the beginning is just and indicator to show you what type of array that is.

blazing sable
final crater
#
  1. create a loot table that drops a player head and apply the fill_player_head function.
  2. drop loot table (spawn or insert into an inventory)
  3. read the name nbt inside the profile tag
final crater
#

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.

cursive bisonBOT
#
data modify storage namespace:compare name set from entity @n[type=minecraft:item, tag=head] profile.name
execute store success score #success temp run data modify storage namespace:compare name set from entity @n[type=minecraft:item, tag=other_head] profile.name

execute if score #success temp matches 0 run say Same name
execute if score #success temp matches 1 run say Different names
final crater
#

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

carmine mirage
#

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 👀

final crater
#

me too

#

it is way more efficient than doing constant macro execution or nbt checks (the two heaviest and most performance impacting things)

balmy flumeBOT
#
Question Closed

Your question, #1305962788753113128 (detecting uuid with execute if), was resolved!

Original Message

#1305962788753113128 message

Duration open

1d19h26m