UNPKG

minecraft-bedrock-json-types

Version:

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

790 lines (789 loc) 23.2 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 = string; /** * The identifier for this item. The name must include a namespace and must not use the Minecraft namespace unless overriding a Vanilla item. */ type Identifier = string; /** * If this item is experimental, it will only be registered if the world is marked as experimental. */ type IsExperimental = boolean; /** * A translation string of an existing group in minecraft to group this block/item under */ type ItemGroup = ("itemGroup.name.anvil" | "itemGroup.name.arrow" | "itemGroup.name.axe" | "itemGroup.name.banner" | "itemGroup.name.banner_pattern" | "itemGroup.name.bed" | "itemGroup.name.boat" | "itemGroup.name.boots" | "itemGroup.name.buttons" | "itemGroup.name.candles" | "itemGroup.name.chalkboard" | "itemGroup.name.chest" | "itemGroup.name.chestboat" | "itemGroup.name.chestplate" | "itemGroup.name.concrete" | "itemGroup.name.concretePowder" | "itemGroup.name.cookedFood" | "itemGroup.name.copper" | "itemGroup.name.coral" | "itemGroup.name.coral_decorations" | "itemGroup.name.crop" | "itemGroup.name.door" | "itemGroup.name.dye" | "itemGroup.name.enchantedBook" | "itemGroup.name.fence" | "itemGroup.name.fenceGate" | "itemGroup.name.firework" | "itemGroup.name.fireworkStars" | "itemGroup.name.flower" | "itemGroup.name.glass" | "itemGroup.name.glassPane" | "itemGroup.name.glazedTerracotta" | "itemGroup.name.goatHorn" | "itemGroup.name.grass" | "itemGroup.name.hanging_sign" | "itemGroup.name.helmet" | "itemGroup.name.hoe" | "itemGroup.name.horseArmor" | "itemGroup.name.leaves" | "itemGroup.name.leggings" | "itemGroup.name.lingeringPotion" | "itemGroup.name.log" | "itemGroup.name.minecart" | "itemGroup.name.miscFood" | "itemGroup.name.mobEgg" | "itemGroup.name.monsterStoneEgg" | "itemGroup.name.mushroom" | "itemGroup.name.netherWartBlock" | "itemGroup.name.ore" | "itemGroup.name.permission" | "itemGroup.name.pickaxe" | "itemGroup.name.planks" | "itemGroup.name.potion" | "itemGroup.name.potterySherds" | "itemGroup.name.pressurePlate" | "itemGroup.name.rail" | "itemGroup.name.rawFood" | "itemGroup.name.record" | "itemGroup.name.sandstone" | "itemGroup.name.sapling" | "itemGroup.name.sculk" | "itemGroup.name.seed" | "itemGroup.name.shovel" | "itemGroup.name.shulkerBox" | "itemGroup.name.sign" | "itemGroup.name.skull" | "itemGroup.name.slab" | "itemGroup.name.smithing_templates" | "itemGroup.name.splashPotion" | "itemGroup.name.stainedClay" | "itemGroup.name.stairs" | "itemGroup.name.stone" | "itemGroup.name.stoneBrick" | "itemGroup.name.sword" | "itemGroup.name.trapdoor" | "itemGroup.name.walls" | "itemGroup.name.wood" | "itemGroup.name.wool" | "itemGroup.name.woolCarpet"); /** * Determines which category this block/item will be placed under in the inventory and crafting table container screens. */ type Category = ("construction" | "equipment" | "items" | "nature" | "none"); /** * Determines whether or not this item can be used with commands. Commands can use items by default */ type IsHiddenInCommands = boolean; /** * Whether the item can be placed in the off hand slot */ type Value = boolean; /** * Set the placement block name for the planter item. */ type Block = string; /** * Tags. */ type Tags = string; /** * List of block descriptors that contain blocks that this item can be used on. If left empty, all blocks will be allowed. */ type UseOn = AllowedBlock[]; /** * Whether the item can destroy blocks while in creative */ type Value1 = boolean; /** * The type of cool down for this item. */ type Category1 = string; /** * The duration of time this item will spend cooling down before becoming usable again. */ type Duration = number; /** * How much extra damage the item does, must be a positive number. */ type Value2 = number; /** * Toggles if the item will be used efficiently. */ type UseEfficiency = boolean; type Speed = number; type Block1 = (string | { tags?: BlockTags; }); /** * The block tags. */ type BlockTags = string; /** * Destroy speed per block. */ type DestroySpeeds = DestroySpeed[]; /** * Set the display name for an item. */ type Value3 = string; /** * The minimum. */ type Min = number; /** * The maximum. */ type Max = number; /** * Maximum durability is the amount of damage that this item can take before breaking. */ type MaximumDurability = number; /** * If true you can always eat this item (even when not hungry), defaults to false. */ type Slot = ("axe" | "bow" | "armor_feet" | "armor_torso" | "armor_head" | "armor_legs" | "hoe" | "pickaxe" | "shovel" | "elytra" | "fishing_rod" | "flintsteel" | "sword" | "shears" | "cosmetic_head"); /** * The value of the enchantment. */ type Value4 = number; /** * The entity to be placed in the world. */ type Entity = string; /** * List of block descriptors that contain blocks that this item can be dispensed on. If left empty, all blocks will be allowed. */ type DispenseOn = BlockDescriptor[]; /** * List of block descriptors that contain blocks that this item can be used on. If left empty, all blocks will be allowed. */ type UseOn1 = BlockDescriptor1[]; /** * If true you can always eat this item (even when not hungry), defaults to false. */ type CanAlwaysEat = boolean; /** * How much nutrition does this food item give the player when eaten. */ type Nutrition = number; /** * Saturation Modifier is used in this formula: (nutrition * saturation_modifier * 2) when appling the saturation buff. Which happens when you eat the item. */ type SaturationModifier = number; /** * When used, convert the *this* item to the one specified by `using_converts_to`. */ type UsingConvertsTo = string; /** * How long in seconds will this fuel cook items for. */ type Duration1 = number; /** * Whether the item has the glint effect. */ type Value5 = boolean; /** * If the item is rendered like a tool while in hand. */ type Value6 = boolean; /** * The key from the resource_pack/textures/item_texture.json `texture_data` object associated with the texture file Example: blaze_powder. */ type DefaultTexture = string; /** * Whether the item interacts with liquid blocks on use. */ type Value7 = boolean; /** * How many of the item that can be stacked. */ type Value8 = number; /** * How long you must charge a projectile for it to critically hit. */ type MinimumCriticalPower = number; /** * The entity to be fired as a projectile. */ type ProjectileEntity = string; /** * Signal strength for comparator blocks to use, from 1 - 13 */ type ComparatorSignal = number; /** * Duration of sound event in seconds, float value. */ type Duration2 = number; /** * Sound event type: 13, cat, blocks, chirp, far, mall, mellohi, stal, strad, ward, 11, wait, pigstep, otherside, 5, relic. */ type SoundEvent = string; /** * Item identifier */ type Item2 = string; /** * Items that can be used to repeair it */ type Items = Item2[]; /** * Amount that can be repaired */ type RepairAmount = (string | number); /** * Repair item entries. */ type RepairItems = ReparItem[]; /** * Item identifier */ type Item3 = string; /** * If ammo can be in offhand */ type UseOffhand = boolean; /** * If ammo can be stored in the inventory */ type SearchInventory = boolean; /** * If it needs ammo to be used in creative */ type UseInCreative = boolean; /** * Ammunition. */ type Ammunition = Ammunition1[]; /** * Charge on draw? Default is set to false. */ type ChargeOnDraw = boolean; /** * Draw Duration. Default is set to 0. */ type MaximumDrawDuration = number; /** * Scale power by draw duration? Default is set to false. */ type ScalePowerByDrawDuration = boolean; /** * Whether the item should eventually despawn while floating in the world */ type Value9 = boolean; /** * Also defines whether the item actors can merge while floating in the world. */ type Value10 = boolean; /** * An array that can contain multiple item tags. * * @minItems 1 */ type Tags2 = [(("minecraft:arrow" | "minecraft:banner" | "minecraft:boat" | "minecraft:boats" | "minecraft:bookshelf_books" | "minecraft:chainmail_tier" | "minecraft:coals" | "minecraft:crimson_stems" | "minecraft:decorated_pot_sherds" | "minecraft:diamond_tier" | "minecraft:digger" | "minecraft:door" | "minecraft:golden_tier" | "minecraft:hanging_actor" | "minecraft:hanging_sign" | "minecraft:horse_armor" | "minecraft:iron_tier" | "minecraft:is_armor" | "minecraft:is_axe" | "minecraft:is_cooked" | "minecraft:is_fish" | "minecraft:is_food" | "minecraft:is_hoe" | "minecraft:is_meat" | "minecraft:is_minecart" | "minecraft:is_pickaxe" | "minecraft:is_shovel" | "minecraft:is_sword" | "minecraft:is_tool" | "minecraft:is_trident" | "minecraft:leather_tier" | "minecraft:lectern_books" | "minecraft:logs" | "minecraft:logs_that_burn" | "minecraft:mangrove_logs" | "minecraft:music_disc" | "minecraft:netherite_tier" | "minecraft:planks" | "minecraft:sand" | "minecraft:sign" | "minecraft:soul_fire_base_blocks" | "minecraft:spawn_egg" | "minecraft:stone_bricks" | "minecraft:stone_crafting_materials" | "minecraft:stone_tier" | "minecraft:stone_tool_materials" | "minecraft:transform_materials" | "minecraft:transform_templates" | "minecraft:transformable_items" | "minecraft:trim_templates" | "minecraft:trimmable_armors" | "minecraft:vibration_damper" | "minecraft:warped_stems" | "minecraft:wooden_slabs" | "minecraft:wooden_tier" | "minecraft:wool") | string), ...((("minecraft:arrow" | "minecraft:banner" | "minecraft:boat" | "minecraft:boats" | "minecraft:bookshelf_books" | "minecraft:chainmail_tier" | "minecraft:coals" | "minecraft:crimson_stems" | "minecraft:decorated_pot_sherds" | "minecraft:diamond_tier" | "minecraft:digger" | "minecraft:door" | "minecraft:golden_tier" | "minecraft:hanging_actor" | "minecraft:hanging_sign" | "minecraft:horse_armor" | "minecraft:iron_tier" | "minecraft:is_armor" | "minecraft:is_axe" | "minecraft:is_cooked" | "minecraft:is_fish" | "minecraft:is_food" | "minecraft:is_hoe" | "minecraft:is_meat" | "minecraft:is_minecart" | "minecraft:is_pickaxe" | "minecraft:is_shovel" | "minecraft:is_sword" | "minecraft:is_tool" | "minecraft:is_trident" | "minecraft:leather_tier" | "minecraft:lectern_books" | "minecraft:logs" | "minecraft:logs_that_burn" | "minecraft:mangrove_logs" | "minecraft:music_disc" | "minecraft:netherite_tier" | "minecraft:planks" | "minecraft:sand" | "minecraft:sign" | "minecraft:soul_fire_base_blocks" | "minecraft:spawn_egg" | "minecraft:stone_bricks" | "minecraft:stone_crafting_materials" | "minecraft:stone_tier" | "minecraft:stone_tool_materials" | "minecraft:transform_materials" | "minecraft:transform_templates" | "minecraft:transformable_items" | "minecraft:trim_templates" | "minecraft:trimmable_armors" | "minecraft:vibration_damper" | "minecraft:warped_stems" | "minecraft:wooden_slabs" | "minecraft:wooden_tier" | "minecraft:wool") | string))[]]; /** * Whether the item should use the swing animation when thrown. Default is set to false. */ type DoSwingAnimation = boolean; /** * The scale at which the power of the throw increases. Default is set to 1.0. */ type LaunchPowerScale = number; /** * The maximum duration to draw a throwable item. Default is set to 0.0. */ type MaximumDrawDuration1 = number; /** * The minimum duration to draw a throwable item. Default is set to 0.0. */ type MinimumDrawDuration = number; /** * The maximum power to launch the throwable item. Default is set to 1.0. */ type MaximumLaunchPower = number; /** * Whether or not the power of the throw increases with duration charged. Default is set to false. */ type ScalePowerByDrawDuration1 = boolean; /** * Which animation to play when using the item. */ type Value11 = ("bow" | "eat" | "crossbow" | "drink" | "camera"); /** * Modifier value to scale the players movement speed when item is in use. */ type MovementModifier = number; /** * How long the item takes to use in seconds. */ type UseDuration = number; /** * How much protection does the armor item have. */ type Protection = number; /** * Sets if the item can be dropped by a dispenser block */ type Dispensable = boolean; /** * Which equipment slot the item can fit in */ type Slot1 = ("slot.weapon.mainhand" | "none" | "slot.weapon.offhand" | "slot.armor.head" | "slot.armor.chest" | "slot.armor.legs" | "slot.armor.feet" | "slot.hotbar" | "slot.inventory" | "slot.enderchest" | "slot.saddle" | "slot.armor" | "slot.chest" | "slot.equippable"); /** * UNDOCUMENTED. */ type Effect = string; /** * UNDOCUMENTED. */ type Target = "holder"; /** * UNDOCUMENTED. */ type Duration3 = number; /** * UNDOCUMENTED. */ type Amplifier = number; /** * UNDOCUMENTED. */ type Type = "magic"; /** * UNDOCUMENTED. */ type Amount = number; /** * UNDOCUMENTED. */ type Effect1 = string; /** * UNDOCUMENTED. */ type Target1 = "holder"; /** * UNDOCUMENTED. */ type AngleOffset = number; /** * UNDOCUMENTED. */ type LaunchPower = number; /** * UNDOCUMENTED. */ type Projectile1 = string; /** * UNDOCUMENTED. */ type Target2 = "holder"; /** * UNDOCUMENTED. */ type MaximumRange = [] | [X] | [X, Y] | [X, Y, Z]; /** * UNDOCUMENTED. */ type X = number; /** * UNDOCUMENTED. */ type Y = number; /** * UNDOCUMENTED. */ type Z = number; /** * UNDOCUMENTED. */ type Transform = string; /** * UNDOCUMENTED. */ type Sequence = Sequence1[]; /** * UNDOCUMENTED. */ type Weight = number; /** * UNDOCUMENTED. */ type Randomize = Randomize1[]; /** * UNDOCUMENTED. */ type Command1 = string; /** * UNDOCUMENTED. */ type Command = Command1[]; /** * UNDOCUMENTED. */ type Target3 = "other"; /** * Minecraft items */ export interface Item { format_version: FormatVersion; "minecraft:item": Item1; [k: string]: unknown; } /** * UNDOCUMENTED. */ interface Item1 { description: Description; /** * The components of this item. */ components?: { "minecraft:allow_off_hand"?: AllowOffHand; "minecraft:block_placer"?: BlockPlacer; "minecraft:can_destroy_in_creative"?: CanDestroyInCreative; "minecraft:cooldown"?: Cooldown; "minecraft:damage"?: Damage; "minecraft:digger"?: Digger; "minecraft:display_name"?: DisplayName; "minecraft:durability"?: Durability; "minecraft:enchantable"?: Enchantable; "minecraft:entity_placer"?: EntityPlacer; "minecraft:food"?: Food; "minecraft:fuel"?: Fuel; "minecraft:glint"?: Glint; "minecraft:hand_equipped"?: HandEquipped; "minecraft:icon"?: Icon; "minecraft:liquid_clipped"?: LiquidClipped; "minecraft:max_stack_size"?: MaxStackSize; "minecraft:projectile"?: Projectile; "minecraft:record"?: Record; "minecraft:repairable"?: Repairable; "minecraft:shooter"?: Shooter; "minecraft:should_despawn"?: ShouldDespawn; "minecraft:stacked_by_data"?: StackedByData; "minecraft:tags"?: Tags1; "minecraft:throwable"?: Throwable; "minecraft:use_animation"?: UseAnimation; "minecraft:use_modifiers"?: UseModifiers; "minecraft:wearable"?: Wearable; [k: string]: { [k: string]: unknown; }; }; events?: Events; } /** * The description for this item */ interface Description { identifier?: Identifier; is_experimental?: IsExperimental; menu_category?: MenuCategory; } /** * The Creative Category that includes the specified item. */ interface MenuCategory { group?: ItemGroup; category?: Category; is_hidden_in_commands?: IsHiddenInCommands; } /** * The allow off hand component determines whether the item can be placed in the off hand slot of the inventory. */ interface AllowOffHand { value: Value; } /** * Planter item component. planter items are items that can be planted. */ interface BlockPlacer { block: Block; use_on?: UseOn; } /** * A block descriptor that allows to be placed. */ interface AllowedBlock { tags?: Tags; [k: string]: unknown; } /** * The can destroy in creative component determines if the item will break blocks in creative when swinging. */ interface CanDestroyInCreative { value: Value1; } /** * Cool down time for a component. After you use an item it becomes unusable for the duration specified by the `cool down time` setting in this component. */ interface Cooldown { category: Category1; duration: Duration; } /** * The damage component determines how much extra damage the item does on attack. */ interface Damage { value: Value2; } /** * Digger item. Component put on items that dig. */ interface Digger { use_efficiency?: UseEfficiency; destroy_speeds: DestroySpeeds; } /** * Destroy speed per block. */ interface DestroySpeed { speed?: Speed; block?: Block1; } /** * Display Name item component. Display Names display the name of an item. */ interface DisplayName { value: Value3; } /** * Durability item component: how much damage can this item take before breaking. */ interface Durability { damage_chance?: DamageChance; max_durability: MaximumDurability; } /** * Damage chance. */ interface DamageChance { min: Min; max: Max; } /** * The enchantable component determines what enchantments can be applied to the item. */ interface Enchantable { slot: Slot; value?: Value4; } /** * Entity placer item component. You can specifiy allowed blocks that the item is restricted to. */ interface EntityPlacer { entity: Entity; dispense_on?: DispenseOn; use_on?: UseOn1; } /** * Block that item can be dispensed on. */ interface BlockDescriptor { [k: string]: unknown; } /** * Block that item can be used on */ interface BlockDescriptor1 { [k: string]: unknown; } /** * When an item has a food component, it becomes edible to the player. */ interface Food { can_always_eat?: CanAlwaysEat; nutrition?: Nutrition; saturation_modifier?: SaturationModifier; using_converts_to?: UsingConvertsTo; } /** * Fuel component. Allows this item to be used as fuel in a furnace to `cook` other items. */ interface Fuel { duration: Duration1; } /** * The glint component determines whether the item has the enchanted glint render effect on it */ interface Glint { value: Value5; } /** * This component determines if an item is rendered like a tool while in hand. */ interface HandEquipped { value: Value6; } /** * The icon item componenent determines the icon to represent the item in the UI and elsewhere. */ interface Icon { textures: Textures; [k: string]: unknown; } /** * Contains key-value pairs of textures used by the item */ interface Textures { default: DefaultTexture; [k: string]: unknown; } /** * The liquid clipped component determines whether the item interacts with liquid blocks on use. */ interface LiquidClipped { value: Value7; } /** * The max stack size component determines how many of the item can be stacked together. */ interface MaxStackSize { value: Value8; } /** * Compels the item shoot, like an arrow. Pair with minecraft:shooter for dispensers or as ammunition. Pair with minecraft:throwable to set the entity spawned. */ interface Projectile { minimum_critical_power?: MinimumCriticalPower; projectile_entity: ProjectileEntity; } /** * Used by record items to play music. */ interface Record { comparator_signal?: ComparatorSignal; duration?: Duration2; sound_event: SoundEvent; } /** * Repairable item component: how much damage can this item repair, what items can repair it. */ interface Repairable { repair_items?: RepairItems; } /** * List of repair item entries. */ interface ReparItem { items?: Items; repair_amount?: RepairAmount; } /** * Shooter Item Component. */ interface Shooter { ammunition?: Ammunition; charge_on_draw?: ChargeOnDraw; max_draw_duration?: MaximumDrawDuration; scale_power_by_draw_duration?: ScalePowerByDrawDuration; } /** * Ammunition definition */ interface Ammunition1 { item?: Item3; use_offhand?: UseOffhand; search_inventory?: SearchInventory; use_in_creative?: UseInCreative; } /** * Should despawn component determines if the item should eventually despawn while floating in the world */ interface ShouldDespawn { value: Value9; } /** * The stacked by data component determines if the same item with different aux values can stack. */ interface StackedByData { value: Value10; } /** * The tags component determines which tags an item has on it. */ interface Tags1 { tags: Tags2; } /** * Throwable item component. Throwable items, such as a snowball. */ interface Throwable { do_swing_animation?: DoSwingAnimation; launch_power_scale?: LaunchPowerScale; max_draw_duration?: MaximumDrawDuration1; min_draw_duration?: MinimumDrawDuration; max_launch_power?: MaximumLaunchPower; scale_power_by_draw_duration?: ScalePowerByDrawDuration1; } /** * This component determines which animation plays when using the item. */ interface UseAnimation { value: Value11; } /** * How long to use before item is done being used. */ interface UseModifiers { movement_modifier?: MovementModifier; use_duration: UseDuration; } /** * Wearable item component. */ interface Wearable { protection?: Protection; dispensable?: Dispensable; slot?: Slot1; } /** * UNDOCUMENTED. */ interface Events { on_consume?: Event; [k: string]: Event; } /** * UNDOCUMENTED. */ interface Event { sequence?: Sequence; randomize?: Randomize; run_command?: RunCommand; } /** * UNDOCUMENTED. */ interface Sequence1 { add_mob_effect?: AddMobEffect; damage?: Shoot; decrement_stack?: DecrementStack; remove_mob_effect?: RemoveMobEffect; shoot?: Shoot1; swing?: Swing; teleport?: Teleport; transform_item?: TransformItem; [k: string]: unknown; } /** * UNDOCUMENTED. */ interface AddMobEffect { effect?: Effect; target?: Target; duration?: Duration3; amplifier?: Amplifier; } /** * UNDOCUMENTED. */ interface Shoot { type?: Type; amount?: Amount; } /** * UNDOCUMENTED. */ interface DecrementStack { } /** * UNDOCUMENTED. */ interface RemoveMobEffect { effect?: Effect1; target?: Target1; } /** * UNDOCUMENTED. */ interface Shoot1 { angle_offset?: AngleOffset; launch_power?: LaunchPower; projectile?: Projectile1; } /** * UNDOCUMENTED. */ interface Swing { } /** * UNDOCUMENTED. */ interface Teleport { target?: Target2; max_range?: MaximumRange; } /** * UNDOCUMENTED. */ interface TransformItem { transform?: Transform; } /** * UNDOCUMENTED. */ interface Randomize1 { weight: Weight; [k: string]: unknown; } /** * UNDOCUMENTED. */ interface RunCommand { command?: Command; target?: Target3; } export {};