-
Notifications
You must be signed in to change notification settings - Fork 1
Addon Development
alepik387 edited this page Aug 4, 2026
·
3 revisions
Guide for mods that extend Endless Gravity's mechanics. Since 1.1.0 the mod exposes a static API (EndlessGravityAPI) and datapack tags instead of cancellable events.
- Enchantments that reduce, cancel, or amplify gravity
- Armor that makes the wearer immune to gravity
- Items that interact with low-gravity physics
- Custom entities that float or behave differently in The End
- Custom dimensions that reuse the atmosphere pressure curve
Make a custom entity ignore low gravity in The End via a datapack tag — create data/mymod/tags/entity/gravity_immune.json (with endless_gravity as a dependency):
{
"replace": false,
"values": [
"mymod:my_floating_creature"
]
}Or check the tag at runtime:
boolean immune = EndlessGravityAPI.isGravityImmune(entity);React to the pressure curve for your own mechanics (e.g., a magic spell that strengthens with altitude):
double progress = EndlessGravityAPI.getAtmosphereProgress(player.getY());
if (progress > 0.5) {
// in the upper atmosphere — boost your effect
}If your mod works inside Sable sub-levels, project coordinates to global space:
double globalY = EndlessGravityAPI.getRealY(entity);Apply gravity yourself for a custom dimension — Endless Gravity only affects The End (low gravity) and the Overworld/Sable (atmosphere):
NeoForge.EVENT_BUS.addListener(EntityTickEvent.Pre.class, event -> {
Entity entity = event.getEntity();
if (entity.level().dimension() == MY_CUSTOM_DIMENSION) {
entity.setDeltaMovement(entity.getDeltaMovement().add(0, 0.03, 0));
}
});Read the effective (server-synced) config values from Config.COMMON:
import dinner.dev.endless_gravity.Config;
double maxGravity = Config.COMMON.atmosphereGravityMax.get();
double endOffset = Config.COMMON.playerGravityOffset.get();-
EndlessGravityAPImethods are safe to call on any thread; they never touch the config screen - All API reads are cheap — they are pure lookups against the configured curve
- Add
endless_gravityto yourneoforge.mods.tomldependencies if you compile against the API - The
gravity_immunetag is an entity type tag — immunity is per entity type, not per instance