[SOLVED] How to make an enchantment that gives extra exp after killing entities.

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 gives extra exp after killing entities.
Sun, 09/29/2024 - 18:01 (edited)

So I'm create a mod with bunch of custom enchantments and can't figure out how to give the player extra exp when killing mob with a weapon that has this enchantment. Anyone who knows 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:
On entity dies trigger. Get…
Sat, 09/28/2024 - 01:18

On entity dies trigger. Get if source entity is type player, if so get item in main hand is enchanted with enchantment (custom enchantment). If so give player exp. Idk if theres a procedure to get exp of an entity, if there is then use that to get the exp amount of the event target entity and give it to the source entity.

Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I meant use the exp of the…
Sat, 09/28/2024 - 01:18

I meant use the exp of the event target entity to for example: /2 and add to player to get 50% bonus exp.