Castle Oblivion Data

Castle Oblivion is highly customisable through datapacks with 4 different types of JSON files as well as making use of tags and .nbt structure files.

Castle Oblivion is comprised of Floors and those Floors contains Rooms each Floor has a FloorType and each Room has a RoomType these types contain immutable information read from the JSON files when a Room is generated a structure is chosen structure has to be compatible with the RoomType from the card used as well as the FloorType of the current Floor the selected structure is represented by a RoomStructure which defines properties to check compatibility as well as which structure file to actually generate. Within the Floors there are special rooms that require a keycard to enter and upon entering will start an Encounter these encounters are defined in the RoomEncounters. Rooms, Floors and Wave Encounters all have a modifier field in the JSONs these are special effects that can apply every tick or when a room is entered, when a room is exited, when a room is generated and when a mob spawns. As these are quite complex these will get their own section explaining them.

Floor Type

Floor Types define properties of a floor acting as a parent for Room Types.

Floor Type JSONs are in the castle_oblivion/floor_type folder. It is possible to add new Floor Types however adding a new card that uses that type is currently not, a simple addon mod would need to be created to add a new card item.
Here is a breakdown of the JSON file structure:

Example: plains.json

{  
 "biome_colours": "minecraft:plains",  
 "crit_path_length": 7,  
 "music": "minecraft:music.game"  
}

Room Type

Room Types define properties for Rooms used for generating the rooms.

Room Type JSONs are in the castle_oblivion/room_type folder. It is possible to add new Room Types however adding a new card that uses that type is currently not, a simple addon mod would need to be created to add a new card item.
Here is a breakdown of the JSON file structure:

Example: stagnant_space.json

{
 "category": "STATUS",
 "enemies": {
   "type": "S",
   "number_of_enemies": 5,
   "simultaneous_enemies": 3
 },
 "modifiers": [
   {
     "type": "kingdomkeys:effect",
     "amplifier": 0,
     "effect": "minecraft:slowness",
     "target": "MOB"
   }
 ],
 "size": "M"
}

Room Structure

Room Structures link the .nbt structure files with the room generation defining the properties of a the structures so compatibility can be checked with the Room Type.

Room Structure JSONs are in the castle_oblivion/room_structure.
Here is a breakdown of the JSON file structure:

Example: moogle_room.json

{  
 "categories": [  
   "BOUNTY"  
 ],  
 "size": "S",  
 "structure": "moogle_room",  
 "white_list": [  
   "kingdomkeys:moogle_room"  
 ]  
}

Room Encounter

Room Encounters are encounters that initiate in a room and then end whenever the type of encounter's end condition is met. The main part of a Room Encounter is the Encounter type, depending on the type of encounter the JSON options will change. The other option is the list of items to give as rewards for completing the encounter.

Room Encounter JSONs are in the castle_oblivion/room_encounter custom ones can simply be made by making a new file and setting the encounter for a Room Type with the new encounter.
Here is a breakdown of the JSON file structure:

Example: room_of_beginnings.json

{  
 "encounter": {  
   "type": "kingdomkeys:wave",
   ...  
 },  
 "music": "kingdomkeys:music/forgotten_challenge",  
 "rewards": [  
   {  
     "count": 1,  
     "id": "kingdomkeys:key_of_guidance"  
   }  
 ]  
}

Encounter Types

Encounter Types have options specific to the type of encounter they are so the JSON structure is different for each one. There is currently only 1 type, more are planned for the future.

Wave

Wave encounters are what they sound like when the encounter starts the first wave of enemies are spawned and then when all of them have died the next wave spawns until the final wave. Once the final wave is defeated the encounter is completed.

Here is a breakdown of the JSON structure for type kingdomkeys:wave

Example: room_of_beginnings.json

"type": "kingdomkeys:wave",  
"interval_ticks": 100,  
"shuffle_order": false,  
"waves": [  
{  
   "modifiers": [],  
   "spawns": [  
     "kingdomkeys:shadow",  
     "kingdomkeys:shadow",  
     "kingdomkeys:shadow"  
   ]  
 },  
 {  
   "modifiers": [],  
   "spawns": [  
     "kingdomkeys:red_nocturne",  
     "kingdomkeys:blue_rhapsody",  
     "kingdomkeys:shadow"  
   ]  
 },  
 {  
   "modifiers": [],  
   "spawns": [  
     "kingdomkeys:shadow",  
     "kingdomkeys:soldier",  
     "kingdomkeys:shadow"  
   ]  
 }  
]

Room Modifier

Room Modifiers are quite versatile objects that can be added to a Room Type, Floor Type and Wave Encounters. They can do things when a room is entered and exited, every tick while players are in a room, when a room is generated and when a mob spawns in a room. Each type of modifier has its own options for the JSON.

Effect

The effect type kingdomkeys:effect applies an effect with infinite duration to players and mobs depending on the target set while in the room.
Here is a breakdown of the JSON structure:

Example: bottomless_darkness.json

"modifiers": [  
 {  
   "type": "kingdomkeys:effect",  
   "amplifier": 0,  
   "effect": "minecraft:darkness",  
   "target": "PLAYER"  
 }  
]

This applies the darkness effect to players while in the room

Level

The level type kingdomkeys:level modifies the level mobs spawn at applying the supplied operations in order. The base value will be the floor number multiplied by 10 then +/- 3.
The + operator performs value + amount.
The - operator performs value - amount.
The * operator performs value * amount.
The = operator performs value = amount, if used it should be first in the list as any operations performed before will be redundant.
The rand operator performs value + random value between -amount and amount.
Here is a breakdown of the JSON structure:

Example: almight_darkness.json

"modifiers": [  
 {  
   "type": "kingdomkeys:level",  
   "operations": [  
     {  
       "amount": 2,  
       "operator": "+"  
     }  
   ]  
 }  
]

Increases the level of spawned mobs by 2

Spawn

The spawn type kingdomkeys:spawn spawns a specified mob in a room when generated.

Here is a breakdown of the JSON structure:

Example: moogle_room.json

"modifiers": [
 {
   "type": "kingdomkeys:spawn",
   "additional_data": {
     "inv": "kingdomkeys:cards",
     "stationary": true
   },
   "entity": "kingdomkeys:moogle"
 }
]

This spawns a moogle with a custom shop inventory and stops the moogle from moving