Example Sheep

Example code for a sheep

public class Commands implements CommandExecutor{

	@Override
	public boolean onCommand(CommandSender s, Command cmd, String Label, String[] args) {
		if(s instanceof Player){
			CustomEntitySheep ces = CustomEntity.getNewCustomEntitySheep(((Player)s).getLocation());//Creates a new CustomSheep
			ces.setUnpushable();//Makes the sheep unpushable
			ces.setUnableToMove();//Makes the sheep unable to move
			ces.newPathfinderGoalTempt("DIAMOND");//Makes the sheep only move if a player nearby is holding a diamond
		}
		return false;
	}

}

Comments

Posts Quoted:
Reply
Clear All Quotes