Invincibility Frames

Started by Joshualtd on

Topic category: Help with Minecraft modding (Java Edition)

Active 1 day ago
Joined Jun 2017
Points:
733

User statistics:

  • Modifications: 0
  • Forum topics: 7
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 12
Invincibility Frames
Mon, 03/14/2022 - 18:15 (edited)

is there a possibility to remove iframes (after player/entity got hit it gets 10 ticks invincibility that i absolutely hate sometimes) or somehow change how it works like decrease the iframes or remove it for certain items?

Edited by Joshualtd on Mon, 03/14/2022 - 18:15
Active 2 years ago
Joined Feb 2022
Points:
418

User statistics:

  • Modifications: 0
  • Forum topics: 0
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 3
Can someone answer this? I…
Wed, 04/06/2022 - 18:58

Can someone answer this? I've been trying to do the same.

Active 2 years ago
Joined Dec 2019
Points:
630

User statistics:

  • Modifications: 0
  • Forum topics: 0
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 3
Yeaah its Prob not possible…
Mon, 05/30/2022 - 14:31

Yeaah its Prob not possible in MCreator but you can Just "Set Entity's health = Entity's Current Health - Damage Amount" and it does bypass Hurttime but it also bypasses defenses and everything so idk you prob can with codes but its quite a challenge without it
I'm not a programmer though. I only do C# for coding

Active 2 years ago
Joined Dec 2019
Points:
630

User statistics:

  • Modifications: 0
  • Forum topics: 0
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 3
Maaybe good for Magic…
Mon, 05/30/2022 - 14:32

Maaybe good for Magic Damages? 

Active 2 years ago
Joined Mar 2021
Points:
656

User statistics:

  • Modifications: 0
  • Forum topics: 4
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 190
these frames that you want…
Mon, 05/30/2022 - 17:08

these frames that you want to remove balance the games combat to deny exccessive damage in a short period of time this should be used very lightly in your mod if you want to use it at all.

Active 2 years ago
Joined Feb 2022
Points:
569

User statistics:

  • Modifications: 1
  • Forum topics: 13
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 161
Do what MAKC said but for…
Tue, 05/31/2022 - 20:57

Do what MAKC said but for the damage amount, but go to minecraft's wiki and figure out the damage/armor/armor toughness calculus for damage done and do that then apply the damage amount.

Active 11 months ago
Joined Nov 2022
Points:
267

User statistics:

  • Modifications: 0
  • Forum topics: 1
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 11
I don't know if you still…
Thu, 11/24/2022 - 10:28

I don't know if you still need help but I came up with a solution for anyone who needs it. @MAKC Suggested "Just "Set Entity's health = Entity's Current Health - Damage Amount" and it does bypass Hurttime but it also bypasses defenses and everything" which is good advice, BUT this method (sorta) doesn't bypass defenses.

 

Two procedures.

 

First procedure:

Set a Global Variable as Global Session/number

Use the global trigger "Before Entity is Hurt"

If: [Source Entity] is subtype Player

Do: Set Global Variable "Name of your variable" to [Current health of Target Entity]

 

 

Second Procedure:

Set another Global Variable as Global Session/Number

Use the Global Trigger "Entity Attacked" or whatever trigger you are using.

Set Global Variable "Name of your first Variable" to [ (Itself) Minus (Current health of Target Entity) ]

This will set it to the amount of damage that was dealt.

Then set your new Global Variable to [ (1st Variable) multiplied by (The % of original damage dealt formatted as 0.##) ]

This will set the second variable to your desired percentage of damage originally dealt.

 

Then you can use this variable how @MAKC suggested, by subtracting it from the entity's current health.

 

Doing it this way will take defenses into account. Hope this helps someone and isn't too confusing!

Active 11 months ago
Joined Nov 2022
Points:
267

User statistics:

  • Modifications: 0
  • Forum topics: 1
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 11
I forgot to include: On the…
Thu, 11/24/2022 - 10:36

I forgot to include: On the second procedure, you also need to include the same If/Do block with the player subtype when setting the two Global Variables.

Active 11 months ago
Joined Nov 2022
Points:
267

User statistics:

  • Modifications: 0
  • Forum topics: 1
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 11
Ok forget everything I just…
Thu, 11/24/2022 - 13:00

Ok forget everything I just mentioned. I apologize. After testing, it wasn't working consistently and I found a much more consistent and in fact easier method.

 

So, when you attack an entity, the very first tick registers the entity at health prior to damage. So, by utilizing this, I came up with a simpler solution.

 

 

One procedure.

Two Global Variables set to Global Session/Number.

 

Upon the entity being attacked, immediately set the first global variable to the entity's current health and set the second variable to zero to reset it each time.

Then set a server wait for 1 tick, then set the second variable to [ (The first Variable) minus (The current health of the entity) ]

 

Now you have your damage amount and can do what I mentioned earlier by multiplying by the % formatted as 0.## to get a percent of the damage dealt. This is simpler and it still accounts for defenses. And it actually works consistently.

Active 2 years ago
Joined Feb 2022
Points:
578

User statistics:

  • Modifications: 0
  • Forum topics: 18
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 158
In a custom code snippet put…
Thu, 11/24/2022 - 15:23

In a custom code snippet put:

entity.invulnerableTime = 0;