addonscript-spec/docs/concepts/instance.md

34 lines
2.1 KiB
Markdown
Raw Normal View History

2022-09-03 21:23:53 +02:00
# Instance addons
Instance addons represent instances of Minecraft itself, while non-instance addons
have to be installed into an existing instance of Minecraft. An instance addon MUST have
2023-02-03 16:20:43 +01:00
a launch configuration for each side by inheriting the launch configuration of another
2023-04-21 19:56:33 +02:00
instance addon using the `launch` [flag](flags.md) or by modifying the [Minecraft](./minecraft.md)
launch configuration directly using a [launch config object](../schema/launch.md).
2023-02-03 16:20:43 +01:00
Inheriting a launch configuration MAY be recursive which
means, that an instance addon MAY inherit it's launch configuration from another addon, which
itself inherits it. Instance addons MAY modify inherited launch configurations using a
[launch config object](../schema/launch.md) by overriding the main file or main class, or by
adding libraries or launch arguments. Inheriting a launch configuration also includes any
modifications to it.
2022-09-03 21:23:53 +02:00
## Instance addons as relations
If an instance addon is a relation of another instance addon, each side of that
2023-04-10 16:10:08 +02:00
relation MUST have at least one of the [flags](flags.md) `included`, `launch`, `env`,
`expect` or `incompatible`. Non-instance addons MAY have instance addons as relations
without this restriction.
2023-02-03 16:20:43 +01:00
## Launch configurations
Instance launch configurations are always based on a
[Minecraft launch config](./minecraft.md#launch-configuration) and MAY have modifications
2023-04-21 19:56:33 +02:00
applied to it. Modifications are done by [launch config objects](../schema/launch.md), which
can override the main class or main file and include additional arugments, and by adding
libraries using the `library` [flag](flags.md).
2023-02-03 16:20:43 +01:00
When launching a Minecraft instance, AddonScript implementations SHOULD take the Minecraft
launch configuration as specified [here](./minecraft.md#launch-configuration) and then apply
2023-04-21 19:56:33 +02:00
all modifications by instance addons in the launch inheritance stack to it.
When overriding the main class or file, an instance addon has always priority over the instance addon,
from which it inherits the launch config. When adding arguments, they are always appended at the end of those
2023-02-03 16:20:43 +01:00
arguments from the inherited launch config.