Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
MinecraftForge
GitHub Repository: MinecraftForge/MinecraftForge
Path: blob/1.21.x/patches/minecraft/net/minecraft/world/entity/monster/piglin/AbstractPiglin.java.patch
7381 views
1
--- a/net/minecraft/world/entity/monster/piglin/AbstractPiglin.java
2
+++ b/net/minecraft/world/entity/monster/piglin/AbstractPiglin.java
3
@@ -82,7 +_,7 @@
4
this.timeInOverworld = 0;
5
}
6
7
- if (this.timeInOverworld > 300) {
8
+ if (this.timeInOverworld > 300 && net.minecraftforge.event.ForgeEventFactory.canLivingConvert(this, EntityType.ZOMBIFIED_PIGLIN, (timer) -> this.timeInOverworld = timer)) {
9
this.playConvertedSound();
10
this.finishConversion(p_360786_);
11
}
12
@@ -101,7 +_,10 @@
13
this.convertTo(
14
EntityType.ZOMBIFIED_PIGLIN,
15
ConversionParams.single(this, true, true),
16
- p_390698_ -> p_390698_.addEffect(new MobEffectInstance(MobEffects.NAUSEA, 200, 0))
17
+ p_390698_ -> {
18
+ p_390698_.addEffect(new MobEffectInstance(MobEffects.NAUSEA, 200, 0));
19
+ net.minecraftforge.event.ForgeEventFactory.onLivingConvert(this, p_390698_);
20
+ }
21
);
22
}
23
24
25