UNPKG

minecraft-bedrock-json-types

Version:

Typescript types for Minecraft Bedrock's add-on json configuration files.

557 lines (556 loc) 13.7 kB
/** * This file was automatically generated by json-schema-to-typescript. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run json-schema-to-typescript to regenerate this file. */ /** * A version that tells minecraft what type of data format can be expected when reading this file. */ type FormatVersion = ("1.8.0" | "1.10.0" | "1.12.0"); /** * The entity identifier this spawn rule will apply to, entity must exist. */ type Identifier = string; /** * Setting an entity to a pool it will spawn as long as that pool hasn't reached the spawn limit. */ type PopulationControl = ("ambient" | "animal" | "water_animal" | "monster" | "cat" | "pillager"); /** * This component allows the players to specify which biomes the mob spawns in. Each biome in the game has one or more tags. These tags are used to determine what biomes mobs spawn in. */ type BiomeFilter = (Filters[] | Filters1); type Filters = (CGroupsSpec[] | CFiltersSpec); type CGroupsSpec = (CGroupsSpec[] | CFiltersSpec); type CFiltersSpec = ({ all_of?: AllOf; any_of?: AnyOf; none_of?: NoneOf; [k: string]: unknown; } | ({ [k: string]: unknown; } & { [k: string]: unknown; } & { [k: string]: unknown; } & { [k: string]: unknown; } & { [k: string]: unknown; } & { [k: string]: unknown; } & { [k: string]: unknown; } & { [k: string]: unknown; } & { [k: string]: unknown; } & { [k: string]: unknown; } & { [k: string]: unknown; } & { [k: string]: unknown; } & { [k: string]: unknown; } & { [k: string]: unknown; } & { [k: string]: unknown; } & { [k: string]: unknown; } & { [k: string]: unknown; } & { [k: string]: unknown; } & { [k: string]: unknown; } & { [k: string]: unknown; } & { [k: string]: unknown; } & { [k: string]: unknown; } & { [k: string]: unknown; } & { [k: string]: unknown; } & { [k: string]: unknown; } & { [k: string]: unknown; } & { [k: string]: unknown; } & { [k: string]: unknown; } & { [k: string]: unknown; } & { [k: string]: unknown; } & { [k: string]: unknown; } & { [k: string]: unknown; } & { [k: string]: unknown; } & { [k: string]: unknown; } & { [k: string]: unknown; } & { [k: string]: unknown; } & { [k: string]: unknown; } & { [k: string]: unknown; } & { [k: string]: unknown; } & { [k: string]: unknown; } & { [k: string]: unknown; } & { [k: string]: unknown; } & { [k: string]: unknown; } & { [k: string]: unknown; } & { [k: string]: unknown; } & { [k: string]: unknown; } & { [k: string]: unknown; } & { [k: string]: unknown; } & { [k: string]: unknown; } & { [k: string]: unknown; } & { [k: string]: unknown; } & { [k: string]: unknown; } & { [k: string]: unknown; } & { [k: string]: unknown; } & { [k: string]: unknown; } & { [k: string]: unknown; } & { [k: string]: unknown; } & { [k: string]: unknown; } & { [k: string]: unknown; } & { [k: string]: unknown; } & { [k: string]: unknown; } & { [k: string]: unknown; } & { [k: string]: unknown; } & { [k: string]: unknown; } & { [k: string]: unknown; } & { [k: string]: unknown; } & { [k: string]: unknown; } & { [k: string]: unknown; } & { [k: string]: unknown; } & { [k: string]: unknown; } & { [k: string]: unknown; } & { [k: string]: unknown; } & { [k: string]: unknown; } & { [k: string]: unknown; } & { [k: string]: unknown; } & { [k: string]: unknown; } & { [k: string]: unknown; } & { [k: string]: unknown; } & { [k: string]: unknown; } & { [k: string]: unknown; } & { [k: string]: unknown; } & { [k: string]: unknown; } & { [k: string]: unknown; })); /** * All tests in an `all_of` group must pass in order for the group to pass. */ type AllOf = (CGroupsSpec[] | CFiltersSpec); /** * One or more tests in an `any_of` group must pass in order for the group to pass. */ type AnyOf = (CGroupsSpec[] | CFiltersSpec); /** * All tests in a `none_of` group must fail in order for the group to pass. */ type NoneOf = (CGroupsSpec[] | CFiltersSpec); type Filters1 = (CGroupsSpec[] | CFiltersSpec); /** * This is the minimum light level value that allows the mob to spawn. */ type Min = number; /** * This is the maximum light level value that allows the mob to spawn. */ type Max = number; /** * This determines if weather can affect the light level conditions that cause the mob to spawn (e.g. Allowing hostile mobs to spawn during the day when it rains.) */ type AdjustForWeather = boolean; /** * This is the minimum delay that a mob spawns. */ type Min1 = number; /** * This is the maximum delay that a mob spawns. */ type Max1 = number; /** * The identifier of the mob that will spawn. */ type Identifier1 = string; /** * The percent chance that this entity will spawn. */ type SpawnChance = number; /** * This is the maximum number of mobs of this type spawnable on the surface. */ type Surface = number; /** * This is the maximum number of mobs of this type spawnable underground. */ type Underground = number; /** * This is the minimum difficulty level that a mob spawns. */ type Min2 = ("easy" | "normal" | "hard" | "peaceful"); /** * This is the maximum difficulty level that a mob spawns. */ type Max2 = ("easy" | "normal" | "hard" | "peaceful"); /** * This is the minimum distance level that a mob spawns. */ type Min3 = number; /** * This is the maximum distance level that a mob spawns. */ type Max3 = number; /** * This is the minimum height level that a mob spawns. */ type Min4 = number; /** * This is the maximum height level that a mob spawns. */ type Max4 = number; /** * This component allows players to determine the herd size of animals. */ type HeightFilter1 = (Herd | Herd1[]); /** * Runs an event on the first entities in a group. */ type InitialEvent = string; /** * The number of entities that "initial_event" should trigger on. */ type InitialEventCount = number; /** * This is the minimum number of mobs that spawn in a herd. */ type MinimumSize = number; /** * This is the maximum number of mobs that spawn in a herd. */ type MaximumSize = number; /** * This is an event that can be triggered from spawning. */ type Event = string; /** * This is the number of mobs spawned before the specified event is triggered. */ type EventSkipCount = number; /** * The event String in this JSON Object is used to filter the spawn rules of the mob type. Can be type minecraft:pillager_patrols_event, minecraft:wandering_trader_event, or minecraft:ender_dragon_event.. */ type EventFilter = ("minecraft:pillager_patrols_event" | "minecraft:wandering_trader_event" | "minecraft:ender_dragon_event"); /** * This component allows the players to specify the permutations of a mob that will spawn. */ type PermuteType = (PermuteType1 | PermuteType2[]); /** * The percentage of 100 of a type of mob that should spawn. If there are multiple weights, they must add up to 100. */ type Weight = number; /** * The type of mob to spawn. */ type EntityType = string; /** * Causes mobs to spawn with a guaranteed_count before mobs that do not have this spawn condition. */ type GuaranteedCount = number; /** * This is the maximum mob_event level that an entity spawns. */ type Distance = number; /** * This is the minimum mob_event level that an entity spawns. */ type VillageBorderTolerance = number; /** * UNDOCUMENTED. */ type Event1 = string; /** * UNDOCUMENTED. */ type Blocks = (string | string[]); /** * UNDOCUMENTED. */ type Distance1 = number; /** * This component allows an entity to spawn on a particular block. It includes a string or array of strings for the block they may spawn on. */ type SpawnsOnBlockFilter = (string | string[]); /** * This component allows an entity to not spawn on a particular block. It includes a string or array of strings for the block they may not spawn on. */ type SpawnsOnBlockPreventedFilter = (string | string[]); /** * This is the priority of the mob spawning out of 100. */ type Default = number; /** * UNDOCUMENTED. */ type Rarity = number; /** * This is the minimum world_age_filter level that a mob spawns measured in seconds. */ type Min5 = number; /** * UNDOCUMENTED. */ type Conditions = Condition[]; /** * Data-Driven spawning allows you to adjust the spawn conditions of mobs. */ export interface SpawnRule { format_version: FormatVersion; "minecraft:spawn_rules": SpawnRules; } /** * Data-Driven spawning allows you to adjust the spawn conditions of mobs. */ interface SpawnRules { description?: Description; conditions?: Conditions; } /** * The descripton of to which entity this spawn rule belongs. */ interface Description { identifier: Identifier; population_control: PopulationControl; } /** * UNDOCUMENTED. */ interface Condition { "minecraft:biome_filter"?: BiomeFilter; "minecraft:brightness_filter"?: BrightnessFilter; "minecraft:delay_filter"?: DelayFilter; "minecraft:density_limit"?: DensityLimit; "minecraft:difficulty_filter"?: DifficultyFilter; "minecraft:disallow_spawns_in_bubble"?: DisallowSpawnsInBubble; "minecraft:distance_filter"?: DistanceFilter; "minecraft:height_filter"?: HeightFilter; "minecraft:herd"?: HeightFilter1; "minecraft:mob_event_filter"?: MobEventFilter; "minecraft:permute_type"?: PermuteType; "minecraft:player_in_village_filter"?: PlayerInVillageFilter; "minecraft:spawn_event"?: SpawnEvent; "minecraft:spawns_above_block_filter"?: SpawnsUnderwater; "minecraft:spawns_lava"?: SpawnsOnLava; "minecraft:spawns_on_block_filter"?: SpawnsOnBlockFilter; "minecraft:spawns_on_block_prevented_filter"?: SpawnsOnBlockPreventedFilter; "minecraft:spawns_on_surface"?: SpawnsOnSurface; "minecraft:spawns_underground"?: SpawnsUnderground; "minecraft:spawns_underwater"?: SpawnsUnderwater1; "minecraft:weight"?: Weight1; "minecraft:world_age_filter"?: WorldAgeFilter; } /** * This component allows players to set the light level range that causes the mob to spawn. */ interface BrightnessFilter { min?: Min; max?: Max; adjust_for_weather?: AdjustForWeather; } /** * This component allows players to set mobs spawn with certain time delays before they will spawn. */ interface DelayFilter { min?: Min1; max?: Max1; identifier: Identifier1; spawn_chance?: SpawnChance; } /** * This component allows the players to specify the amount of mobs to spawn in certain locations. */ interface DensityLimit { surface?: Surface; underground?: Underground; } /** * This component allows players to set mobs spawn at certain difficulty levels. The min is for Peaceful difficulty and the max is for Hard difficulty. */ interface DifficultyFilter { min?: Min2; max?: Max2; } /** * Allows creators to keep entities from spawning in bubbles. */ interface DisallowSpawnsInBubble { } /** * This component allows players to set mobs spawn with certain distance levels. */ interface DistanceFilter { min?: Min3; max?: Max3; } /** * This component allows players to set mobs spawn within certain heights of their map. */ interface HeightFilter { min?: Min4; max?: Max4; } /** * Herd. */ interface Herd { initial_event?: InitialEvent; initial_event_count?: InitialEventCount; min_size?: MinimumSize; max_size?: MaximumSize; event?: Event; event_skip_count?: EventSkipCount; } /** * Herd. */ interface Herd1 { initial_event?: InitialEvent; initial_event_count?: InitialEventCount; min_size?: MinimumSize; max_size?: MaximumSize; event?: Event; event_skip_count?: EventSkipCount; } /** * This component allows players to spawn mobs on a particular event. */ interface MobEventFilter { event?: EventFilter; } /** * UNDOCUMENTED. */ interface PermuteType1 { weight?: Weight; entity_type?: EntityType; guaranteed_count?: GuaranteedCount; } /** * UNDOCUMENTED. */ interface PermuteType2 { weight?: Weight; entity_type?: EntityType; guaranteed_count?: GuaranteedCount; } /** * This component lets players be filtered by whether they are in a village or not, using distance and the village border definitions. */ interface PlayerInVillageFilter { distance?: Distance; village_border_tolerance?: VillageBorderTolerance; } /** * Event related to the spawning of an entity. */ interface SpawnEvent { event?: Event1; } /** * UNDOCUMENTED. */ interface SpawnsUnderwater { blocks?: Blocks; distance?: Distance1; } /** * This component determines if an entity spawns lava. */ interface SpawnsOnLava { } /** * This component allows the mob to spawn on the ground. Adding the component causes it to be true, removing it causes the mob to stop spawning on the surface. */ interface SpawnsOnSurface { } /** * This component allows an entity to spawn underground. */ interface SpawnsUnderground { } /** * This component allows the mob to spawn underwater. Adding the component causes it to be true, removing it causes the mob to stop spawning underwater. */ interface SpawnsUnderwater1 { } /** * This component allows players to set a priority for how often that mob should spawn. Mobs with lower weight values will have a lower chance to spawn than mobs with higher weight values. */ interface Weight1 { default?: Default; rarity?: Rarity; } /** * This component allows players to set mobs spawn after a certain amount of time has passed within a world. */ interface WorldAgeFilter { min?: Min5; } export {};