#how do i make chat announce what player hit who

1 messages · Page 1 of 1 (latest)

tropic salmonBOT
#

<@&1201956957406109788>

Someone will come and help soon!

💬 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

rancid grail
#

You can use the player_hurt_entity advancement and the entity_hurt_entity advancements.

grim wigeon
#

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?

grim wigeon
#

because it would count as an achievement right?

rancid grail
#

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:

slate plinthBOT
#
tellraw @a [{"selector":"@a[tag=attacker]"},"found",{"selector":"@a[tag=hurt]"},"!"]
grim wigeon
#

ok let me try

#

thankyou for the clarification too

rancid grail
#

np

grim wigeon
#

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

grim wigeon
#

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

unkempt grailBOT
#
Tool: Misode
About

Misode's Datapack Generators are useful when creating files such as loot tables, predicates, advancement, worldgen files, and more!

rancid grail
#

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
tropic salmonBOT
#
Closed for inactivity

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.

tropic salmonBOT
#
Closed for inactivity

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.

tropic salmonBOT
#
Closed for inactivity

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.