How to make the player get the effects?

Started by Ball-van on Wed, 05/26/2021 - 11:18

Topic category: Help with modding (Java Edition)

Last seen on 10:07, 19. Aug 2022
Joined Apr 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
How to make the player get the effects?
Wed, 05/26/2021 - 11:18

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

Last seen on 10:46, 22. Jun 2022
Joined Jul 2018
Points:

User statistics:

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

What effect

Last seen on 10:46, 22. Jun 2022
Joined Jul 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • 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

Last seen on 10:07, 19. Aug 2022
Joined Apr 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • 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.

Last seen on 03:46, 5. Mar 2023
Joined Aug 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • 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

 

 

Last seen on 03:46, 5. Mar 2023
Joined Aug 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • 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
Last seen on 10:07, 19. Aug 2022
Joined Apr 2021
Points:

User statistics:

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

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