How to make the player get the effects?

Started by Ball-van on

Topic category: Help with Minecraft modding (Java Edition)

Joined Apr 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to make the player get the effects?

Hello everyone! Please tell me how to make sure that when using an item on the player, effects are superimposed?

Joined Jul 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
What effect
Wed, 05/26/2021 - 11:42

What effect

Joined Jul 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
i think it’s just so dam…
Wed, 05/26/2021 - 11:42

i think it’s just so dam easy u shall try urself

Joined Apr 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I want to make sure that…
Wed, 05/26/2021 - 12:08

I want to make sure that when killing a mob with a custom sword, the player gets regeneration, I can only apply the effect on the mobs, I don't know how to make the effect apply to the player in this case.

Joined Aug 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
MatthewX, it's actually not…
Wed, 05/26/2021 - 12:44

MatthewX, it's actually not very easy lol. I can say this because there's no trigger for "entity is killed with tool" and it's only possible through an event-based (globally triggered) procedure. plus, not all people are skilled at procedures. you didn't even teach him exactly how to do such thing, so... let me take it from here, i usually know what i do with procedures yet kind enough to show/teach people how to do something with them :D

 

 

Joined Aug 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Ball-van, you can use this…
Wed, 05/26/2021 - 13:15

Ball-van, you can use this as the basis for making your custom sword give players regeneration after they kill a mob with it:

https://i.imgur.com/JKDMDkg.png

all you need to change is the sword on the item procedure block to your own custom sword (as you can see i used netherite sword as an example). that's it, hope this helps! 

additional info for future reference:

  • "event/target entity" in most cases refers to the mob that is the subject of an event (e.g. right-clicked or damaged)
  • "source entity" on the other hand refers to the mob that is doing an action to another mob (like in this case, the player)
  • there are times when target entity and source entity both appear in a procedure's provided dependencies. always remember that the event/target entity in this situation is the one receiving the action, and source entity is the one doing the action
Joined Apr 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Hey! Thanks for your help!…
Wed, 05/26/2021 - 16:34

Hey! Thanks for your help! It helped me a lot!