A small NeoForge mod for Minecraft 1.21.1 that fixes a bug in Create: Deep Seas (CDS) where players inside a hermetically sealed submarine still take fire/lava damage while the submarine is submerged in lava, even though CDS correctly empties the interior of lava.
> Author: Diyksfol
> License: MIT
> Note: This mod was developed with the help of an AI assistant; my own role was primarily that of a tester and director. The full source is provided here so anyone — including the Create: Deep Seas authors — may study, reuse, or integrate it.
In Create: Deep Seas, a sealed submarine can pump out all fluid (including lava) from its interior, letting you move around inside as if in open air. However, the game's damage code still applied fire/lava damage to players standing in that "emptied" space, because the damage checks did not account for the sealed sub.
This mod detects when a player is inside (or climbing out of) a sealed compartment and suppresses the fire/lava damage and the on-screen fire overlay in that case.
These behaviours are internal to Create: Deep Seas. Fixing them from an external mod would require overriding core CDS systems and risks breaking the sealed-sub mechanic itself, so they are intentionally left alone:
If the Create: Deep Seas authors wish to address any of the above, they are welcome to use this code as a starting point.
submarinefix-1.0.1.jar into your mods/ folder.The mod is safe to install even without Create: Deep Seas — it simply does nothing in that case.
This repository contains the uncompiled source. To build the jar yourself:
Clone this repository: https://github.com/Diyksfol/create-deep-seas-lava-fix
Create a libs/ folder in the project root and place two jars in it:
create_submarine-2.1.6.jar — from your Create: Deep Seas download.sable-companion-common-1.21.1-1.5.0.jar — extracted from the CDS jar's META-INF/jarjar/ folder (CDS bundles it).Your build.gradle already references these via compileOnly files(...):
compileOnly files('libs/create_submarine-2.1.6.jar')
compileOnly files('libs/sable-companion-common-1.21.1-1.5.0.jar')
If your CDS version differs, update the filenames in build.gradle accordingly.
./gradlew build
On Windows:
.\gradlew.bat build
build/libs/.> These jars are third-party and are intentionally not included in this > repository. You must supply them yourself from your own Create: Deep Seas install.
The fix combines several layers:
LivingIncomingDamageEvent (server, primary): cancels incoming LAVA / IN_FIRE / ON_FIRE / HOT_FLOOR damage when the player is inside a sealed compartment.Entity#baseTick mixin (server): suppresses the lavaHurt() call.LocalPlayer#baseTick mixin (client): suppresses the client-side lavaHurt() so no fire ticks are produced locally.ScreenEffectRenderer#renderFire mixin (client): hides the fire overlay while inside the sub.PlayerTickEvent.Post (server): clears any residual fire ticks each tick.To decide whether a player is "inside a sealed sub", the mod:
CompartmentTracker.getSubsSnapshot().getWorldAABB) doesn't contain the player.subLevelAccess.logicalPose().transformPositionInverse(...).Component's internal() and hull() sets from CompartmentTracker.getCompartments(uuid).This mirrors the internal logic CDS itself uses, but avoids the CDS public methods that only work when called from inside a sub-level.
If you find a compatibility issue with another mod, please open an issue.
Released under the MIT License. You are free to use, copy, modify, and redistribute this code, including in other projects or mods, provided the original attribution is retained. See LICENSE for the full text.
Anyone is welcome to reuse this code — including the authors of Create: Deep Seas, should they wish to integrate the fix directly.