Skip to content
StrangeOne101 edited this page Aug 5, 2023 · 5 revisions

Description

Events are a new feature in PixelTweaks that allow resource packs to define events that happen in certain situations. For example, play epic battle music when battling a specific type of pokemon (e.g. Arceus)

Requirements

Resource packs must create a new file under assets/<namespace>/pixelevents/<event>.json. This file defines the actual event in the game, and as long as you are on PixelTweaks 1.2 and above, it should load.

Each event requires a type, conditions to let the event fire, and then properties specific to those events. There is also an optional priority property that defines what events should be called before others. A priority of 1 will go before events with a priority of 0.

Example

{
  "type": "battle_music",
  "conditions": [
    {
      "type": "pokemon",
      "spec": "species:arceus",
      "wild": true
    }
  ],
  "music": {
    "start": "pixeltweaks:arceus/intro",
    "loop": "pixeltweaks:arceus/loop",
    "end": ""
  },
  "priority": 10
}

Here is an example of the 1 event that comes with PixelTweaks 1.2. It defines that there is a new type of battle music when you battle a wild Arceus. When the battle triggers, it will play the pixeltweaks:arceus/intro sound before continuing to forever play (until the battle is over) pixeltweaks:arceus/loop. These sound files are defined the same way normal sounds are defined in a resource pack

There is also room for us to play a sound when the battle ends. This is currently not provided, so the looping music will fade like normal when the battle ends.

Types of Events

Clone this wiki locally