Skip to content

PML API

PML API is an API mod introduced with 0.5.2. It was introduced in order to clean up base PML and move some features that should not be part of the base mod loader into a separate mod

How to use

If you want to use PML API, add the pmlapi dependency to your mod's version.json(for 0.6.0 onward) or manifest.json(for 0.5.2):

json
"dependencies": [
  {
    "id": "pmlapi",
    "version": "0.1.2"
  }
]

now, in your init, you can asign pmlapi to a variable like this:

js
init = (pml) => {
    this.pApi = pml.getMod("pmlapi");
    ...
}

now you can use pApi like you would use pml before:

js
this.pApi.soundManager.registerSound(name, [url]);