Skip to content

Equipment Configuration

tahmid-23 edited this page Jul 7, 2022 · 4 revisions

Directory Format

Equipment is stored under ./equipment/. Under ./equipment/, there is a subfolder for each gun type.

Minecraft Object Serialization

Certain Minecraft objects are serialized within files.

Component

Components are serialized with MiniMessage.

Sound

key: The Minecraft key of the sound.
source: The Source of the sound. (MASTER, MUSIC, RECORD, WEATHER, BLOCK, HOSTILE, NEUTRAL, PLAYER, AMBIENT, VOICE).
volume: The volume of the sound.
pitch: The pitch of the sound.

Item Stack

Item stacks are serialized with SNBT (String NBT).

Potion

effect: A Minecraft Key of the potion effect.
amplifier: An amplifier for the potion.
duration: The duration of the potion (I think in seconds, whatever the /effect command in Minecraft uses).

Guns

Directory Format

Guns are stored under ./equipment/guns/.
Each folder in this directory is a gun.
The structure of the folder looks like:

\---Gun Folder
    |   info.yaml
    |
    \---levels
            level0.yaml
            level1.yaml
            ...

info.yaml

info.yaml should contain a Key called name which represents the unique name for the gun.

Levels

Gun level files should be inside the levels directory. These files may have any name but should end in .yaml
The level file should contain a Key called mainKey which represents the key for the gun level. Gun level keys should not clash with each other.
The level file should then contain a table for each of the objects related to the gun level. One table should be the gun level data table. The name of the table should be the same as the mainKey defined at the top of the file.

Objects

Every object is in the format of a YAML object. Every object has a serialKey that specifies the type of the object. The name of the YAML object is considered its Key. When referencing other objects, use the name of the corresponding YAML table. The format of a Key is namespace:value. If you leave namespace: blank, the namespace will be set to phantazm by default. Serial keys listed in the objects implicitly have the namespace phantazm if no namespace is specified.

General

Gun Level Data

General data for a gun level. Serial Key: gun.level
order: The numerical level of the gun. Each gun file should have a different numerical level. Levels start at 0. These levels must be continuous or the config will not be parsed.
stack: SNBT for the gun's item stack.
stats: A Key to the gun's stats.
shootTester: A Key to the gun's shoot tester.
reloadTester: A Key to the gun's reload tester.
firer: A Key to the gun's firer.
shootEffects: An array of effects to execute when a gun is shot.
reloadEffects: An array of effects to execute when a gun is reloaded.
tickEffects: An array of effects to execute every gun tick. While other effects may be updated by ticks, these effects should be specifically executed on ticks. Certain effects lend themselves to being tick effects.
noAmmoEffects: An array of effects to execute when a gun has no more ammo.

Gun Stats

General stats for a gun.
Serial Key: gun.stats
shootSpeed: The number of ticks between shots. A gun may fire multiple times per shot.
reloadSpeed: The number of ticks it takes for the gun to reload.
maxAmmo: The max ammo for the gun.
maxClip: The max clip for the gun.
shots: The number of shots to fire each time the gun shoots.
shotInterval: The number of ticks between individual shots every time a gun shoots. If the shotInterval is greater than the shootSpeed, a gun will not shoot again until the shotInterval time has elapsed. For guns that shoot only one bullet per shot, make sure shotInterval is sufficiently low.

Audience Providers

Entity Audience Provider

Provides the shooter itself.
Serial Key: gun.audience_provider.entity

Entity Instance Audience Provider

Provides the instance of the shooter. Use this if you want to play the sound to an entire world.
Serial Key: gun.audience_provider.entity_instance

Effects

Ammo Level Effect

Sets the player's level according to remaining ammo in a gun. This should typically be a tick effect.
Serial Key: gun.effect.level.ammo

Play Sound Effect

Plays a sound to the player.
Serial Key: gun.effect.play_sound
audienceProviderKey: A Key to the effect's audience provider
sound: The sound to play

Reload Action Bar Effect

Displays an action bar to the player as they reload. This should typically be a tick effect.
Serial Key: gun.effect.action_bar.reload
statsKey: A Key to the gun's stats.
reloadTesterKey: A Key to the gun's reload tester.
reloadActionBarChooserKey: A Key to this effect's reloadActionBarChooser.

