-
Notifications
You must be signed in to change notification settings - Fork 3
Custom gas behaviour for your entities
There are 2 main ways of making Gaspunk's gases affect your entities differently.
If you just want to make your entities immune to gas, simply override the decreaseAirSupply
method in your entity, like iron golems do. This will also prevent your entity from drowning. You can also use this to make your entity's air supply drop faster both in water and in gases.
If you want more control, your entity can offer a custom IBreathingHandler. This capability handles everything gas-related on the entity's side. The default one is attached through the AttachCapabilitiesEvent
so any instance returned by an overriden getCapability
method in your entity will take precedence. This allows you full control over gas affecting your entities but requires that you setuo Gaspunk in your workspace.