Skip to content

Commit

Permalink
Make moose faster in water
Browse files Browse the repository at this point in the history
  • Loading branch information
itsmeow committed Nov 9, 2019
1 parent 892a323 commit 3698081
Showing 1 changed file with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public EntityMoose(World worldIn) {
super(worldIn, 5);
this.setSize(2.25F, 3F);
}

@Override
protected void initEntityAI() {
super.initEntityAI();
Expand All @@ -46,14 +46,19 @@ protected void applyEntityAttributes() {
this.getAttributeMap().registerAttribute(SharedMonsterAttributes.ATTACK_DAMAGE);
this.getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(4.5D);
}


@Override
protected float getWaterSlowDown() {
return 0.98F;
}

protected EntityAIEatGrassCustom provideEatTask() {
return new EntityAIEatGrassCustom(this, 50, 50, eater -> {
EnumFacing facing = eater.getHorizontalFacing();
return eater.getPosition().offset(facing).offset(facing);
});
}

@Override
public boolean attackEntityAsMob(Entity entityIn) {
Vec3d pos = this.getPositionVector();
Expand All @@ -66,8 +71,8 @@ public boolean attackEntityAsMob(Entity entityIn) {
@Override
public void onDeath(DamageSource cause) {
super.onDeath(cause);
if (!world.isRemote && !this.isChild()) {
if (this.rand.nextInt(12) == 0) {
if(!world.isRemote && !this.isChild()) {
if(this.rand.nextInt(12) == 0) {
ItemStack stack = new ItemStack(HeadTypes.MOOSEHEAD.getItem(this.getTypeNumber()));
this.entityDropItem(stack, 0.5F);
}
Expand All @@ -88,11 +93,11 @@ protected IVariantTypes getBaseChild() {
protected String getContainerName() {
return "moose";
}

@Override
@Nullable
public IEntityLivingData onInitialSpawn(DifficultyInstance difficulty, @Nullable IEntityLivingData livingdata) {
int validTypes[] = {1, 2, 3, 4};
int validTypes[] = { 1, 2, 3, 4 };
return this.initData(super.onInitialSpawn(difficulty, livingdata), getBiasedRandomType(validTypes));
}

Expand Down

0 comments on commit 3698081

Please sign in to comment.