how can i do a buff after killing an enemy

Started by FroakieGamer12260 on

Topic category: Help with modding (Java Edition)

Last seen on 19:55, 26. Aug 2024
Joined Aug 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
how can i do a buff after killing an enemy

for exemple, when the player kill an mob, the player recive a potion effect

Last seen on 18:35, 22. Jul 2024
Joined Sep 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You can make a procedure for…
Fri, 02/02/2024 - 10:56

You can make a procedure for when an entity is killed:

Event: When entity killed
If (source entity) is sub-type (player)
   add potion (effect goes here) to (source entity)

I hope I didn't make any mistakes here :D

Last seen on 19:55, 26. Aug 2024
Joined Aug 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
i cant find this procedure :(
Sat, 02/03/2024 - 08:44

i cant find this procedure :(

Last seen on 12:14, 24. Aug 2024
Joined Feb 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I did something similar but…
Sun, 02/04/2024 - 01:47

I did something similar but with item drops but it should work with potion effects if you set the main green block at the top’s white box to “entity dies” you can make a “if do” part from flow control make it “check if source entity has a certain advancement” then make it give the effect in the “do part” if you want it to give different effects depending on mob killed you can make it also check if they have a certain tag and you can get the source entity part from the “Minecraft components” tab which in the “has completed advancement” part you need to replace the Event/target entity block with source entity so it can check if the player has the advancement otherwise it’ll check if the mob has it. There’s probably other ways to do it but this is what I’ve found works. And sorry for the wall of text but I hope this helps.

Last seen on 19:55, 26. Aug 2024
Joined Aug 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
YESSSS, thank u so much :D…
Sun, 02/04/2024 - 04:22

YESSSS, thank u so much :D. But, if u can help me, if i kill an living entity with an especific tool, can i do it with an tag, to make the procedure smaller?

 


like this, insted i put all this different items, can I put only the tag?

Last seen on 12:14, 24. Aug 2024
Joined Feb 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
this should work hopefully…
Sun, 02/04/2024 - 20:35

this should work hopefully of course change the "minecraft:logs" part to what your item tags use and you can find the "is [] tagged in item tags as" block inside the item procedures folder just replace the "provided item stack" block hope this works.

Last seen on 19:55, 26. Aug 2024
Joined Aug 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
omg, THANK U SO MUCH, im so…
Sun, 02/04/2024 - 21:55

omg, THANK U SO MUCH, im so happy, you are an angel