Skip to content
This repository has been archived by the owner on May 13, 2021. It is now read-only.

JSON Serializers

Nick Ignoffo edited this page Oct 6, 2016 · 9 revisions

JSON Serializers

These are some standard serializers used in Lore Expansion noted down for reference.


LoreKey

{
    "id": "foo",
    "category": "bar"
}

Category can be a language key. It will be localized whenever drawn.


Content

{
    "title": "foobar",
    "body": "My foobar brings all the boys to the yard.",
    "audio": "",
    "autoplay": false
}
Field Description
title Title of this Lore. Displayed at the top of the right page when selected and in the hovering tooltip on the left page. Can be a language key. Will be localized when drawn. Required
body Body text of this Lore. Displayed on the right page when selected. Can be a language key. Will be localized when drawn. Required
audio Name of the audio file to play. Audio files are loaded from ../config/loreexpansion/lore/audio/ and must be of the .ogg format. A value of example will play example.ogg. Optional - Default ""
autoplay If an audio value is set, this will cause it to play as soon as the Player receives the Lore. Optional - Default false.

ResourceLocation

{
    "domain": "foo",
    "path": "bar"
}

TriggerData

{
    "triggerId": ResourceLocation,
    "target": { ... }
}
Field Description
triggerId See the ResourceLocation serializer. Required
target Changes based on the triggerId. See the Lore Triggers section for more information. Required

ActionData

{
    "actionId": ResourceLocation,
    "data": { ... }
}
Field Description
actionId See the ResourceLocation serializer. Required
data Changes based on the actionId. See the Lore Actions section for more information. Required

Achievement

{
    "id": "foo.bar"
}

To find the string to use for id, use tab completion on the /achievement command. It will list the ID of all registered achievements. eg: achievement.openInventory for "Taking Inventory".


BlockPos

{
    "xPos": 0,
    "yPos": 0,
    "zPos": 0
}

ItemStack

{
    "id": ResourceLocation,
    "amount": 1,
    "meta": 0,
    "nbt": ""
}
Field Description
id See the ResourceLocation serializer. Required

| | amount | The amount of this item. Optional - Default 1 | | meta | The damage value of this item. Optional - Default 0 | | nbt | An NBT Tag to set for this item. Uses the Vanilla Minecraft NBT String format. It is essentially one large String of JSON. Optional - Default "" |