Posted January 31, 20223 yr Hello, For my mod, I'm interested in adding a custom type of "storm". It would purely be a visual effect and does not need to impose any of the other effects that come from rain (e.g. putting out fires). What would be the best option? I haven't found any other examples of this online. My current approach is to spawn a bunch of Minecraft "RAIN" particle in a radius around the player - but to create an effective result I feel I will need to add a large number of particles and worry that would introduce lag. Thanks for any help. My current experimental implementation piggybacks off one of my crop entities to spawn particles around each player in the world - but I'm still just testing things out. @Override public void animateTick(BlockState p_180655_1_, World world, BlockPos p_180655_3_, Random p_180655_4_) { super.animateTick(p_180655_1_, world, p_180655_3_, p_180655_4_); for (PlayerEntity p : world.players()) { Vector3d position = p.getPosition(0); BlockPos blockPos = new BlockPos(position); // Instead of using directions, randomly spawn particles in a zone around the player for (Direction dir : Direction.values()) { BlockPos bpO = blockPos.relative(dir); for (Direction d2 : Direction.values()) { BlockPos bp = bpO.relative(d2); world.addParticle(ParticleTypes.RAIN, bp.getX(), bp.getY() + 1, bp.getZ(), 0.0D, 0.0D, 0.0D); } } } } Edited January 31, 20223 yr by bradsk88
February 12, 20223 yr Author Figured it out. TLDR Enqueue work in FMLClientSetupEvent In that work, grab the Overworld's DimensionRenderInfo and call setWeatherRenderHandler on it with your custom renderer. In the renderer, copy the minecraft rain code and: Provide your own ResourceLocation for RAIN_LOCATION Remove the "-" from f3 value (I also multiplied it by 0.2 to slow down the rain) Source https://github.com/bradsk88/EurekaCraft/compare/4cfd071e8f5079184fb9be6a69b4316ce76c2d46...d13be10e423955eb4341f05ec94d46865adb1436
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.