How Do I Add A Vulnerability Effect To An Entity On Hit?

Started by Xanderz_1001 on

Topic category: Help with modding (Java Edition)

Last seen on 17:51, 20. Jan 2024
Joined Jun 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How Do I Add A Vulnerability Effect To An Entity On Hit?

I want a custom weapon to inflict vulnerability to an entity on hit, basically like negative resistance for a few seconds, where it is more prone to taking damage. I've tried just adding negative resistance, but it seems to have no effect. Any help is appreciated.

Last seen on 19:36, 28. Mar 2024
Joined Jan 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Create a way for the entity…
Mon, 02/20/2023 - 23:51

Create a way for the entity to get a potion effect (the debuff).

Then make this procedure:

This basicly causes the entity to take increased damage when they take damage form attacks (or "before entity hurt", then it is all damage).

Last seen on 17:51, 20. Jan 2024
Joined Jun 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
For some reason my game…
Tue, 02/21/2023 - 03:28

For some reason my game crashes whenever the effect is inflicted and the entity is hit again. Either it's a bug or I did something wrong.

I made a procedure by itself (not under anything, don't think I'm supposed to) and put the "flat amount of damage" block in it, as well as a procedure under a custom sword where when the sword attacks an entity it inflicts it with the effect.

It might be from the game trying to deal damage twice in a row when an entity is only supposed to be hit once before its invulnerability frames are up, at least that's my best guess.

I was thinking, is possible to just set the entity's health to -2 of what its current health is instead of dealing damage? If it's a bug then that might fix it.

Last seen on 19:36, 28. Mar 2024
Joined Jan 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
This procedure has nothing…
Tue, 02/21/2023 - 04:00

This procedure has nothing that can cause problems, i tried it out and it crashed aswell. I am using the latest snapshot so it most likely is a bug because i have made similar procedures before, so we will have to use a makeshift one in the meantime as "deal damage" seems to be bugged. So here is a new procedure untill deal damage is fixed:

Replace the 2 with the damage you want. This is to be expected with test versions, that is if you are using the snapshot aswell.

Last seen on 17:51, 20. Jan 2024
Joined Jun 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thanks, this works! Also,…
Tue, 02/21/2023 - 05:13

Thanks, this works!

Also, how could I make it deal more damage if the effect is a higher level?

Last seen on 19:36, 28. Mar 2024
Joined Jan 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Np, use the "get effect…
Tue, 02/21/2023 - 12:29

Np, use the "get effect level/amplifier of potion --- for event/target entity" where "if level 0 do 2 damage" and a bunch of else ifs for each level. Should work.

Last seen on 17:51, 20. Jan 2024
Joined Jun 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thx!!!
Tue, 02/21/2023 - 22:05

Thx!!!

Last seen on 08:41, 23. Jan 2024
Joined May 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Hey Guys, So I'm trying to…
Sat, 01/20/2024 - 12:34

Hey Guys, So I'm trying to make the Jarate from Team Fortress 2 but your procedure does not work for me, it just kills and entities instantly and I was wondering if you could help me. I'm also trying to make the Dead Ringer as well so any help on that is also appreciated.

Last seen on 17:51, 20. Jan 2024
Joined Jun 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Sure! First, make the effect…
Sat, 01/20/2024 - 17:51

Sure! First, make the effect. The only thing you should change in the triggers section is the "Active tick condition", which should be set to (always). Then, make a procedure. Here's what it should look like:

https://imgur.com/a/RrsZHM6

 

Note: this is definitely not the most optimized, as you would need to make more procedures for each level, but if that doesn't matter too much and you only plan on using a few different levels of the effect, then it shouldn't be much of a problem.

Last seen on 17:51, 20. Jan 2024
Joined Jun 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Oh right, and to add this to…
Sat, 01/20/2024 - 17:54

Oh right, and to add this to a weapon, create a procedure under "When living entity is hit with tool", and add this procedure inside it:

https://imgur.com/a/2wGH5YU

Last seen on 08:41, 23. Jan 2024
Joined May 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thank you so much for that,…
Sun, 01/21/2024 - 02:30

Thank you so much for that, I have yet to test it and I only plan on adding one level for Jarate. But do you think you could help me with the Dead Ringer?

 

Last seen on 08:41, 23. Jan 2024
Joined May 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Hey Again, Ive just tested…
Sun, 01/21/2024 - 02:53

Hey Again, Ive just tested out your Procedure for the Jarate and it just kills the entities instantly, even me in creative Mode. I dont know if I have done something wrong or?

Last seen on 08:41, 23. Jan 2024
Joined May 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I have figured it out, but I…
Sun, 01/21/2024 - 03:02

I have figured it out, but I take damage when the potion lands on me and I am applied with it. I changed the procedure to "On Effect active Tick" to "When effect started/Applied" I think its good enough for now so thank you for your help and would really appreciate anyting else for the Dead Ringer. Cheers

 

Last seen on 08:41, 23. Jan 2024
Joined May 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Hello Again, I have figured…
Tue, 01/23/2024 - 08:11

Hello Again, I have figured out how to fix the Dead Ringer so I will no longer need help but thankyou for all the help you have provided me with.