Skip to content

Instantly share code, notes, and snippets.

@tinkerstudent
Last active April 23, 2016 16:17
Show Gist options
  • Select an option

  • Save tinkerstudent/b4ed261c1264ce866008 to your computer and use it in GitHub Desktop.

Select an option

Save tinkerstudent/b4ed261c1264ce866008 to your computer and use it in GitHub Desktop.
package com.tinkeracademy.minecraft;
import net.minecraft.entity.passive.EntityOcelot;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
public class Cat extends EntityOcelot {
public boolean following;
public Cat(World worldIn) {
super(worldIn);
}
// TODO: 3
// public boolean interact(EntityPlayer player)
// {
// ItemStack itemstack = player.inventory.getCurrentItem();
//
// if (itemstack != null && itemstack.getItem() == Items.fish && player.getDistanceSqToEntity(this) < 9.0D) {
// this.setTamed(true);
// this.setOwnerId(player.getUniqueID().toString());
// this.playTameEffect(true);
// this.aiSit.setSitting(true);
// this.worldObj.setEntityState(this, (byte)7);
// }
//
// return true;
// }
public void followPlayer() {
if (!following) {
this.tasks.addTask(12, new CatFollowAI(this, 1.0D, 10.0F, Float.MAX_VALUE));
following = true;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment