
var rp=entity.getPosition();
var rv=entity.getRotation();
var rl=entity.getLookVec();
var AB = player.getMountedEntity();
var v = player.getLookVec();
var pr = player.getRotation();
var rPos=Math.random(9);
var rpos=Math.round(rPos);


if(entity.isAlive()) {

	if(AB==null&&canpathrandomly==true){
	canpathrandomly=false;
	}

	if(entity.isPathing()==true){
	AnimWalk()
	}
	
	if(AB!=null){
	AB.setRotation(pr.yaw,0);
	abr =AB.getRotation();
	tameRamHead.setRotation((pr.yaw-abr.yaw),pr.pitch,0);
		
	if(keyboard.isKeyDown(17) == true) {
	tameRamHead.setRotation(0,pr.pitch,0);
	script.runScript("ridefore.js");
	}
	if(keyboard.isKeyDown(31) == true) {
	script.runScript("rideback.js")
	}
	keyboard.keyJumpScript="ridejump.js"	
	keyboard.keySneakScript="ridesneak.js"
	}
	else{tameRamHead.setRotation(0,0,0)}

}

else{tameRam.removeFromRendering();
tameRamHead.removeFromRendering();
hl.removeFromRendering();
hr.removeFromRendering();
lfl.removeFromRendering();
lrl.removeFromRendering();
rfl.removeFromRendering();
rrl.removeFromRendering();
}