#Differentiate player_hurt_entity by tag
1 messages · Page 1 of 1 (latest)
<@&1201956957406109788>
💬 While you wait, take this time to provide more context and details.
🙇 After a while, hit the Summon Helpers button to ping the helper team. They'll be happy to help you
✅ Once your question has been resolved (or you no longer need it), please click Resolve Question or run /resolve
You can easily add a Tag condition to the advancement by adding the nbt to the nbt field
nope just use @selector[tag=whatever] in the function you're calling as a reward
that only executes as an entity, doesn't stop the function from executing if I click the non-tagged one
yea so then you execute another funciton as the entity
Stopp instantly dismissing others solutions
i tried that, it just executes the function AS the start button, but still executes if i click the non-start entity
I suggest using misode to make your advancements. It helps a lot.
Awesome website with generators for almost everything. Also contains a technical changelog for new versions, guides on how to use some features, a performance report inspector and more!
Full list of generators: Loot Tables, Predicates, Item Modifiers, Advancements, Recipes, Text Components, Damage Types, Chat Types, Trim Materials, Trim Patterns, pack.mcmetas, Dimensions, Dimension Types, Biomes, Configured Carvers, Configured Features, Placed Features, Density Functions, Noise, Noise Settings, Structures, Structure Sets, Processor Lists, Template Pools, World Presets, Flat World Presets, World Settings, Block Tags, Entity Type Tags, Fluid Tags, Game Event Tags, Item Tags, Biome Tags, Structure Tags, Blockstates, Models, Fonts, Atlases
Ok, there is a field called NBT, put the Tag nbt in there and that should be it
execute on target if entity @s[tag=...] ...
where on target selects the entity that @s is targeting
OHHH THAT WHAT HAPPENS OMG IM SO STUPID
im so sorry for my rotted brain
but do you still wanna the solution without nbt tags by any chance
is there a way to do without
not familiar with target what does that do
ew light mode moment
light mode more like shite mode
basically yes what ping me guy suggested is half right
so the player clicks the thing, gets achievement, the achievement runs the function that executes as the entity the player clicked on only if the interaction entity is tagged
why only half
can i ask you to test something, i am not sure. can you put say @s in your funciton that runs after you punch an interaction entity
because you dont have the context from previous thread
it runs as the player i'm pretty sure
yeah
the first command in the function is just tp @s coords and it teleports the player
advancement rewards always run as the player riciving it
makes sense, didnt use too much advancements
back when i learned datapacks i didnt know about datapack hub
I don't see why you don't just execute on target if entity @s[tag=...] ...?
it's a solution
he is left clicking it
and
on target should be ran as the entity
yes...
left click attack
left click still requires you to put your cursor on the entity (eeyuh boio probs hasn't opened mc in a year)
so basically it should be
execute as @e[tag=start_tag_thing] on attacker run function the_funciton_here
the_function_here
say "now this should work fine"
@solemn jetty
does target select any entity the player is looking at or only entities that have been attacked by player
not on attacker
you are correct
on target
i kind of want to highlight the text when the player looks at it
click
attacking = left click?
yes
i mean you have to press lleft mouse button to attack
Interaction entities can select the last entity that interacted with them
yes
you're interrupting the helping process without realizing it
he's fine
my follow up question is still this
#function run by advancement
execute on target if entity @s[tag=...] on attacker run function do_something:with_player
advancement @s revoke ...
so is this like a new help request?
kinda, should i make a different post
did that work as expectet?
preferably yes
well a more relevant follow up question would be how badly does the nbt solution impact performance, and is it only called when the player clicks the button or is it run constantly
oh okay then it should be in this thread yea
it does not badly affect performance if done rarely, so if i spam click your button tps probably gonna drop
iirc you click it once and then tp to another place?
then its actually ok to use the nbt variant
yeah you TP after clicking so that couldn't happen