Posted December 4, 20222 yr I tried to make a projectile that put water on nearby it falls. I just need that water source pop and directly disapear. I do : Spoiler @Override public void onHitBlock(BlockHitResult blockHitResult) { super.onHitBlock(blockHitResult); if (level instanceof ServerLevel _level){ FallingBlockEntity waterfall = FallingBlockEntity.fall(_level, new BlockPos(blockHitResult.getBlockPos().getX(), blockHitResult.getBlockPos().getY()+1, blockHitResult.getBlockPos().getZ()), Blocks.WATER.defaultBlockState()); System.out.println("HI " + waterfall.getBlockX() + waterfall.getBlockY() + waterfall.getBlockZ()); if ((_level.getFluidState(new BlockPos(waterfall.getBlockX(), waterfall.getBlockY(), waterfall.getBlockZ())).createLegacyBlock()).getFluidState().isSource()) { System.out.println("I M WATER"); _level.removeBlock(new BlockPos(waterfall.getBlockX(), waterfall.getBlockY(), waterfall.getBlockZ()),false); _level.destroyBlock(new BlockPos(waterfall.getBlockX(), waterfall.getBlockY(), waterfall.getBlockZ()),false); } if ((_level.getFluidState(new BlockPos(waterfall.getBlockX(), waterfall.getBlockY(), waterfall.getBlockZ())).createLegacyBlock()).getFluidState().isSource()) { System.out.println("I M STILL WATER"); } } } ย Water appears but still remains despite removeBlock or DestroyBlock. Any idea ?
December 4, 20222 yr remove/destroyBlock() don't remove the fluid . Did you look at the code? ย Those methods are intended for things like breaking a waterlogged fence post. It will remove the post but leave the water behind. ย Try doing something like: Level.setBlockAndUpdate(pos, Blocks.AIR.defaultState()); Boilerplate: If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one. If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install Large files should be posted to a file sharing site like https://gist.github.comย You should also read the support forum sticky post.
December 5, 20222 yr Author Doesn't work ๐ย Water still there. But if i use Blocks.STONE.defaultBlockState()ย ...ย it works and change the source water by a Stone block immediately. I have tried to look inside BucketItem to look how it works when bucket is used but i don't understand how water disappear and is replaced by air on targeting pos ๐
December 5, 20222 yr That effectively uses LiquidBlock.pickupBlock() - assuming you are dealing with a LiquidBlock? That calls setBlock() with flags = 11 while setBlockAndUpdate() calls setBlock() with flags = 3 Which means it is setting the "UPDATE_IMMEDIATE" flag as well - see the Block class. I don't know what difference that makes? It's not a flag I am familiar with. Edited December 5, 20222 yr by warjort Boilerplate: If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one. If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install Large files should be posted to a file sharing site like https://gist.github.comย You should also read the support forum sticky post.
December 5, 20222 yr You know when you create a falling block the actual fall will be delayed to later processing? So, it could be you are setting the block to air, then on a later tick the block is failling and creating the source block. Setting the block to stone would likely stop the falling block from creating the source block? Probably it tries to spawn the ItemEntity drop for water which doesn't have one. Edited December 5, 20222 yr by warjort Boilerplate: If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one. If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install Large files should be posted to a file sharing site like https://gist.github.comย You should also read the support forum sticky post.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.