disable enderman block pickups ??
This commit is contained in:
parent
821f1ac044
commit
a04cd8eab0
|
@ -0,0 +1,27 @@
|
|||
package zone.oat.disableharmfulmobgriefs.mixin;
|
||||
|
||||
import net.minecraft.entity.ai.goal.Goal;
|
||||
import net.minecraft.entity.ai.goal.GoalSelector;
|
||||
import net.minecraft.entity.mob.EndermanEntity;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
import org.spongepowered.asm.mixin.injection.Slice;
|
||||
|
||||
@Mixin(EndermanEntity.class)
|
||||
public class DisableEndermanBlockSteal {
|
||||
@Redirect(
|
||||
method = "initGoals",
|
||||
at = @At(
|
||||
value = "INVOKE",
|
||||
target = "Lnet/minecraft/entity/ai/goal/GoalSelector;add(ILnet/minecraft/entity/ai/goal/Goal;)V"
|
||||
),
|
||||
slice = @Slice(
|
||||
from = @At(value = "INVOKE", target = "Lnet/minecraft/entity/mob/EndermanEntity$PlaceBlockGoal;<init>(Lnet/minecraft/entity/mob/EndermanEntity;)V"),
|
||||
to = @At(value = "INVOKE", target = "Lnet/minecraft/entity/mob/EndermanEntity$TeleportTowardsPlayerGoal;<init>(Lnet/minecraft/entity/mob/EndermanEntity;Ljava/util/function/Predicate;)V")
|
||||
)
|
||||
)
|
||||
private void injected(GoalSelector instance, int priority, Goal goal) {
|
||||
// just completely ignore it
|
||||
}
|
||||
}
|
|
@ -5,6 +5,7 @@
|
|||
"compatibilityLevel": "JAVA_16",
|
||||
"mixins": [
|
||||
"DisableCreeperExplosion",
|
||||
"DisableEndermanBlockSteal",
|
||||
"DisableFireball"
|
||||
],
|
||||
"injectors": {
|
||||
|
|
Loading…
Reference in New Issue