[SOLVED] How to make an AoE enchantment?

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 AoE enchantment?
Tue, 10/01/2024 - 17:49 (edited)

So I'm making a custom AoE enchant that deals a percentage of your original damage in a radius based on the level of the enchantment. Does anyone know how to do this?

Edited by AliveWater on Tue, 10/01/2024 - 17:49
Joined Jul 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Use the player uses item…
Sun, 09/29/2024 - 22:49

Use the player uses item trigger and the "get damage of [item in main hand]" block

Joined Jul 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Wait there is a better…
Sun, 09/29/2024 - 22:50

Wait there is a better trigger for hitting a mob, use that instead.

Joined Sep 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Yeah, but how do I make the…
Sun, 09/29/2024 - 23:56

Yeah, but how do I make the damage affect all of the entities within a certain radius?

Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Get damage of item in main…
Tue, 10/01/2024 - 12:11

Get damage of item in main hand gives you the items current durability.

Use entity iterator to affect all entities in a radius. World procedures, actions, for each entity as entity iterator is square cube of size (x). Change the size to match your desired radius. Then do whatever you want within the entity iterator. When adding any blocks to it you must change event/target entity to entity iterator instead. Unless you want data from the player.

You can also make an if entity iterator = not entity of type player so the effect doesnt apply to the player and only the other entities around it. This would mean it doesnt apply to other players too but you can change type player to source entity if you want it to affect other players and not the player who started the effect/ability.

If you want the attack damage of an item I dont know how without you hitting an entity first. If you use on entity attack global trigger you can call the (amount) dependency to get the damage done to the entity.

Otherwise you can make a long procedure to check if the item is eg iron sword so set local variable attack damge to 5 etc. Then use local variable *0.1 to get 10% of the iron swords damage and apply it to all entities using entity iterator.