Send Message Effect

Sends a message to the player.
Serial Key: gun.effect.send_message
message: The message to send.

Shoot Exp Effect

Sets the player's exp according to the time before they are able to shoot again. This should typically be a tick effect.
Serial Key: gun.effect.exp.shoot
statsKey: A Key to the gun's stats.

Reload Action Bar Choosers

Gradient Action Bar Chooser

Produces an action bar Component based on the progress of a gun's reload with a gradient over time.
Serial Key: gun.action_bar.chooser.gradient
message: The message to send in the action bar.
from: A hex string for the initial RGB color of the action bar.
to: A hex string for the final RGB color of the action bar.

Static Action Bar Chooser

Produces a static action bar Component.
Serial Key: gun.action_bar.chooser.static
message: The message to send in the action bar.

Reload Testers

State Reload Tester

Tests for reload ability based on state. Serial Key: gun.reload_tester.state
statsKey: A Key to the gun's stats.

Shoot Testers

State Shoot Tester

Tests for shoot ability based on state.
Serial Key: gun.shoot_tester.state
statsKey: A Key to the gun's stats.
reloadTesterKey: A Key to the gun's reload tester.

Endpoint Selectors

Basic Endpoint Selector

Finds the endpoint of a shot.
Serial Key: gun.end_selector.basic
blockIterationKey: A Key to the selector's block iteration method.
maxDistance: The maximum distance that a shot may travel.

Block Iterations

Ray Trace Block Iteration

Iterates blocks using raytracing.
Serial Key: gun.block_iteration.ray_trace

Wallshot Block Iteration

Similar to ray trace block iteration, but if the shot passes through a partial block, it accepts all later blocks. This concept can be used for a technique called wallshooting.
Serial Key: gun.block_iteration.wallshot

Firers

Hit Scan Firer

Firer that uses hit scan to shoot.
Serial Key: gun.firer.hit_scan
endSelectorKey: A Key to the firer's endpoint selector.
targetFinderKey: A Key to the firer's target finder.
shotHandlerKeys: An array of the firer's shot handlers.

Projectile Firer

Firer that uses a projectile to shoot.
Serial Key: gun.firer.projectile
endSelectorKey: A Key to the firer's endpoint selector.
targetFinderKey: A Key to the firer's target finder.
collisionFilter: A Key to the firer's collision filter.
shotHandlerKeys: An array of Keys to the firer's shot handlers.
entityType: A Minecraft Key of the entity type of the projectile.
power: A multiplier on the projectile's velocity.
spread: idk check a Minecraft wiki
hasGravity: Whether the projectile should have gravity as it travels.
maxAliveTime: The time after which the projectile should self-destruct if it has not collided.

Spread Firer

Firer that fires multiple firers.
Serial Key: gun.firer.spread
subFirerKeys: An array of Keys to the firer's sub-firers.
angleVariance: Variance in the angle of the firer's from the direction of the shot.

Projectile Collision Filters

Phantazm Projectile Collision Filter

A filter that only explodes when it comes into contact with an Entity if the entity is a Phantazm mob.
Serial Key: gun.firer.projectile.collision_filter.phantazm

Shot Handlers

Chain Shot Handler

A shot handler that fires a new shot.
Serial Key: gun.shot_handler.chain
finderKey: A Key to the shot handler's positional target finder. The firer will shoot in the direction of these targets.
firerKey: A Key to the firer for the shot handler.
ignorePreviousHits: Whether the shot handler should fire in the direction of previously hit targets.
fireAttempts: The number times the shot handler should attempt to fire at a new target.

Damage Shot Handler

Damages targets.
Serial Key: gun.shot_handler.damage
damage: Damage for regular targets.
headshotTarget: Damage for headshots.

Explosion Shot Handler

Makes an explosion at the endpoint of the shot.
Serial Key: gun.shot_handler.explosion
radius: The radius of the explosion.

Feedback Shot Handler

Sends a message to the player. Serial Key: gun.shot_handler.feedback
message: The message to send for regular hits.
headshotMessage: The message to send for headshots.

