-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Guinea pigs will be targeted by, and run away from, foxes
- Loading branch information
Showing
3 changed files
with
28 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package dev.seano.sgp.mixin; | ||
|
||
import dev.seano.sgp.entity.ai.TargetGuineaPigGoal; | ||
import net.minecraft.entity.EntityType; | ||
import net.minecraft.entity.passive.AnimalEntity; | ||
import net.minecraft.entity.passive.FoxEntity; | ||
import net.minecraft.world.World; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
@Mixin(FoxEntity.class) | ||
public abstract class FoxEntityMixin extends AnimalEntity { | ||
|
||
protected FoxEntityMixin(EntityType<? extends AnimalEntity> entityType, World world) { | ||
super(entityType, world); | ||
} | ||
|
||
@Inject(method = "initGoals", at = @At(value = "TAIL")) | ||
private void initGoals(CallbackInfo ci) { | ||
this.targetSelector.add(3, new TargetGuineaPigGoal(this)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters