Provided Damage Procedure Blocks

Started by Isalick34 on

Topic category: Feature requests and ideas for MCreator

Last seen on 17:30, 19. Apr 2024
Joined Oct 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Provided Damage Procedure Blocks
Sat, 04/08/2023 - 18:46 (edited)

This would be for "Entity Attacked", "Entity is Hurt", and "Living Entity is hit with Tool" Triggers
It should also stack with other procedures that modify the Damage.

 

  • New block: Provided Damage: The amount of health the hit did to the Event Entity
  • New block: Provided Damage Type: The type of damage the hit was. Examples: Fire, Drown, Generic, Explosion, etc.
    This would come with a new logic = block
  • New block: Set Damage to [#]: This will modify the amount of damage that will be done to the entity that was hurt:
    Example: If {Get armor slot [0] of Entity (Event Target/Entity)} = (minecraft:iron_boots)} Set damage to [(Provided Damage) / 2].
    This would divide the damage done to the entity by 2 if they're currently wearing iron boots.
    Example 2: If {Provided Damage Type} = (Fire) If {Get armor slot [0] of Entity (Event Target/Entity)} = (minecraft:iron_boots) Set damage to [(Provided Damage) / 2]
    This would do the same thing as the first example but only if the damage type was fire.
    Here is probably what it would look like:
Edited by Isalick34 on Sat, 04/08/2023 - 18:46
Last seen on 08:56, 19. Apr 2024
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
YESSSSSSS please, this would…
Sat, 04/08/2023 - 02:32

YESSSSSSS please, this would be super helpful

Last seen on 19:57, 8. Apr 2024
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
This would be invaluable for…
Thu, 08/17/2023 - 18:16

This would be invaluable for me, as I am trying to update the armor system to where certain types of armor resist differing damage types. So like leather is good at resisting fall damage but bad at resisting explosion, and gold is good at resisting magic but not fire.

Last seen on 15:21, 16. Oct 2023
Joined Oct 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
1. Triggers that do damage…
Fri, 08/18/2023 - 08:19

1. Triggers that do damage already give you amount of this damage in provided dependencies, I think just double click it and it'll give you a block. 

2. Damage types are added in 2nd snapshot of mcreator 2023.3: 

Added damage source dependency to some procedure triggers

3. I don't think they want to add any trigger specific blocks since they wouldn't be usable with anything else.

My search through minecraft source code shows that code used in "Entity is Attacked" trigger doesn't allow you to change damage amount. Damage is done after during "Entity is Hurt" trigger and that's when you can change damage amount. However you can do this with a code snippet block and basic programming knowledge, literally one line that works only with ⁠⁠⁠⁠⁠⁠⁠"Entity is Hurt":

((LivingHurtEvent) event).setAmount(AMOUNT);

Just replace ⁠⁠⁠⁠⁠⁠⁠AMOUNT with a number or a variable name which contains damage you want to set. 

Last seen on 00:42, 10. Oct 2023
Joined Mar 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Interesting idea. Guess I'll…
Tue, 08/22/2023 - 01:05

Interesting idea. Guess I'll make a plugin to make it quicker