How do I add an effect to the player if a Mob is killed.

Started by deningtongaming on

Topic category: Help with modding (Java Edition)

Last seen on 22:58, 23. May 2023
Joined Oct 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How do I add an effect to the player if a Mob is killed.

I wanted to add an effect "Pirate Omen" or possibly "Bad Omen" when MCreator 1.14 comes as that is a placeholder name.
But when I kill the Pirate Captain it does not give me(The player) an effect.
Instead it gives the pirate the effect as he dies (Testing with the glowing effect)

How do I get the Player to hold the effect once a special mob is killed?
Been trying to look it up but no answers. :/

Last seen on 22:58, 23. May 2023
Joined Oct 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Another issue that I am…
Sun, 10/13/2019 - 00:31

Another issue that I am having is with my custom effect
I gave myself the effect with a command, it gave me the effect for 30 seconds but it did not come up with an icon. Then I did it again and it gave me and Internal error, so I waited 30 seconds to do it again (Another internal error) so I drunk milk and my entire MCreator client completely froze including the game.
Could somebody also help me with that please? Not sure what I did wrong there.

Last seen on 22:58, 23. May 2023
Joined Oct 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
My entire workspace broke…
Sun, 10/13/2019 - 00:42

My entire workspace broke after the 4th crash -_-

Last seen on 22:58, 23. May 2023
Joined Oct 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Edit: I added the potion and…
Sun, 10/13/2019 - 00:52

Edit: I added the potion and the effect came up.
Waited 2 minutes for it to expire then redrunk it and MCreator crashed.

Last seen on 21:47, 24. Sep 2021
Joined May 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Can you post screenshots of…
Sun, 10/13/2019 - 01:42

Can you post screenshots of the procedures?

(potion, command, giving the effect, crash report)...

Last seen on 22:58, 23. May 2023
Joined Oct 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I can show the Procedures…
Sun, 10/13/2019 - 02:09

I can show the Procedures but cannot show the crash report as when the game crashes the entire MCreator program freezes so I can't view the log.

Last seen on 22:58, 23. May 2023
Joined Oct 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Starting off, this is the…
Sun, 10/13/2019 - 03:12

Starting off, this is the Workspace
Pirate and Archer may be safely ignored.

Pirate Captain (When killed: Should give Pirate Omen)
PirateCaptainEntityDies (Event to give player effect: Pirate Omen)
Pirate Omen (Effect. placeholder for Bad Omen)
PirateOmenRenew (Renews Pirate Omen on expire every second.)

What might be causing the issue: These are theories I have came up with.
The effect is not attached to anything eg. Swiftness, ex. Repeating Health Removal (Harming II) Procedure
The Renew is overwriting the current timer and breaking the Effect

Workspace

Next up is the Renew: PirateOmenRenew
2

 

Now here is the effect I was having issues with in the First post.
It attaches to the Mob and not the Player, I added more to it and now it attaches to nothing.

3

Last seen on 00:34, 20. Aug 2023
Joined Mar 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
The problem of the attach…
Sat, 08/08/2020 - 19:06

The problem of the attach procedure is it's attaching to CurrentEntity which is the pirate and since the pirate is not a player then it will do nothing and cause errors

 

Last seen on 16:23, 18. Mar 2024
Joined Dec 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Which one is CurrentEntity…
Thu, 09/10/2020 - 18:13

Which one is CurrentEntity in 2020.4 Target-entity or Source-entity?

Last seen on 14:00, 14. Nov 2023
Joined Jun 2015
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
There are two ways to give…
Fri, 09/11/2020 - 23:05

There are two ways to give the player potion effects after your mob's death.
The first way is to check when entity dies with global trigger in your procedure. Then you check the "event/target entity" type with the procedure block "Is event/target entity (sub)type ..." and if it's true, then you apply a potion effect to "source entity".
The second way is to use a trigger inside your mob's option, which is called when your mob dies. In your procedure created then, you apply a potion effect to "source entity".