Skip to content
Nicholas Kreimeyer edited this page Nov 4, 2026 · 1 revision

Since 4.0, other mods can add their own turrets to Open Modular Turrets, on Fabric, NeoForge and Forge. An added turret is a full turret: it mounts on a base, uses the base's targeting, energy, ammo, upgrades, addons and trusted players, gets its own config entry and shows up in the OMT creative tab, tooltips and Jade. The 14 built-in turrets are registered through the same API.

The full developer documentation with code examples is in the repository: docs/turret-api.md.

Overview

  1. Register the turret in a plugin class implementing OMTPlugin:

    • Fabric: an openmodularturrets entrypoint in fabric.mod.json.
    • NeoForge / Forge: annotate the class with @OMTPlugin.Register.
  2. Describe it with TurretType.builder("yourmod", "your_turret"): minimum base tier, ammo, targeting priority weights (see Targeting System), allowed faces, whether it ignores Scatter Shot or skips slowed targets.

  3. Give it a weapon:

    Weapon Does Built-in examples
    ProjectileWeapon spawns a projectile per shot, aimed with lead gun, rocket, plasma
    RayWeapon instant ray to the target laser, rail gun, arc
    EffectWeapon runs an effect on the base's target slowing, teleporter
    AreaWeapon hits every entity in an area melee
    SelfTargetingWeapon picks its own targets –

    Hooks such as onHit, onEntityHit and onBlockHit run your own code; OMTApi.canDamage / OMTApi.hurt apply the base's trust rules and count kills.

  4. Provide default stats with TurretStats.builder(...); they become the entry under turrets.addon_turrets in the Configuration.

  5. Register a model on the client with OMTClientPlugin (openmodularturrets_client entrypoint, or @OMTClientPlugin.Register).

  6. Ship the assets and data in your own namespace: blockstate, item model, lang keys, loot table and recipe.

Clone this wiki locally