Guardian Beam Shot Handler

Sends a guardian beam in the direction of the shot. Serial Key: gun.shot_handler.guardian_beam
isElder: Whether the beam should be from an elder guardian.
beamTime: The duration of the beam in ticks.

Ignite Shot Handler

Sets targets on fire.
Serial Key: gun.shot_handler.ignite
duration: The duration of the fire for regular hits.
headshotDuration: The duration of the fire for headshots.

Knockback Shot Handler

Applies knockbacks to targets.
Serial Key: gun.shot_handler.knockback
knockback: Knockback for regular hits.
headshotKnockback: Knockback for headshots.

Particle Trail Shot Handler

Sends a trail of particles in the direction of the shot.
Serial Key: gun.shot_handler.particle_trail
particle: A key of the particle type. This is a Minecraft key.
distance: idk check a Minecraft wiki
offsetX: idk check a Minecraft wiki
offsetY: idk check a Minecraft wiki
offsetZ: idk check a Minecraft wiki
particleData: idk check a Minecraft wiki
count: idk check a Minecraft wiki
trailCount: The number of particles to send in the trail.

Potion Shot Handler

Applies a potion effect to a target.
Serial Key: gun.shot_handler.potion
potion: The potion to apply to regular targets.
headshotPotion: The potion to apply to headshots.

Sound Shot Handler

Plays a sound. As opposed to the play sound effect, this would typically be used to play a sound indicating headshot status.
Serial Key: gun.shot_handler.sound
audienceProviderKey: A key to the handler's audience provider.
sound: The sound to play for regular targets.
headshotSound: The sound to play for headshots.

Directional Entity Finders

Around End Directional Entity Finder

Finds entities around the end of a shot.
Serial Key: gun.entity_finder.directional.around_end
range: The range to find entities

Between Points Directional Entity Finder

Finds entities between the start and the end of a shot. Serial Key: gun.entity_finder.directional.between_points

Positional Entity Finders

Nearby Entity Positional Entity Finder

Finds nearby Entities.
Serial Key: gun.target.entity_finder.positional.nearby_entity

Headshot Testers

Eye Height Headshot Tester

Tests for headshots based on whether a shot pierced a target above its eye height.
Serial Key: gun.headshot_tester.eye_height

Static Headshot Tester

A headshot tester that always headshots or always does not headshot.
Serial Key: gun.headshot_tester.static
shouldHeadshot: Whether targets should be headshotted.

Intersection Finders

Ray Trace Intersection Finder

An intersection finder that conditionally finds an intersection with ray tracing.
Serial Key: gun.intersection_finder.ray_trace

Static Intersection Finder

An intersection finder that always shoots a given target through its center.
Serial Key: gun.intersection_finder.static

Target Testers

Phantazm Target Tester

A target tester that filters for Phantazm mobs.
Serial Key: gun.target_tester.phantazm
ignorePreviousHits: Whether the target tester should ignore previously hit mobs.

Target Limiters

Distance Target Limiter

A target limiter that chooses mobs to hit based on distance.
Serial Key: gun.target_limiter.distance
targetLimit: The maximum number of targets to hit.
prioritizeClosest: Whether closer targets should be prioritized (true) or farther targets should be prioritized (false).

Target Finders

Basic Target Finder

Finds targets for a Firer to shoot.
Serial Key: gun.target_finder.basic
entityFinderKey: A Key to the target finder's directional entity finder.
targetTesterKey: A Key to the target finder's target tester.
intersectionTesterKey: A Key to the target finder's intersection tester.
headshotTesterKey: A Key to the target finder's headshot tester.
targetLimiterKey: A Key to the target finder's target limiter.

Stack Mappers

Clip Stack Mapper

Sets the amount of a gun's item stack based on the gun's clip.
Serial Key: gun.stack_mapper.clip.stack_count
reloadTesterKey: A Key to the stack mapper's reload tester.

Reload Stack Mapper

Sets the durability of a gun's item stack based on the gun's reload status. Serial Key: gun.stack_mapper.reload.durability
statsKey: A Key to the gun's stats
reloadTesterKey: A Key to the gun's reload tester

Clone this wiki locally