Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,12 @@ public enum ExhaustionReason {
* Player regenerated health
*/
REGEN,
/**
* Player was affected by an enchantment
* @see <a href="https://minecraft.wiki/w/Enchantment_definition#apply_exhaustion">Minecraft Wiki: Enchantment Effects "apply_exhaustion"</a>
*/
// TODO - snapshot - In release check if this Wiki URL exists
ENCHANTMENT_EFFECT,
/**
* Unknown exhaustion reason
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- a/net/minecraft/world/item/enchantment/effects/ApplyExhaustion.java
+++ b/net/minecraft/world/item/enchantment/effects/ApplyExhaustion.java
@@ -17,7 +_,7 @@
@Override
public void apply(ServerLevel level, int enchantmentLevel, EnchantedItemInUse item, Entity entity, Vec3 origin) {
if (entity instanceof Player player) {
- player.causeFoodExhaustion(this.amount.calculate(enchantmentLevel));
+ player.causeFoodExhaustion(this.amount.calculate(enchantmentLevel), org.bukkit.event.entity.EntityExhaustionEvent.ExhaustionReason.ENCHANTMENT_EFFECT); // Paper - add ExhaustionReason
}
}

Loading