[1.8.96] Plugin id aliases

Learn here how to create and use plugins.

Moderator: Plugin Moderators

User avatar
Lobby
Developer
Reactions:
Posts: 3536
Joined: Sun Oct 26, 2008 12:34
Plugins: Show
Version: Beta

Platform

[1.8.96] Plugin id aliases

#1

Post by Lobby »

A new feature introduced with version 1.8.96 are plugin ids aliases. They can be useful if you want to change the ids of objects that can be used by others (e.g. light definitions). Since changing the ids would break plugins that depend on the former ids you can now specify aliases for the id under which the plugin can be found, too.

Let's assume you have the following json code:

Code: Select all

[
  {
    "id":"myoldid",
    ...
  }
]
You can now define an alias just like that:

Code: Select all

[
  {
    "id":"myoldid",
    "alias":"newid",
    ...
  }
]
You can also define multiple aliases:

Code: Select all

[
  {
    "id":"myoldid",
    "aliases":["newid", "anothernewid"],
    ...
  }
]
It doesn't matter if you write alias or aliases as attribute name, both can take a single string or an array of strings. Plugin references to other plugins by id should behave equivalent no matter if it uses the original id or an alias id of it.
=^._.^= ∫

Return to “Tutorials and Documentation”