-
Notifications
You must be signed in to change notification settings - Fork 0
Creating Animation Config
Now we need to create a config file for our animation. It can be only .json and .json5. You can put this file in any subfolder of the assets/patpat/ folder.
- First, let's find out what options exist:
Version:
1.0.0| Type:String| Example:1.5.2
Indicates a version of the config file. This is necessary so that in the future the mod can process old config options. Specify a string with three numbers separated by a dot without spaces.
Version:
1.0.0| Type:Integer| Example:10| Default Value:0
Indicates priority of custom animation. Specify a number from -2147483648 to 2147483647.
Try to avoid MIN and MAX values, range [-10000, 10000] is more than enough!
How Priority Works?
Each custom animation has its own priority. When someone interacts with an entity, the first custom animation will be used that meets three criteria:
- Entity Type
- Entity Name
- Entity UUID
If there are some custom animations that meet the criteria, then the order is adjusted as follows:
- If custom animations are in different resource packs, then will be used custom animation from resource pack with a higher priority will be used
- If custom animations are in the same resource pack, then will be used custom animation with the higher priority.
- If the priority is the same, then it's sorted based on the file path.
Version:
1.0.0| See "About "animation" Object"
Contains animation settings, like duration, sounds, etc.
Version:
1.0.0| Type:Boolean| Example:falseortrue| Default Value:false
Switch entities list to whitelist[false] mode, or blacklist[true].
- If
true, then the list will work like a blacklist. Will be accepted all entities, except entities fromentitieslist - If
false, then the list will work like a whitelist. Will be accepted only entities fromentitieslist
Version:
1.0.0| See "About "entity" Object"
Contains entities on which this animation will play. You can set it to all to select all entities.
Version:
1.0.0| Type:String| Example:patpat:textres/path/to/texture.png
Contains a path to texture that will be used on playing animation.
All animation textures should be in 'textures/' folder, because mod will search texture in this folder!
Version:
1.0.0| Type:Integer| Example:300
Indicates animation duration in ms. Cannot be negative.
Version:
1.0.0| See "About "frame" Object"
Contains frame settings, like total frames count, offsets, scaling, etc.
Version:
1.0.0| See "About "sound" Object"
Indicates a sound that will be played with animation, and optionally sound min/max pitch and volume.
Version:
1.0.0| Type:Integer| Example:5
Indicates total frames at your texture.
Version:
1.0.0| Type:Double| Example:1.5| Default Value:0.9
Indicates texture scaling by X axis. For example, if the value is 2.0, then the texture will be two times larger.
Version:
1.0.0| Type:Double| Example:1.5| Default Value:0.9
Indicates texture scaling by Y axis. For example, if the value is 2.0, then the texture will be two times larger.
Version:
1.0.0| Type:Double| Example:-1.5| Default Value:0.0
Indicates texture offset by X axis.
Version:
1.0.0| Type:Double| Example:1.5| Default Value:0.0
Indicates texture offset by Y axis.
Version:
1.0.0| Type:Double| Example:-1.5| Default Value:0.0
Indicates texture offset by Z axis.
Version:
1.0.0| Type:String| Example:patpat:pat_sound
Indicates sound id.
Version:
1.0.0| Type:Double| Example:1.5| Default Value:1.0
Indicates min value of sound pitch.
Version:
1.0.0| Type:Double| Example:1.5| Default Value:1.0
Indicates max value of sound pitch.
Version:
1.0.0| Type:Double| Example:1.5| Default Value:1.0
Indicates volume of sound.
Version:
1.0.0| Type:String| Example:minecraft:pig
Indicates an entity type. If not present, PatPat mod will pass comparing this option.
Version:
1.0.0| Type:String| Example:My Cute Dog
Indicates an entity name. Entity name means entity name, not entity type name. For example, I named my dog to My Cute Dog and I want to use my animation only for entities, which has this name, then I should write here My Cute Dog.
Version:
1.0.0| Type:String| Example:192e3748-12d5-4573-a8a5-479cd394a1dc
Indicates entity UUID. Usually you will use it to specify your animation on a specific player, which has its own unique UUID. For example, I want to use my animation only at player LopyMine, I will write here his UUID: 192e3748-12d5-4573-a8a5-479cd394a1dc.
PatPat Mod has own example of Custom Animation Config with all options, you can look at it here.
Well, now we know what options exist.
- Let's try to create our own simple config file based on this example:
animated_piston.json5
{
"version": "1.0.0",
"animation": {
"texture": "patpat:textures/animated_piston_texture.png",
"duration": 300,
"frame": {
"totalFrames": 5,
"scaleX": 1,
"scaleY": 1,
"offsetX": 0,
"offsetY": 0,
"offsetZ": 0
}
},
"entities": [
"minecraft:zombie"
]
}- Let's save it in the same directory where we saved the texture:
- Let's try to load our resource pack in game and pat zombie
- How we can see it works, but we don't hear any sounds because we forgot to add custom sound for our animation. Let's do it:
