#how do i make chat announce what player hit who
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:1742540860: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
You can use the player_hurt_entity advancement and the entity_hurt_entity advancements.
thats what i have so far in a function
and then a scoreboard for hit_player
using scoreboard objectives add hit_player minecraft.custom:minecraft.damage_dealt
but when i test it using entity's it says zombie found zombie
when i dealt the damage?
i feel like that would only works once wouldnt it?
because it would count as an achievement right?
you can revoke them in the function that they run as a reward to reset them.
You use too many context changes. It outputs exactly what you tell it to.
first it targets all players with the hit score
then it changes the position to that player
next it runsthe command as 1 entity that is in a 3 block distance
(which doesn't have to be the entity you hit)
the you tellraw to every player (but still executed as the hit entity)
in the tellraw you target the executing entity (the zombie) and any entity in the distance with the hurt tag (again the zombie)
It's best to use advancements to give the tags to players (hurt and attacker) then in the tick funktioniert make it call a function to tellraw that and remove the tags. It's very unlikely that multiple people hit each other in the exact same tick, so we don't have to care about where they are.
You can then simply use this tellraw:
[35mtellraw [36m@a [33m[[35m{[32m"selector"[34m:[32m"@a[tag=attacker]"[35m}[34m,[32m"found"[34m,[35m{[32m"selector"[34m:[32m"@a[tag=hurt]"[35m}[34m,[32m"!"[33m]
np
this was made by a generator because i didnt know how to do this kind of thing so i understand why it was messed up. and the only post i found on reddit for it didnt make sense
so how do i go about using it in an advancement?
im new to the advancement catagory
im only used to functions and kinda loot_tables
managed to figure it out with 4 command blocks.
ill do some research on that topic for a better version but thankyou for all your help
Misode's Datapack Generators are useful when creating files such as loot tables, predicates, advancement, worldgen files, and more!
Best use this tool for all kinds of json files. It's your best friend in datapack making.
(criteria can have any name you want, I just chose "hurt" in this case)
It will look like this. You only have to put in your function path.
There are only 3 important fields you need to fill out.
- Trigger
- The source entity type/Target entity type
- Function to execute as reward
This question has been inactive for some time, so it's going to be closed for inactivity. If you still need it, please disregard this message.
This question has been inactive for some time, so it's going to be closed for inactivity. If you still need it, please disregard this message.
This question has been inactive for some time, so it's going to be closed for inactivity. If you still need it, please disregard this message.