Additional Args
data class AdditionalArgs(val instance: JavaPlugin, val keys: List<Pair<String, PersistentDataType<*, *>>>)
Declares the extra, per-instance parameters an item/entity accepts (e.g. via /egive item <arg>).
keys is the schema: an ordered list of name to PersistentDataType pairs. Each pair says what the parameter is called (the String — used to build its NamespacedKey(instance, name)) and what type it holds (the PersistentDataType — how the raw string is parsed and stored). The order matters: positional command/createItemStack arguments are matched to keys in this order.
Build it with Kotlin's to and the standard PersistentDataType constants:
AdditionalArgs(
ExamplePlugin.instance,
listOf(
"radius" to PersistentDataType.INTEGER, // /egive example 5
"owner" to PersistentDataType.STRING, // /egive example 5 Steve
)
)Content copied to clipboard
Supported types are the scalar PDC constants (STRING, INTEGER, LONG, DOUBLE, FLOAT, BYTE, SHORT, BOOLEAN) and the comma-separated arrays (BYTE_ARRAY, INTEGER_ARRAY, LONG_ARRAY).