Hi everyone, I want to identify where water and I have a BlockPos, but it doesn't work:
@SubscribeEvent
public static void livingDropsEvent(ItemTossEvent e) {
Utils.getLogger("FMHammers").info("1");
if (e.getEntityItem().getEntityItem().getItem() == ModItems.moltenDuctTape) {
Utils.getLogger("FMHammers").info("2");
World world = e.getEntity().getEntityWorld();
Block srcBlock = world.getBlockState(e.getEntity().getPosition()).getBlock();
BlockPos pos = e.getEntity().getPosition();
EntityItem item = new EntityItem(world, pos.getX(), pos.getY(), pos.getZ(), new ItemStack(ModItems.ductTape));
if (srcBlock.equals(Blocks.WATER)) {
Utils.getLogger("FMHammers").info("3");
e.getEntity().setDead();
world.spawnEntity(item);
world.playSound(pos.getX() + 0.5D, pos.getY() + 1.0D, pos.getZ() + 0.5D, SoundEvents.BLOCK_FIRE_AMBIENT, SoundCategory.AMBIENT, 1.0f, 1.0f, true);
world.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, pos.getX() + 0.5D, pos.getY() + 1.0D, pos.getZ() + 0.5D, 0.0D, 0.0D, 0.0D, new int[0]);
}
}
}
HELP ME PLS