-
Notifications
You must be signed in to change notification settings - Fork 72
Pack Making JSON Sounds
DonBruce64 edited this page Aug 4, 2024
·
17 revisions
Sounds are what they sound like. Entries here are sounds this object will play based on the animations. Each animation, rather than adjusting the movement, adjusts the sound properties. Do note that an excess number of muted, but playing, loopable sounds will clog up sound slots, so make sure to only use loopable sounds when absolutely required. All sound
properties are as follows:
- name – The name for this sound. This tells MTS where to find it. Format is
packID:soundName
. All sounds should be located in the 'sounds' folder as the first folder underneath your main pack folder. Not required if soundVariations is set. - soundVariations – A list of sounds to play instead of the main sound. If this is present, then one of these at random will be played each time this sound is played rather than the normal sound. Note that a parameter for name is still required to allow the audio system to track this sound, and should be unique to the entity this is defined on.
- activeConditions – A required listing of conditions for determining if this sound is active.
- volumeModifiers – A listing of value modifiers for the volume (default is full volume). Volume is internally clamped from 0.0 to 1.0; you do not need to worry about clamping here.
- pitchModifiers – Like volumeModifiers, but for pitch. Pitch has a lower clamp of 0.0, but can be as high as you want, though some audio cards may have issues at really high values.
- looping – If the sound should loop, set this to true. Be aware that unless the volume is set to 0 or below, or the sound is blocked via visibility variables or inhibitors, then it will keep playing forever and take up a sound slot!
- forceSound – Normally sounds won't play if there's already a sound playing. If you want this sound to be played every tick the activeAnimations say that it should be active, set this to true. Mainly used for sounds on guns that need to be played every tick the gun fires, even if such a sound is still playing from the last firing tick, but may be used for other things. Looping sounds is HIGHLY preferred to this if possible.
- canPlayOnPartialTicks – Normally sounds are queried every tick for their state. However, some sounds may be played too fast for this and need to be played more than once per tick, or at an odd rate. You can set this to do so, but keep in mind it's more work for the system to check sounds every frame vs every tick. Use only when required!
- isInterior – This causes the sound to only play if the player is riding this entity and is in first-person.
- isExterior – Like isInterior, but blocks this sound if the player is in first-person and riding this entity.
- blockDoppler – Normally, all looping sounds have a doppler effect applied. Setting this to true will block this.
- pos – An entry of x, y, and z coordinates that define the center point of where this sound will be played relative to the center of the object. May be omitted if you just want the sound to play at the center.
- conicalVector - The conical sound vector for the direction of this sound. Used in conjunction with soundSpan to restrict a sound to a conical area.
- conicalAngle - How many degrees outward from soundVector the sound can be heard.
- minDistance – The minimum distance for where this sound can be heard.
- minDistanceVolume - The volume of the sound at the minimum distance. Input any value between 1-0. 1 = Maximum Volume.
- middleDistance - A special distance that causes a middle calculation in the sound volume. This allows for a triangular interpolation of sound volume.
- middleDistanceVolume - The volume of the sound at the middle distance. Input any value between 1-0. 1 = Maximum Volume.
- maxDistance – The maximum distance as to where this sound can be heard. If minDistance is set to 0, then the sound will have its volume scaled to be 100% at the origin, and 0% at this distance. If minDistance is included, then no scaling will be performed. If this and minDistance are left out, 0-64 is used.
- maxDistanceVolume - The volume of the sound at the maximum distance. Input any value between 1-0. 1 = Maximum Volume.
- The Absolute Basics
- Pack Making General Introduction
- Pack Making General Master File
- Pack Making General File Structure
- Pack Making General Item Textures and JSONs
- Pack Making General Languages
- Pack Making General Conventions
- Pack Making JSON Colors
- Pack Compiling for 1.16.5
- JSON Templates