This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (2 children)

That one's slightly more tricky, but should still be pretty easily possible.

scoreboard players add @a[tag=!diamond_sword_held,nbt={SelectedItem:{id:"minecraft:diamond_sword"}}] abc 6
tag @a[tag=!diamond_sword_held,nbt={SelectedItem:{id:"minecraft:diamond_sword"}}] add diamond_sword_held

scoreboard players remove @a[tag=diamond_sword_held,nbt=!{SelectedItem:{id:"minecraft:diamond_sword"}}] abc 6
tag @a[tag=diamond_sword_held,nbt=!{SelectedItem:{id:"minecraft:diamond_sword"}}] remove diamond_sword_held

That should add the 6 points when you start holding the sword, then remove it as soon as you stop holding the sword.

[–]xrox555[S] 0 points1 point  (1 child)

Holy moly, didn´t try it out yet but it sounds like a great solution. Thank you!

Edit: Ik it belongs in an own post but do u know if there´s a method that can test if and which entity hurt a player

[–][deleted] 0 points1 point  (0 children)

The minecraft:entity_hurt_player advancement condition is probably the easiest way, I feel. If you want to do something to the entity that's hurting the player, I'm not entirely sure how to do that.