How to make a sword that gives effect to player when hitting mob.

Started by RaphBizz on

Topic category: Help with Minecraft modding (Java Edition)

Joined Jul 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to make a sword that gives effect to player when hitting mob.

Hey guys can anyone tell me how to make a sword that gives a potion effect to a player when they hit an animal/a mob?

Joined Dec 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I'm pretty sure it can be…
Wed, 07/24/2019 - 09:33

I'm pretty sure it can be solved using Procedures. Try exploring the coding blocks, and tell me if you can or can't find a way to do it.

Joined Jul 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I explored the coding blocks…
Sun, 07/28/2019 - 20:23

I explored the coding blocks but decided to do it again and could only find a way to give potion effects to the entity attacked and not to the player who attacked the entity.

 

Joined Mar 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
yeah ... that is my problem…
Mon, 03/16/2020 - 08:51

yeah ... that is my problem too... anyone can't help us ?

Joined Aug 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I have made new procedure…
Mon, 03/23/2020 - 09:53

I have made new procedure that when mob is killed with a chosen item in main hand it will give the player effect but for some reason if the item loses duration it will no longer give the player the effect. So if any of you know how to make the effect work even when the item loses duration please tell me. But this will work with item that does not lose duration.

Code: https://ctrlv.cz/Gc3D

Joined Jun 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
just do when mobs hurt with…
Mon, 03/23/2020 - 10:34

just do when mobs hurt with tool

execute command /effect and the effect you want

Joined Aug 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Could you please show me a…
Mon, 03/23/2020 - 11:27

Could you please show me a picture of the procedure? I tried multiple things with the execute command thing, but I cannot get it to work.

Joined Jun 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
vanilla commands for 1.14: …
Mon, 03/23/2020 - 11:29

vanilla commands

for 1.14:

/effect give @p resistance 100 2

gives resistance II for 100 secs

Joined Aug 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I know vanilla commands ;D…
Mon, 03/23/2020 - 12:42

I know vanilla commands ;D. I went to the tool procedures menu and picked "When mob is hit with tool" and added "execute command" procedure and added the "effect command", but in game when I hit something with it id does not give me any effect. I tried multiple ways to do it but nothing seems to work could you please make the procedure your self and post a screenshot It would be very helpful?
here are some ways i tried to do it but they didn't work: https://ctrlv.cz/XG3D

Joined Jun 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
you first create a procedure…
Sun, 06/20/2021 - 09:25

you first create a procedure. then you go to your sword menu and go to triggers. there you can put your procedure in *when living entity is hit with tool* hope this helped you I was searching for that for a bit of time xD