Skip to content

Instantly share code, notes, and snippets.

@Shadows-of-Fire
Last active August 20, 2023 01:07
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Shadows-of-Fire/a45a2742b7a0842c50738d3df3ce8148 to your computer and use it in GitHub Desktop.
Save Shadows-of-Fire/a45a2742b7a0842c50738d3df3ce8148 to your computer and use it in GitHub Desktop.
Gateways To Eternity JSON Schema
"string" // [Mandatory] || Mojangson string representation of a Compound Tag -- See https://github.com/aramperes/Mojangson for spec
OR
Object // [Mandatory] || Object representation of a Compound Tag, which is just write a JSON object that maps to your desired nbt.
// A string representation of CompoundTag implies -> "nbt": "{Data:0}"
// The object representation implies -> "nbt": { "Data": 0 }
// Either form is valid, and the object form is easier.
{
"item": "string", // [Mandatory] || Registry Name of item to load.
"optional": boolean, // [Optional, defaults to false] || If False, then the parser will error if the item is not located in the registry.
"count": integer, // [Optional, defaults to 1] || Stack Size
"nbt": CompoundTag, // [Optional] || Vanilla Item NBT
"cap_nbt": CompoundTag, // [Optional] || Forge Item Capability NBT
}
{
"entity": "string", // [Mandatory] || Registry name of an entity type
"nbt": CompoundTag, // [Optional] || Additional NBT data for the spawned entity.
}
{
"type": "string", // [Mandatory] || Type name of the reward. Valid types are detailed below.
<additional data depends on type>
}
// Type "stack" rewards a single itemstack.
{
"type": "stack",
"stack": ItemStack // [Mandatory] || The ItemStack this reward will provide.
}
// Type "stack_list" rewards a list of itemstacks.
{
"type": "stack_list",
"stacks": [ // [Mandatory] || List of all stacks this reward will provide.
ItemStack
]
}
// Type "entity_loot" rewards a number of rolls of an entity's loot table, as if the summoner had killed it.
{
"type": "entity_loot",
"entity": "string", // [Mandatory] || Registry name of the entity to use.
"nbt": CompoundTag, // [Optional] || NBT Data to load onto the entity before evaluating the loot table.
"rolls": int // [Mandatory] || The number of times the loot table will be rolled.
}
// Type "loot_table" rewards a number of rolls of a specific loot table. The loot table will only receive a position, player, and tool context.
// That said, do not use this for entity loot tables, only use it for chests/block drops or similar. Use entity_loot for entity drops.
{
"type": "loot_table",
"loot_table": "string", // [Mandatory] || Resource Location of the target loot table.
"rolls": int, // [Mandatory] || The number of times the loot table will be rolled.
"desc": "string" // [Mandatory] || Lang Key (or english text) which will be used to display the reward in the tooltip.
}
// Type "chanced" allows you to make there be a chance of a certain reward being granted. It wraps any of the other types of rewards.
{
"type": "chanced",
"chance": float, // [Mandatory] || The chance the reward is granted, in the range [0, 1]. 0.5 is 50%
"reward": Reward // [Mandatory] || The reward in question. Should be any type other than "chanced"
}
// Type "command" allows for an execution of a command when rewards would be granted.
// The command string should omit the leading slash, and the keyphrase "<summoner>" (without quotes) will be replaced with the summoning player's name.
{
"type": "command",
"command": "string", // [Mandatory] || The command string, without leading slash. This will be executed as the gateway, with a permission level of 2.
"desc": "string" // [Mandatory] || Lang Key (or english text) which will be used to display the reward in the tooltip.
}
{
"type": "string", // [Mandatory] || Type name of the failure. Valid types are detailed below.
<additional data depends on type>
}
// Type "explosion" triggers an explosion at the location of the Gateway.
{
"type": "explosion",
"strength": float, // [Mandatory] || Strength of the explosion. Creepers are 3, TNT is 4.
"fire": boolean, // [Mandatory] || If the explosion will cause fire to spawn.
"block_damage": boolean // [Mandatory] || If the explosion will damage blocks.
}
// Type "mob_effect" applies a potion effect to all nearby players (within leash range).
{
"type": "mob_effect",
"effect": "string", // [Mandatory] || Registry name of the mob effect.
"duration": int, // [Mandatory] || Duration, in ticks, of the effect.
"amplifier": int // [Mandatory] || Effect amplifier. A value of zero corresponds to level 1.
}
// Type "summon" spawns a certain number of enemies at the Gateway's location.
{
"type": "summon",
"entity": "string", // [Mandatory] || Registry name of the entity.
"nbt": CompoundTag, // [Optional] || NBT Data to load onto the entity before spawning.
"count": int // [Mandatory] || The number of copies of this entity to spawn.
}
// Type "chanced" allows you to make there be a chance of a certain failure penalty happening. It wraps any of the other types of failure.
{
"type": "chanced",
"chance": float, // [Mandatory] || The chance the failure occurs, in the range [0, 1]. 0.5 is 50%
"reward": Reward // [Mandatory] || The reward in question. Should be any type other than "chanced"
}
// Type "command" allows for an execution of a command when failure penalties would be applied.
// The command string should omit the leading slash, and the keyphrase "<summoner>" (without quotes) will be replaced with the summoning player's name.
{
"type": "command",
"command": "string", // [Mandatory] || The command string, without leading slash. This will be executed as the gateway, with a permission level of 2.
"desc": "string" // [Mandatory] || Lang Key (or english text) which will be used to display the reward in the tooltip.
}
{
"attribute": "string", // [Mandatory] || Registry name of the Attribute to use.
"operation": "String", // [Mandatory] || One of ADDITION, MULTIPLY_BASE, MULTIPLY_TOTAL. See https://github.com/Shadows-of-Fire/Placebo/blob/1.18/src/main/java/shadows/placebo/util/AttributeHelper.java#L17-L28 (Addition is 0, multBase is 1, multTotal is 2)
"value": double // [Mandatory] || Attribute modifier value. What the value means is operation-dependent, see above.
}
"string" // [Mandatory] || A string representation of a Minecraft TextColor, in Hex or Named form.
// A color in hex form takes the value "#RRGGBB", meaning that all-red is "#FF0000", all-green is "#00FF00", and all-blue is "#0000FF".
// A color in name form is the name of one of the vanilla color codes, which are the following:
// black, dark_blue, dark_green, dark_aqua, dark_red, dark_purple, gold, gray, dark_gray, blue, green, aqua, red, light_purple, yellow, white
// Note for objects that use Color, "color": Color implies -> "color": "#RRGGBB", since this class is a string primitive.
"string" // [Mandatory] || String name of a spawn algorithm.
/**
At the time of writing there are only two spawn algorithms, both detailed below.
"gateways:open_field"
The Open Field Algorithm selects random spawn positions within the spawn radius, and places entities on the ground.<br>
This algorithm will likely fail if the working area is not mostly empty.<br>
"gateways:inward_spiral"
The Inward Spiral Algorithm selects random spawn positions within the spawn radius, but reduces the spawn radius each attempt.
On the final attempt, the wave entity will attempt to spawn exactly on the position of the Gateway itself.
Spawned entities will still be placed on the ground.
This algorithm will work in most scenarios, but may enable non-ideal cheese mechanisms such as dropping all wave entities into a mob grinder.
*/
{
"entities": [ // [Mandatory] || A list of all entities that will be spawned this wave.
Entity
],
"modifiers": [ // [Optional] || A list of all modifiers to be applied to ALL wave enemies.
AttributeModifier
],
"rewards": [ // [Mandatory] || A list of rewards for this wave.
Reward
],
"max_wave_time": int, // [Mandatory] || The total time, in ticks, that this wave may be active for.
"setup_time": int // [Mandatory] || The time, in ticks, before this wave starts, after the last wave ends.
}
{
"size": "string", // [Mandatory] || Gateway Size, one of "small", "medium", or "large"
"color": Color, // [Mandatory] || The color of the Gateway
"completion_xp": int, // [Mandatory] || Bonus XP dropped upon completion of the entire gateway.
"spawn_range": int, // [Mandatory] || Spawn range for entities spawned from this gateway. If you're spawning many entities, you may want a larger value.
"leash_range": int, // [Optional] || The maximum distance that a Wave Entity may walk before failing the Gateway. Defaults to 32.
"spawn_algorithm": SpawnAlgorithm,// [Optional] || The Spawn Algorithm to use. Defaults to "gateways:open_field" (the original algorithm).
"player_damage_only": boolean, // [Optional] || If Wave Entities may only be damaged by a real player. Defaults to false.
"allow_discarding": boolean, // [Optional] || If non-kills (discards, like creeper explosions) count for wave progress. Defaults to false.
"waves": [ // [Mandatory] || The list of waves for this Gateway.
Wave
],
"rewards": [ // [Mandatory] || Rewards that will be granted upon completion of the entire gateway.
Reward
],
"failures": [ // [Mandatory] || Failure penalties that will be applied if the Gateway is not completed.
Failure
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment