How can I make rotten flesh give wither effect instead of hunger?

Started by ADozenRoses on

Topic category: Help with modding (Java Edition)

Last seen on 06:50, 26. Sep 2023
Joined Sep 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How can I make rotten flesh give wither effect instead of hunger?

I’m making a map/modpack and want rotten flesh to give a wither effect (1 heart at a time) instead of hunger. Think of how Fallout 4s Rads system works. You eat one flesh you lose one heart. eat another you lose another heart. Is there any way i could do this?

 

I’d imagine it’d be easier to start fresh with a new item with the flesh texture, and then just add it to the zombies loot tables later. How could i do this?

Last seen on 17:17, 16. Sep 2024
Joined Dec 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You could add a procedure…
Sat, 09/23/2023 - 10:12

You could add a procedure like that : 

When (global trigger) player uses item

If [provided itemstack] = Rotten flesh

do: 

remove specific potion effect [HUNGER] from event:target entity

add potion effect [Wither] for (whatever wither time you wanna add) ticks

 

The only issue is that if he had already hunger effect before eating the flesh, the hunger effect would stop.