Pack Making JSON Bullets - DonBruce64/MinecraftTransportSimulator GitHub Wiki
Bullets are a bit of an odd case, as they're neither a particle, nor a part. Rather, they're special client-side entities that fly around and hit things. As such, they're in their own special section.
Bullets are pretty simple. They only have a few parameters that define their basic properties, as the good chunk of the complex work of actually firing the bullet is done by the gun. As to damage dealt, that is dependent on the speed and size of the bullet, but can also be configured directly in the bullet json. You will typically be making at least one bullet per gun you make, in some cases you can use bullets from other packs if they fit your parameters, but this is rather uncommon (in this case the better option might be to use weapons from a specific pack alltogether). All bullet-specific parameters are contained in the bullet
sub-section:
Inherited JSON
Bullets inherit the following core JSON sections:
Bullet
- types β A list of types describing the bullet. This defines how it inflicts damage on whatever it hits. For a normal bullet, you can leave this list empty, but it must be includes to load your bullet into the game! Valid types are:
- explosive β This bullet doesn't inflict damage directly, rather it explodes on impact, damaging nearby entities and blocks. Bigger diameters result in bigger explosions.
- incendiary β Deals normal damage, but also sets entities and blocks on fire. If this and
explosive
are both used, the explosion will light blocks on fire within its explosion radius. Highly recommended for jungle warfare.- armor_piercing β Deals normal damage, but ignores armor values. Great for dealing with players in those pesky super-suits mods seem to love nowadays.
- water β Not really a bullet as it doesn't cause damage, but will extinguish block fires or entities on fire. Useful for combating those pesky flammenwerfers....
- guidanceType - Once fired, this determines the logic used for how the bullet guides to its target.
- passive -(unimplemented) Doesn't need a prior target lock to guide. If a valid target gets into the seeker's FOV, it will guide to the first thing it sees or closest thing it sees if multiple targets are present.
- semi_active - Requires a prior lock to guide. However, the shooter must retain a lock throughout the bullet's flight or guidance will cease.
- active - Default Method. Guides to whatever the gun was locked on to at the moment of firing.
- seekerRange β How far away the bullet will be able to maintain a lock on a target once fired.
- seekerMaxAngle β Angle in degrees from the bullet's orientation that it will still be able to see a target. If caught outside, lock will be broken.
- isHeat - If true, then this bullet will be considered a HEAT bullet and will use the HEAT armor value on any collision boxes it finds. If that value isn't defined, it will just use the normal armor value.
- isLongRange β Normally, bullet checks are handled only on the client that spawned them. This client then sends the info to the server when it sees a hit. This works best for most bullets, since it prevents the firing player from 'missing' something they hit due to lag. However, this prevents bullets from hitting things that aren't loaded. Setting this to true will make the bullet do checks on the server, which will let them hit anything loaded on the server, but will result in de-syncs between hit position seen and actual hit position if the gun is moving at any significant speed when fired.
- quantity β How many bullets are in the bullet item crafted at the bullet bench. Because nobody wants to have to craft 500 bullets one by one...
- diameter β The diameter of the bullet. This determines what guns can fire it, as well as the damage it inflicts.
- damage β How much damage this bullet does. Is set to 1/5 the diameter if left out. Note that 'water' type bullets don't damage things, no matter this value.
- caseLength β The case length of the bullet. This determines what guns can fire it, but does not affect damage. Units are in mm.
- blastStrength β Only affects explosive bullets. The damage dealt and size of the blast radius are normally determined by the diameter of the bullet, but you can override that by setting this value. A value of 1 is about equivalent to a single block of TNT. Useful if you want a little more oomph in your explosions, or if you want to tone them down.
- knockback - If set, this bullet, when it hits an entity, will push it back this far.
- armorPenetration β How much armor this bullet can penetrate. This allows the bullet to pass through any collision boxes with armorThickness set less than this value. Note that as the bullet slows down, this value will decrease, so a bullet with 100 penetration may not pass through a collision box with 90 armor if it slows down enough prior to contact.
- proximityFuze β Causes the bullet to detonate when it is this many blocks away from either a block, or its target (if it's a guided bullet). This allows things like missiles and artillery rounds that blow up in the air right above the target or the ground, ensuring that the target receives some of the blast rather than it all going into the ground.
- airBurstDelay β Causes the bullet to explode or despawn after this many ticks. This is a βdumberβ cousin of the proximityFuze, but may be useful for anti-aircraft rounds that explode in mid-air.
- slowdownSpeed β How much velocity, each tick, should be deducted from the bullet's velocity. Has no effect if burnTime is still active.
- burnTime β How long, in ticks, the bullet should keep its initial velocity. This simulates a rocket motor that is present in rockets and missiles. The bullet will not be affected by the gravitationalVelocity defined in the gun, or the slowdownSpeed defined here until this amount of time has elapsed.
- accelerationTime β How long, in ticks, the bullet should take to accelerate from its initial velocity to its maxVelocity.
- accelerationDelay β How long, in ticks, to delay initial acceleration. This can be combined with the initial velocity from the gun to make missiles that detach before igniting.
- maxVelocity β The maximum velocity of this bullet, in m/s. Only used in conjunction with accelerationTime.
- gravitationalVelocity β How much velocity, each tick, should be added in the -Y direction. Used to make bullets travel in arcs.
- despawnTime - The time between bullet firing and de-spawning. Normally 200 ticks (10 seconds) but can be shorter or longer as needed. e.g., water might not need to exist more than 2 seconds, but a lob shot from artillery might need 30 seconds.
- impactDespawnTime - The time between when the bullet impacts, and it despawns. Normally 0 since you want bullets to go away when they impact. But can be higher if you want them to do fancy animations or sounds.
- guidanceDelay - The time it takes for the missile to begin turning if guided.
- turnRate β The rate of turn, in degrees per tick, that this bullet will be able to turn to track entities. If set, then this bullet will lock-on to entities, and hot engines when fired.
- pellets - Number of pellets that this shell has
- pelletSpreadFactor - How much spread the pellets will have when fired. 0 is no spread, higher values have higher spread.
- effects β A optional list of effects that will be applied to the entity hit by this bullet.
- casingModel - The model of the casing to use for the casing particle, or null if no model is to be used.
- casingTexture - The texture of the casing to use for the casing particle, or null if no casing is to be rendered.