Gun Mod Systems & Comparisons

How Bedrock Gun Add-Ons Work: Item Components vs Script API

Understand the two technical engines behind Minecraft Bedrock gun add-ons -- pure JSON Item Components (minecraft:shooter) vs JavaScript Script API (@minecraft/server) -- and why they play so differently.

The Two-Pack Blueprint of Every Bedrock Gun Add-On

Every Bedrock gun add-on is a coordinated pair of packs linked by matching UUIDs in their manifest.json files. The Behavior Pack (BP) defines the item identifiers (items/*.json), projectile entities (entities/*.json), crafting recipes, and optional JavaScript code (scripts/main.js). The Resource Pack (RP) handles everything the player sees and hears: 3D Blockbench .geo.json models (models/entity/), attachables/*.json, animations, inventory icons mapped in textures/item_texture.json, and gunshot audio in sounds/sound_definitions.json.

What separates simple crossbow-style gun add-ons from tactical 3D shooters with magazines, ADS zoom, and full-auto fire is whether the Behavior Pack relies solely on JSON Item Components or runs custom logic through Bedrock's Script API.

Approach 1: Pure JSON Item Component Guns (`minecraft:shooter`)

Pure JSON gun add-ons require zero JavaScript and zero Beta APIs. They build weapons using official Bedrock item components: minecraft:shooter (requires format_version >= 1.20.10), paired with minecraft:use_modifiers (requires format_version >= 1.20.50, replacing legacy chargeable), minecraft:cooldown, and minecraft:durability.

For a minecraft:shooter gun to fire, every listed ammunition item must itself include the minecraft:projectile component pointing to a projectile_entity. Because minecraft:shooter behaves fundamentally like a bow or crossbow under the hood, pure JSON guns work cleanly on Realms and survive most Bedrock updates intact, but they cannot natively track magazine counters, realistic vertical recoil kicks, or true hitscan raycasting.

// Pure JSON Bedrock Behavior Pack item snippet (format_version 1.20.50+)
"components": {
  "minecraft:max_stack_size": 1,
  "minecraft:use_modifiers": {
    "use_duration": 0.25,
    "movement_modifier": 0.85
  },
  "minecraft:cooldown": {
    "category": "rifle_fire",
    "duration": 0.2
  },
  "minecraft:shooter": {
    "ammunition": [
      {
        "item": "demo:rifle_ammo",
        "use_offhand": true,
        "search_inventory": true,
        "use_in_creative": true
      }
    ],
    "max_draw_duration": 0.2,
    "scale_power_by_draw_duration": false,
    "charge_on_draw": false
  }
}

Approach 2: Script API (`@minecraft/server`) Gun Add-Ons

Modern high-end Bedrock gun add-ons declare a "type": "script" module with "entry": "scripts/main.js" and depend on @minecraft/server (and often @minecraft/server-ui for attachment or weapon bench menus) inside the Behavior Pack's manifest.json.

With JavaScript running directly on the Bedrock server tick loop, creators unlock full shooter mechanics that pure JSON cannot replicate:

  • True full-auto and burst fire: Listening to item start/stop use events and firing rounds on exact tick intervals while the player holds the trigger.
  • Instant raycasting & headshots: Calling getEntitiesFromViewDirection() and getBlockFromViewDirection() to compute crisp hitscan bullets, headshot distance multipliers, and wall-impact particles without projectile entity lag.
  • Magazines and tactical reloads: Storing current magazine counts inside item dynamic properties or lore text, blocking fire at zero rounds, and triggering reload timers when sneaking or using a magazine item.
  • ADS zoom, camera recoil, and HUD actionbars: Applying subtle camera pitch kicks or slowness FOV zoom while displaying live ammo counters (30 / 120) above the hotbar.

Item Components vs Script API: Side-by-Side Comparison

Neither approach is universally superior -- the best choice depends on whether you prioritize long-term version stability or tactical shooter depth:

FeaturePure JSON Item ComponentsScript API (@minecraft/server)
Firing FeelBow/crossbow draw-release or single-click projectile launchTrue semi-auto, burst, and high-RPM full-auto
Magazine & ReloadingConsumes loose ammo directly from inventoryFull magazine counter, reload animations, empty-mag lock
Ballistics & HeadshotsCustom entity projectiles (can feel floaty at range)Hitscan raycasting or hybrid projectiles + headshot detection
Attachment / Shop MenusCrafting tables onlyInteractive UI popups via @minecraft/server-ui
Update Breakage RiskLow (stable JSON schemas)Medium to High if using -beta module versions instead of stable releases
Experimental Toggles NeededNone on modern 1.20.50+ schemasNone for stable @minecraft/server releases; Beta APIs required for -beta builds

How 3D Bedrock Gun Models Render With Attachables

Whether a gun uses JSON components or Script API, its 3D model is rendered by the Resource Pack's attachables/ folder. An attachable file binds the custom item identifier to a Blockbench geometry.<gun> mesh, texture, and Molang animation scripts (such as context.is_first_person == 1.0 for first-person viewmodels vs 0.0 for third-person holding poses).

Inventory icons are mapped separately in textures/item_texture.json, which is why a misconfigured Resource Pack can show a working 2D hotbar icon while rendering an invisible or misplaced 3D gun in hand (or vice versa).

  1. Download a complete .mcaddon (or matching Behavior Pack + Resource Pack .mcpack pair) built for Minecraft Bedrock Edition.
  2. Import the file into Minecraft Bedrock and activate both the Behavior Pack and Resource Pack on the same world.
  3. Open World Settings -> Experiments and enable only the toggles required by the add-on manifest (such as Beta APIs if the pack includes Script API modules).
  4. Test firing, reloading, and third-person rendering in creative mode before enabling the pack on a shared Realm or dedicated Bedrock server.

Common Mistakes & Fixes

  • Using `minecraft:shooter` Without `minecraft:use_modifiers`: Bedrock requires minecraft:use_modifiers on any item with minecraft:shooter, and requires minecraft:projectile on every ammo item it references. Missing either component silently disables firing.
  • Pinning a Script API Add-On to a Mismatched `@minecraft/server` Version: If a gun add-on stops working after a Bedrock update, check manifest.json under dependencies for @minecraft/server versions ending in -beta. Wait for an add-on update or migrate scripts to stable API versions.
  • Broken `attachables` Bone Binding or Missing Texture Paths: If your 3D gun floats behind the player or turns magenta-and-black, verify the bone binding (q.item_slot_to_bone_name(context.item_slot)) in .geo.json and confirm exact paths in attachables/ and item_texture.json.
  • Relying on Removed Legacy Holiday Creator Features: Old pre-1.20.50 Bedrock gun add-ons built around removed Holiday Creator Features components (minecraft:chargeable, legacy item events) no longer load on modern Bedrock releases. Look for updated 1.20.50+ or 1.21+ add-ons.

Frequently Asked Questions

Why do some Bedrock gun add-ons require Beta APIs while others work with zero experiments?

Add-ons using only stable @minecraft/server releases or pure JSON components run without experimental toggles. Add-ons that depend on bleeding-edge -beta Script API features require turning on Beta APIs in World Experiments.

Why do Script API gun add-ons sometimes stop working after a Minecraft Bedrock patch?

Major Bedrock patches occasionally revise -beta JavaScript APIs or bump module version numbers. Creators must update manifest.json and deprecated method calls to restore compatibility.

Can a Bedrock gun add-on have 3D scopes and reload animations without Script API?

Basic 3D models and draw animations work in pure JSON via attachables and Molang queries, but true multi-stage tactical reloads, magazine HUDs, and full-auto fire almost always require Script API.

How can I preview a Bedrock add-on's 3D `.geo.json` weapon models before installing?

Upload or browse compatible models in the site's 3D Gun Viewer to inspect geometry, bone counts, and textures right in your browser.

Related Tools & Guides