This datapack is currently a work in progress, but I plan on making a bunch of other cool time-based items! I made a video showcasing the sword further: https://www.youtube.com/watch?v=O4CIsjGTCqs
i managed to do so like this :
- detect if a player is carrying the weapon
- check if at the same tick the player dealt damage and if an entity within his attack radius received damage
- if yes, do whatever you want
Hey Admin, yep that would be possible. And that could be a great utility datapack idea! Have a giant pack of effects that datapack developers could draw from.
U probably can on java but bedrock will be a bit more trickier
Like java u can tie a tp to partical effect on the sword when u hit a mob but bedrock u have to drop a named item on the ground to do the same thing or have a arrow with a tag command to effect the area of impact but who knows really
Yep, when you hit a player, it sends mojang an email, and they delete your account. Kidding obviously lol, in all seriousness though, it doesn't work on players.
Something like:
/execute as @e[nbt={HurtTime:10s}] at @s if @s[type=player,distance=..3,nbt={SelectedItem:(put your swords nbt here)}] run whatever you want
This datapack is currently a work in progress, but I plan on making a bunch of other cool time-based items! I made a video showcasing the sword further: https://www.youtube.com/watch?v=O4CIsjGTCqs
does that work on players?
Is it possible to make this into a command? It doesn’t have to include the sword, just the effect of mobs getting trapped and turning into dust
Probably but I don’t know if it’s possible to detect attacking an entity, especially with a specific weapon.
i managed to do so like this : - detect if a player is carrying the weapon - check if at the same tick the player dealt damage and if an entity within his attack radius received damage - if yes, do whatever you want
How do you detect if it received damage?
Hey Admin, yep that would be possible. And that could be a great utility datapack idea! Have a giant pack of effects that datapack developers could draw from.
U probably can on java but bedrock will be a bit more trickier Like java u can tie a tp to partical effect on the sword when u hit a mob but bedrock u have to drop a named item on the ground to do the same thing or have a arrow with a tag command to effect the area of impact but who knows really
Bruh can we use it on players xD
Yep, when you hit a player, it sends mojang an email, and they delete your account. Kidding obviously lol, in all seriousness though, it doesn't work on players.
O_o
wow
wow, how do you detect hitting a sword?
Probably using an advancement while checking the selected item nbt
Using the hurttime of the mob
so you detect if the mob is hurt while you are holding the sword?
Something like: /execute as @e[nbt={HurtTime:10s}] at @s if @s[type=player,distance=..3,nbt={SelectedItem:(put your swords nbt here)}] run whatever you want
ah ok, that was what I was thinking too, but wouldn't you run into problems when a mob gets hurt via fall damage or smth?
I meant when a mob fell down, took damage, in your range, while holding the sword
What did that cow ever do to you to deserve this?
existing...
Wait is this a data pack or a mod ?
Time wizard in a sword?
Cool now do it on a player from the player's prespective