I'm trying to prevent the player death if it has a tamed phoenix, but I have no idea on how to make the event detect it.
Any help would be appreciated.
Here's my code:
public class EventPhoenixRevive {
@SubscribeEvent
public void onPlayerDeath(LivingDeathEvent event) {
World world = event.getEntity().getEntityWorld();
if (!world.isRemote) {
if (event.getEntityLiving() instanceof EntityPlayer) {
EntityPlayerMP mp = (EntityPlayerMP) event.getEntity();
EntityPhoenix phoenix = idk what to put here
if (phoenix.isOwner(mp)) {
mp.setHealth(1.0F);
mp.addPotionEffect(new PotionEffect(MobEffects.REGENERATION, 900, 1));
mp.addPotionEffect(new PotionEffect(MobEffects.ABSORPTION, 100, 1));
world.playSound(mp, mp.getPosition(), SoundEvents.ITEM_TOTEM_USE, mp.getSoundCategory(), 1, 1);
}
}
}
}
}
In my mod I have an entity that is meant to work as a totem of undying preventing his owner's death once and after that becoming a common parrot, the problem here is that I couldn't find the functionality of the totem anywhere so I do not know how could I do this. Any help would be appreciated.
protected void castSpell() {
EntityZombie zombie = new EntityZombie(Iceologer.this.world);
float range = 15F;
Iceologer.this.world.getEntitiesWithinAABB(EntityPlayer.class);
Iceologer.this.world.spawnEntity(zombie);
player.getPositionVector();
}
zombie is a placeholder til I fix the iceCloud
I need to fix get Entities WIthinAABB & getPositionVector
So basically I'm trying to make Iceologer for 1.12.2, I want to get the Iceologer to summon the Ice Cloud Above the player (like 2 or 3 blocks above it), any help would be great.
0
Hello guys!
I'm trying to prevent the player death if it has a tamed phoenix, but I have no idea on how to make the event detect it.
Any help would be appreciated.
Here's my code:
0
Thank you
0
In my mod I have an entity that is meant to work as a totem of undying preventing his owner's death once and after that becoming a common parrot, the problem here is that I couldn't find the functionality of the totem anywhere so I do not know how could I do this. Any help would be appreciated.
0
Oh, I got it, I never used getEntitiesWithinAABB before so I make things much complex than what I needed, Thanks for helping
.
0
Ok, so far I got this:
0
So basically I'm trying to make Iceologer for 1.12.2, I want to get the Iceologer to summon the Ice Cloud Above the player (like 2 or 3 blocks above it), any help would be great.