@SubscribeEvent
public void interact(EntityInteractEvent event) {
Entity entity = event.target;
if (entity instanceof EntityTameable) {
EntityTameable tameable = (EntityTameable) entity;
String ownerId = tameable.func_152113_b();
if (tameable.isTamed() && (ownerId == null || ownerId.trim().length() == 0)) {
if (rand.nextInt(3) == 0) {
tameable.func_152115_b(event.entityPlayer.getUniqueID().toString());
playTameEffect(tameable, true);
tameable.func_70907_r().setSitting(true);
tameable.worldObj.setEntityState(tameable, (byte) 7);
} else {
playTameEffect(tameable, false);
tameable.worldObj.setEntityState(tameable, (byte) 6);
}