Mods / Asphyxia (Gas API)

Category: #Other #Utility
Author: jakecool19
Side: Both
Created: Feb 5th at 2:48 AM
Last modified: Jun 30th at 7:10 PM
Downloads: 1441
Follow Unfollow 36

Ever felt weird being able to put multiple firepits in your enclosed home with no ill effects? Or mine an entire vein of brown coal maskless, without a single cough? With this offshoot of an offshoot, now air quality now has a big impact on you and other living creatures! This mod adds a semi-realistic gas simulation and offers a library that can be used by other mods.


New Mechanics!

Gases can come from a variety of interactions with the world and can have different effects and densities

Players and some mobs now need to breathe and exhale, with some creatures being aquatic

Gases can have toxic effects on entities that breathe them

Some gases when dissolved in liquids will lower their pH, corroding armor and damaging entities at high concentrations

Gases can be explosive and flammable gases burn entities that are in them if an explosion happens

Containers in spaces with poor air quality have lower perish rates



+ Carbon Dioxide: One of the most abundant gases, it is exhaled by breathing living things, and a common product of combustion. It is heavier than air and is absorbed by plants.

+ Carbon Monoxide: While being absorbed by plants and a byproduct of combustion, it is the polar opposite of it’s cousin carbon dioxide, carbon monoxide is extremely dangerous and can cause rapid asphyxiation at concentrations as little as 10%. Its toxic effects likewise further restrict the ability to breath, plus it is near the same density as air so it evenly distributes in a space. In an enclosed, poorly ventilated space, it can kill in seconds.

+ Silica Dust: Lots of this can get in the air when breaking rock or quartz. Makes it hard to catch your breath and takes a bit of wind to get rid of.

+ Coal Dust: Lots of this gets in the air when mining coal or messing with charcoal. Makes it hard to catch your breath and it is flammable and explosive in very high concentrations. Takes a bit of wind to get rid of.

+ Hydrogen Sulfide: A heavy gas produced when mining sulfide ores, while known for its repulsive odor at small concentrations it can be extremely toxic, flammable, and explosive at high concentrations. Its toxic effects cause sluggishness, reducing movement and mining, and making it hard to deal damage in combat. Can be absorbed by plants and takes a fair amount of wind to get rid of.

+ Sulfur Dioxide: A heavy gas produced when blowing up sulfide ores or burning hydrogen sulfide, this gas is toxic and acidic and can cause armor to take greater damage and lower your health. When dissolved in water, it will lower its pH, making it corrosive to armor and can even burn creatures at high concentrations in water. Takes a lot of wind to get rid of it.

+ Nitrogen Dioxide: A heavy gas produced from explosions and mining saltpeter, this gas is toxic and acidic and can cause you to take increased damage and weakens your body’s ability to heal. When dissolved in water, it will lower its pH, making it corrosive to armor and can even burn creatures at high concentrations in water. Takes a lot of wind to get rid of it.

+ Methane: An extremely explosive and light gas, often found when mining coal, this gas is a leading cause of coal mine explosions.


Config Options

Explosions: If enabled gas explosions can occur

FlammableGas: Whether entities will burn during an explosion in the presence of flammable gas

PickaxeExplosionChance: The chance for a pickaxe strike to spark explosive gases

ContainerBonus: Whether reducing air quality will lower perish rates for containers

Smoke: Toggles smoke for burning things

Acid: Toggles acidic liquids

Exhaling: Toggles exhaling gases for breathing entities

DefaultSpreadRadius: The default distance for gas to spread up to

SpreadGasonBreakChance: The chance gas spreads when a block is broken

SpreadGasOnPlaceChance: The chance gas spreads when a block is placed

UpdateSpreadGasChance: The chance gas spreads for a block update

AllowScuba: Toggles scuba equipment

AllowMasks: Toggles mask equipment

ToxicEffects: Toggles toxic gas effects

GasesEnabled: Disables most content for that mod, can still be used by other mods though

GasesDebugEnabled: Toggles debug mode, with this mode on, see gas concentrations on block descriptions

BreathingEnabled: Whether breathing is enabled for entities other than the player

PlayerBreathingEnabled: Whether player breathing is enabled.


Library For Modders
This mod is hopefully built to be as compatible with other mods as possible. If you are interested in creating your own gas or using the system for other purposes please take a look at the README in the Github repository. It contains information for both content and code modders wanting to use this.

Version For Game version Downloads Release date Changelog Download
v1.0.4 334 Jun 30th at 7:10 PM Show
v1.0.3 62 Jun 30th at 6:46 PM Show
v1.0.2 581 Feb 28th at 3:46 AM Show
v1.0.1 236 Feb 16th at 1:48 AM Show
v1.0.0 228 Feb 7th at 4:18 AM Show

11 Comments (oldest first | newest first)

💬 LOVEINJECTION, 6 days ago

they said i was crazy when i insisted on making chimneys and smokestacks for all of my fireplaces & stoves

💬 Cofet, Sep 5th at 3:39 AM

very cool

💬 Kirona, Jul 25th at 10:05 PM

I'm getting a weird bug with this mod enabled, where a strip of the hotbar UI can't be clicked or interacted with. The area marked in a red rectangle in this image is completely blocked from cursor interaction.

Not too surprisingly, this area is the exact size and shape as the air/breathing bar, so I'm guessing that's related.

💬 OmegaHaxors, Jul 14th at 11:42 AM

Add a rare chance for entities to emit methane.
Yes, this is a fart joke.

💬 WickedSchnitzel, May 16th at 7:49 PM

Could you add an option to the config to set up the duration until players run out of air underwater?

Oh and if i switch to spectator mode, the air bar wont disappear like the rest of the HUD. Not good for doing screens.


💬 macoto_hino, Apr 13th at 6:03 AM

@dannyb3001 Gas masks are in another mod, "Useful Stuff"!😀

@jakecool19 There is a chimney for vanilla creative items that emits smoke, but it is just an ornament and does not exhaust air.
It would be nice to have a properly functioning chimney to keep the interior sealed, while allowing smoke from bonfires, etc. to exit the room.🤣

💬 dannyb3001, Mar 29th at 4:02 AM

Is there any way to counter the effects of gas, like masks?

💬 YourCreator, Feb 10th at 6:53 PM

Cool, but sill hard for server use cause optimization =( 
I setup that, but later removed...😑

💬 jakecool19, Feb 8th at 4:04 AM

If you open up the json file for the pet there should be a behavior in the server side called "breathe". Removing that should fix it.

💬 Rayle, Feb 7th at 11:00 PM

I love this! Toxic and flammable gasses are a real concern in mines and its exciting to have them in VS now. I only have one problem and it's not directly the fault of this mod either: I use the Wolf Taming mod and my tamed wolf constantly gets its face stuck in the ground and suffocates. I want to keep the breathing mechanic enabled for all creatures except tamed ones. Is that something that is possible? The wolf mod allows the tamed wolf to respawn after 24 hours so it's not the end of the world, but it does suffocate pretty often so it would be great if there was a way to disable the need to breathe for only tamed creatures. Love your mods and I look forward to what else you come up with!

💬 YourCreator, Feb 7th at 1:50 PM

Its very nice think for slice mods. 

(edit comment delete)