Skip to content

Registry Reference

ModularShoot stores all definitions in 6 dynamic registries (DataPackRegistry). All support /reload hot-reload and client sync.

Registry Overview

Registry IDPurposeValue Type
modularshoot:gunsGun definitionsGunDefinition
modularshoot:pluginsPlugin definitionsPluginDefinition
modularshoot:plugin_typesPlugin type (category) definitionsPluginTypeDefinition
modularshoot:traitsBoolean trait definitionsTrait
modularshoot:attribute_metaAttribute metadataAttributeMeta
modularshoot:statesPersistent state definitionsStateDefinition

Attribute bodies (Attribute instances) are not in these dynamic registries — register them using vanilla DeferredRegister into BuiltInRegistries.ATTRIBUTE. The metadata table stores only defaults, display info, and bindings.

Gun Definition (GunDefinition)

Registry: modularshoot:guns

FieldTypeRequiredDefaultDescription
nameOptional text stringNoNone (falls back to gun ID path)Display name. Supports § color codes and lang: translation key prefix
textureResource pathYesGun base texture path, rendered using vanilla item pipeline with 3D-ification
shootTextureOptional resource pathNoNone (always uses base texture)Texture swapped to while firing
shootTextureModeEnumNoPER_SHOTTexture swap timing. Only effective when shootTexture is specified
statsAttribute ID → decimal mapNoEmpty mapAttribute base values. Keys must include full namespace (e.g. modularshoot:hit_damage). Unspecified attributes use the metadata table default
traitsTrait ID → boolean mapNoEmpty mapGun inherent trait overrides. Gun-declared traits always override all plugins
slotsPlugin type ID → integer mapNoEmpty mapPlugin slot configuration. Key is plugin type ID, value is slot count
soundsString → resource path mapNoEmpty mapSound bindings. Predefined slot: shoot (firing sound). Custom slot names supported
bulletStyleOptional bullet styleNoNone (pure collision body, no render object)Bullet visual appearance config

BulletStyle

FieldTypeRequiredDefaultDescription
modelString → resource path mapYesRender resources. Conventional keys: "3d" → vanilla static JSON model path, "billboard" → texture path. Recommend providing both
renderModeEnumYesRender mode: BILLBOARD (2D sprite always facing viewer) or THREE_D (vanilla static 3D model)

ShootTextureMode

Enum ValueDescription
PER_SHOTSwap to shoot texture on every shot, snap back immediately after. High-rate weapons will flicker
WHILE_FIRINGHold shoot texture while trigger is pressed, revert on release. Best for full-auto to avoid flicker

Plugin Definition (PluginDefinition)

Registry: modularshoot:plugins

FieldTypeRequiredDefaultDescription
tagsList of resource pathsNoEmpty listMatching tags. Install requires intersection with a type's tags. Empty list prevents installation (logs WARN)
priorityIntegerNo0Trait conflict priority, higher wins. Does not inherit type priority
itemIconResource pathYesPlugin icon texture shown in inventory/hotbar
modifiersList of modifiersNoEmpty listAttribute modifier array. Applied to gun on installation
traitsTrait ID → boolean mapNoEmpty mapTrait overrides provided after installation
exclusiveGroupOptional text stringNoNoneMutual exclusion group ID. Two plugins with the same group ID cannot coexist on the same gun
bulletStyleOptional bullet styleNoNoneBullet style override. Replaces gun-defined style on install. Full replacement, not field-level merge
textureOverlayOptional texture overlayNoNoneTexture overlay info. Layers stacked over the gun's base texture after install
nameOptional text stringNoNonePlugin display name. Supports § color codes
briefOptional text stringNoNoneOne-line summary. Shown in default tooltip level
descriptionOptional text stringNoNoneMulti-line detailed description. Shown in Shift tooltip level
colorOptional text stringNoNonePlugin name color (e.g. #FF4444)

Modifier (PluginModifier)

FieldTypeRequiredDefaultDescription
attributeText stringYesTarget attribute name. If no namespace, defaults to modularshoot namespace
operationEnumYesOperation type: ADD (additive), MULTIPLY (base multiplier), MULTIPLY_TOTAL (final multiplier)
valueDecimal numberYesModifier numeric value

Texture Overlay (TextureOverlay)

FieldTypeRequiredDefaultDescription
textureResource pathYesOverlay texture path layered onto the gun texture
layerIntegerYesZ-order, higher renders on top. Same layer: later-installed covers earlier

Plugin Type Definition (PluginTypeDefinition)

Registry: modularshoot:plugin_types

FieldTypeRequiredDefaultDescription
tagsList of resource pathsNoEmpty listMatching tags. Install requires intersection with a plugin's tags. Empty list matches nothing (logs WARN)
priorityIntegerNo0Display priority (tooltip sort order) + install auto-select secondary sort key. Does not affect plugin trait conflict priority
nameOptional text stringNoNoneType display name
colorOptional text stringNoNoneType name color (e.g. #FFAA00)

Trait Definition (Trait)

Registry: modularshoot:traits

FieldTypeRequiredDefaultDescription
defaultValueBooleanYesDefault trait value when not declared by the gun
descriptionText stringNo"" (empty string)Description text
nameOptional text stringNoNone (falls back to trait ID path)Trait display name. Supports § color codes and lang: translation key prefix
colorOptional text stringNoNoneTrait name color (e.g. #FF8800)
briefOptional text stringNoNoneOne-line summary. Shown in Alt tooltip level
forceShowBooleanNofalseForce display. When true, shown in tooltip regardless of value
priorityIntegerNo0Display priority, higher sorts first

Runtime behavior (hook callbacks) is not stored in the Trait definition. Register it separately via registerTraitHook API.

Attribute Metadata (AttributeMeta)

Registry: modularshoot:attribute_meta

FieldTypeRequiredDefaultDescription
bindsResource pathYesPoints to a registered vanilla Attribute ID. Framework resolves the Attribute holder through this field at runtime. Preset attributes have logical ID = body ID, binds points to self
defaultValueDecimal numberYesGun base value when not declared by the gun (participates in ADD_VALUE calculation). Hot-reloadable. Not the vanilla Attribute's base (which is always 0)
descriptionText stringNo"" (empty string)Description text
colorText stringNo"" (empty string)Attribute name color (e.g. #FF4444)
priorityIntegerNo0Display priority, higher sorts first
forceShowBooleanNofalseForce display. When true, shown in tooltip even if value equals default

If the binds target attribute is not registered: metadata entry is retained but modifier won't mount, tooltip won't show, reads return 0.

State Definition (StateDefinition)

Registry: modularshoot:states

FieldTypeRequiredDefaultDescription
domainEnumYesOwnership domain. GUN (per-gun, persisted in gun NBT), PLAYER (per-player, persisted via AttachmentType), BULLET (per-bullet, lifetime only, not persisted)
valueTypeEnumYesValue type. INT / LONG / DOUBLE / FLOAT / BOOLEAN / STRING / UUID
defaultValueObjectNoZero value for the typeInitial value. Type must match valueType. Used when per-gun/per-player first accessed
displayState displayYesDisplay metadata object

State Display (StateDisplay)

FieldTypeRequiredDefaultDescription
nameText stringYesState name in tooltip. Supports § color codes and lang: translation key prefix
colorText stringYesName color (e.g. #FFAA00)
formatText stringNo"{value}"Display template with {value} placeholder. E.g. "{value} kills" → tooltip shows Kill Count: 3 kills
priorityIntegerNo0Tooltip sort order, higher sorts first
hideDefaultBooleanNofalseWhen true, the line is hidden if the value equals the default

Released under the MIT License