[SOLVED] How to make an enchantment that deals percentage damage.

Started by AliveWater on

Topic category: Help with Minecraft modding (Java Edition)

Joined Sep 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
[SOLVED] How to make an enchantment that deals percentage damage.
Sun, 09/29/2024 - 18:01 (edited)

So I'm making a custom enchant (like a lot of custom enchantments) that are supposed to deal percentage damage. As in +50% damage to a specific type of mob. However I can't figure out how to make the enchant +50% of the sword damage to the mob (NOT 50% OF THE MOB'S HEALTH!). I can detect what mobs are being hit but can't get the damage itself to work. Does anyone know how to do this?

Edited by AliveWater on Sun, 09/29/2024 - 18:01
Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Use damage procedures. You…
Sat, 09/28/2024 - 01:16

Use damage procedures. You can call a number dependency called amount. If you look on the right side of the procedure window you can see all the data that the trigger provides you and you can use. As long as the trigger is on entity is hit or entity is hit with tool or something like that then you can get a damagesource (the player who damaged the entity) and the dependency amount (the damage amount the player did to the entity). The procedure block is in advanced i think.

Joined Sep 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thanks!  
Sun, 09/29/2024 - 17:59

Thanks!