Custom enchantment makes mob drop custom item

Started by sebastiank2939 on

Topic category: Help with Minecraft modding (Java Edition)

Active 6 days ago
Joined Oct 2021
Points:
549

User statistics:

  • Modifications: 0
  • Forum topics: 5
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 7
Custom enchantment makes mob drop custom item

I'm trying to make a custom enchantment drop a custom item when an undead mob type is killed with the enchantment applied to a sword. I've been trying to figure out how to do it, but without any luck. I thought what I currently have would work, unfortunately it does not. If you know how to do it, please help.

Active 6 months ago
Joined Mar 2021
Points:
1021

User statistics:

  • Modifications: 3
  • Forum topics: 37
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 451
Trigger is entity dies If…
Sun, 10/24/2021 - 14:11

Trigger is entity dies

If source entity has active = potion effect name

then do: randomize % drop

Active 1 year ago
Joined Oct 2020
Points:
1621

User statistics:

  • Modifications: 0
  • Forum topics: 15
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 1874
potion effect??? also this…
Sun, 10/24/2021 - 16:02

potion effect???

also this should be your procedure

Trigger entity dies

if item in main hand of source entity is enchanted with: ENCHANT AND is event target entity type:Undead (found in entity data)

do spawn gem: ITEM at x y z 

Active 6 days ago
Joined Oct 2021
Points:
549

User statistics:

  • Modifications: 0
  • Forum topics: 5
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 7
I tried this and nothing…
Mon, 10/25/2021 - 03:08

I tried this and nothing happened. Does it work with vanilla mob drops, or do I need to have a custom entity for it to drop?

Active 1 year ago
Joined Oct 2020
Points:
1621

User statistics:

  • Modifications: 0
  • Forum topics: 15
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 1874
works with anything you…
Mon, 10/25/2021 - 03:13

works with anything

you probably did the procedure wrong

Active 6 days ago
Joined Oct 2021
Points:
549

User statistics:

  • Modifications: 0
  • Forum topics: 5
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 7
Yeah, most likely. Do I need…
Mon, 10/25/2021 - 04:00

Yeah, most likely. Do I need to add the procedure to anything or is it fine on its own?

Active 1 year ago
Joined Oct 2020
Points:
1621

User statistics:

  • Modifications: 0
  • Forum topics: 15
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 1874
fine on its own
Mon, 10/25/2021 - 04:03

fine on its own

Active 6 months ago
Joined Mar 2021
Points:
1021

User statistics:

  • Modifications: 3
  • Forum topics: 37
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 451
Sorry i misunderstood your…
Mon, 10/25/2021 - 05:52

Sorry i misunderstood your request

I have same feature on my mod

Trigger entity dies

If main hand of source entity = item and get enchantment = enchant name and entity = undead

Do spawn gem  item to be dropped

 

Active 1 year ago
Joined Oct 2020
Points:
1621

User statistics:

  • Modifications: 0
  • Forum topics: 15
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 1874
isn't that what I just said…
Mon, 10/25/2021 - 06:13

isn't that what I just said lol

Active 6 days ago
Joined Oct 2021
Points:
549

User statistics:

  • Modifications: 0
  • Forum topics: 5
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 7
I figured it out, I just did…
Mon, 10/25/2021 - 18:33

I figured it out, I just did the procedure wrong lol. Thank you