- 21
- 1
Имеется итем, при нажатии на который, вылетает голова иссушителя. Если в привате выстрелить в игрока, происходит взрыв, и игрока откидывает. Как отменить взрыв, либо откидывание?
Код:
public void onPlayerStoppedUsing(ItemStack par1ItemStack, World world, EntityPlayer entityplayer, int par4) {
par1ItemStack.damageItem(27, entityplayer);
entityplayer.addExhaustion(5.0F);
world.playSoundAtEntity(entityplayer, "random.bow", 0.5F, 0.4F / (Item.itemRand.nextFloat() * 0.4F + 0.8F));
if(!world.isRemote) {
Vec3 look = entityplayer.getLookVec();
EntityWitherSkull fireball2 = new EntityWitherSkull(world, entityplayer, 1.0D, 1.0D, 1.0D);
fireball2.setPosition(entityplayer.posX + look.xCoord * 1.0D, entityplayer.posY + look.yCoord + (double)entityplayer.getEyeHeight() - 0.10000000149011612D, entityplayer.posZ + look.zCoord * 1.0D);
fireball2.accelerationX = look.xCoord * 0.1D;
fireball2.accelerationY = look.yCoord * 0.1D;
fireball2.accelerationZ = look.zCoord * 0.1D;
world.spawnEntityInWorld(fireball2);
}
}