Posted June 9, 20205 yr I've a custom version of the Entity.handleWaterMovement in a custom entity for testing, and is working on that entity. Now, I want that all entities in game(or maybe just LivingEntity) use this new function instead of the vanilla version. For my custom entities a very bad solution is to copy-paste that code, but for vanilla... Is there a way? The code aim to enable water movement to a custom fluid checking for its tag. The rest of the functioon is unalterated for the moment. public boolean handleWaterMovement() { ResourceLocation customFluidTag = new ResourceLocation(MyMod.MOD_ID, "cust_fluid"); if (this.getRidingEntity() instanceof BoatEntity) { this.inWater = false; } else if (this.handleFluidAcceleration(FluidTags.WATER) || this.handleFluidAcceleration(FluidTags.getCollection().getOrCreate(customFluidTag))) { if (!this.inWater && !this.firstUpdate) { this.doWaterSplashEffect(); } this.fallDistance = 0.0F; this.inWater = true; this.extinguish(); } else { this.inWater = false; } return this.inWater; } Edited June 12, 20205 yr by Slexom Edited My mod: Earth2Java - Mobs [1.15.2]
June 13, 20205 yr Howdy I'm assuming that you don't want to add your custom fluid to the vanilla "water" Tag, then? (i.e. like this https://github.com/TheGreyGhost/MinecraftByExample/tree/master/src/main/java/minecraftbyexample/mbe35_recipes) If not - I don't think there is an easy way, no. I don't have experience with this recently but the two key words that might be worth searching for are "coremod" and "asm" They will let you overwrite parts of the vanilla Entity::handleWaterMovement code. It's a bit arcane and can be rather brittle but might be your only choice. Cheers TGG
June 13, 20205 yr Author A little bit exaggerated for half line of code. I'll put my fluid back on the water tag and fix what broke(fog color, lava interaction, etc.). Thank you for your reply. My mod: Earth2Java - Mobs [1.15.2]
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.