[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)

Active 10 months ago
Joined Sep 2024
Points:
90

User statistics:

  • Modifications: 0
  • Forum topics: 7
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 8
[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
Active 4 months ago
Joined Jul 2022
Points:
537

User statistics:

  • Modifications: 1
  • Forum topics: 2
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 237
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.

Active 4 months ago
Joined Jul 2022
Points:
537

User statistics:

  • Modifications: 1
  • Forum topics: 2
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 237
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.

Active 10 months ago
Joined Sep 2024
Points:
90

User statistics:

  • Modifications: 0
  • Forum topics: 7
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 8
Thanks!
Sun, 09/29/2024 - 18:01

Thanks!