minecraft-data
Version:
Provide easy access to minecraft data in node.js
1,667 lines (1,642 loc) • 101 kB
YAML
!version: 1.21.5
!StartDocs: true
^types:
varint: native
varlong: native
optvarint: varint
pstring: native
buffer: native
u8: native
u16: native
u32: native
u64: native
i8: native
i16: native
i32: native
i64: native
bool: native
f32: native
f64: native
UUID: native
option: native
entityMetadataLoop: native
topBitSetTerminatedArray: native
bitfield: native
bitflags: native
container: native
switch: native
void: native
array: native
restBuffer: native
anonymousNbt: native
anonOptionalNbt: native
registryEntryHolder: native
registryEntryHolderSet: native
ByteArray: ["buffer", { "countType": "varint" }]
string: ["pstring", { "countType": "varint" }]
vec2f:
x: f32
y: f32
vec3f:
x: f32
y: f32
z: f32
vec4f:
x: f32
y: f32
z: f32
w: f32
vec3f64:
x: f64
y: f64
z: f64
vec3i:
x: varint
y: varint
z: varint
IDSet: ["registryEntryHolderSet", {
"base": { name: "name", type: "string" },
"otherwise": { name: "ids", type: "varint" }
}]
ContainerID: varint
SlotComponentType: varint =>
- custom_data
- max_stack_size
- max_damage
- damage
- unbreakable
- custom_name
- item_name
- item_model
- lore
- rarity
- enchantments
- can_place_on
- can_break
- attribute_modifiers
- custom_model_data
- tooltip_display
- repair_cost
- creative_slot_lock
- enchantment_glint_override
- intangible_projectile
- food
- consumable
- use_remainder
- use_cooldown
- damage_resistant
- tool
- weapon
- enchantable
- equippable
- repairable
- glider
- tooltip_style
- death_protection
- blocks_attacks
- stored_enchantments
- dyed_color
- map_color
- map_id
- map_decorations
- map_post_processing
- potion_duration_scale
- charged_projectiles
- bundle_contents
- potion_contents
- suspicious_stew_effects
- writable_book_content
- written_book_content
- trim
- debug_stick_state
- entity_data
- bucket_entity_data
- block_entity_data
- instrument
- provides_trim_material
- ominous_bottle_amplifier
- jukebox_playable
- provides_banner_patterns
- recipes
- lodestone_tracker
- firework_explosion
- fireworks
- profile
- note_block_sound
- banner_patterns
- base_color
- pot_decorations
- container
- block_state
- bees
- lock
- container_loot
- break_sound
- villager/variant
- wolf/variant
- wolf/sound_variant
- wolf/collar
- fox/variant
- salmon/size
- parrot/variant
- tropical_fish/pattern
- tropical_fish/base_color
- tropical_fish/pattern_color
- mooshroom/variant
- rabbit/variant
- pig/variant
- cow/variant
- chicken/variant
- frog/variant
- horse/variant
- painting/variant
- llama/variant
- axolotl/variant
- cat/variant
- cat/collar
- sheep/color
- shulker/color
# Instead of sending NBT for items over the network, Minecraft since 1.20.5 sends a
# list of components that make up the item. This saves bandwidth by not encoding tag names.
SlotComponent:
type: SlotComponentType
## Ref: client/net/minecraft/core/component/DataComponents.java
data: type ?
## TODO: look into how nbt works here
if custom_data: anonymousNbt
if max_stack_size: varint
if max_damage: varint
if damage: varint
if unbreakable: void
if custom_name: anonymousNbt
if item_name: anonymousNbt
if item_model: string
if lore: anonOptionalNbt[]varint
if rarity: varint =>
- common
- uncommon
- rare
- epic
if enchantments:
enchantments: []varint
id: varint
level: varint
if can_place_on or can_break:
predicates: ItemBlockPredicate[]varint
if attribute_modifiers:
attributes: []varint
typeId: varint
name: string
value: f64
operation: varint =>
- add
- multiply_base
- multiply_total
slot: varint =>
- any
- main_hand
- off_hand
- hand
- feet
- legs
- chest
- head
- armor
- body
- saddle
showTooltip: bool
if custom_model_data:
floats: f32[]varint
flags: bool[]varint
strings: string[]varint
colors: i32[]varint
if tooltip_display:
hideTooltip: bool
hiddenComponents: varint[]varint
if repair_cost: varint
if creative_slot_lock: void
if enchantment_glint_override: bool
if intangible_projectile: void
if blocks_attacks:
blockDelaySeconds: f32
disableCooldownScale: f32
damageReductions: []varint
horizontalBlockingAngle: f32
type?: IDSet
base: f32
factor: f32
itemDamage:
threshold: f32
base: f32
factor: f32
bypassedBy?: string
blockSound?: ItemSoundHolder
disableSound?: ItemSoundHolder
if food:
nutrition: varint
# How much saturation will be given after consuming the item.
saturationModifier: f32
# Whether the item can always be eaten, even at full hunger.
canAlwaysEat: bool
if consumable:
consume_seconds: f32
animation: varint =>
- none
- eat
- drink
- block
- bow
- spear
- crossbow
- spyglass
- toot_horn
- brush
- bundle
sound: ItemSoundHolder
makes_particles: bool
effects: ItemConsumeEffect[]varint
if use_remainder: Slot
if use_cooldown:
seconds: f32
cooldownGroup?: string
if damage_resistant: string
if tool:
rules: []varint
blocks: IDSet
# The speed at which the tool breaks this rules' blocks.
speed?: f32
# Whether items should drop only if this is the correct tool.
correctDropForBlocks?: bool
# The mining speed in case none of the previous rule were matched.
defaultMiningSpeed: f32
damagePerBlock: varint
canDestroyBlocksInCreative: bool
if weapon:
itemDamagePerAttack: varint
disableBlockingForSeconds: f32
# Enchantment cost up to which the item can be enchanted
if enchantable: varint
if equippable:
slot: varint =>
- main_hand
- off_hand
- feet
- legs
- chest
- head
- body
- saddle
sound: ItemSoundHolder
model?: string
cameraOverlay?: string
allowedEntities?: IDSet
dispensable: bool
swappable: bool
damageable: bool
equipOnInteract: bool
if repairable:
items: IDSet
if glider: void
if tooltip_style: string
if death_protection:
effects: ItemConsumeEffect[]varint
if stored_enchantments:
enchantments: []varint
# The ID of the enchantment in the enchantment registry.
id: varint
level: varint
if dyed_color: i32
if map_color: i32
if map_id: varint
if map_decorations: anonymousNbt
if map_post_processing: varint
if potion_duration_scale: f32
if charged_projectiles:
projectiles: Slot[]varint
if bundle_contents:
contents: Slot[]varint
if potion_contents:
# True if this potion has an ID in the potion registry--it has the default effects associated with the potion type.
potionId?: varint
# The RGB components of the color, encoded as an integer.
customColor?: i32
customEffects: ItemPotionEffect[]varint
customName?: string
if suspicious_stew_effects:
effects: []varint
# The ID of the effect in the potion effect type registry.
effect: varint
# The duration of the effect.
duration: varint
if writable_book_content:
# Max 100 pages
pages: ItemBookPage[]varint
if written_book_content:
rawTitle: string
filteredTitle?: string
author: string
generation: varint
pages: ItemWrittenBookPage[]varint
resolved: bool
if trim:
material: ["registryEntryHolder", { "baseName": "materialId", "otherwise": { "name": "data", "type": "ArmorTrimMaterial" } }]
pattern: ["registryEntryHolder", { "baseName": "patternId", "otherwise": { "name": "data", "type": "ArmorTrimPattern" } }]
if debug_stick_state: anonymousNbt
if entity_data: anonymousNbt
if bucket_entity_data: anonymousNbt
if block_entity_data: anonymousNbt
if instrument: ["registryEntryHolder", { "baseName": "instrumentId", "otherwise": { "name": "data", "type": "InstrumentData" } }]
if provides_trim_material:
hasHolder: bool
material: hasHolder ?
if true: ["registryEntryHolder", { "baseName": "materialId", "otherwise": { "name": "data", "type": "ArmorTrimMaterial" } }]
if false: string
if ominous_bottle_amplifier: varint
if jukebox_playable:
hasHolder: bool
song: hasHolder ?
if true: ["registryEntryHolder", { "baseName": "songId", "otherwise": { "name": "data", "type": "JukeboxSongData" } }]
if false: string
if provides_banner_patterns: string
if recipes: anonymousNbt
if lodestone_tracker:
# Specified if this lodestone points to a position; otherwise it spins randomly.
globalPosition?:
dimension: string
# The position the compass points to. Only present if Has Global Position is true.
position: position
# Whether the component is removed when the associated lodestone is broken.
tracked: bool
if firework_explosion: ItemFireworkExplosion
if fireworks:
flightDuration: varint
explosions: ItemFireworkExplosion[]varint
if profile:
# If the profile has a name, max 16 characters.
name?: string
uuid?: UUID
properties: []varint
# Max 64 characters
name: string
value: string
# Max 1024 characters
signature?: string
if note_block_sound: string
if banner_patterns:
layers: BannerPatternLayer[]varint
if base_color: varint
if pot_decorations:
# The ID of the items in the item registry.
decorations: varint[]varint
if container:
contents: Slot[]varint
if block_state:
properties: []varint
name: string
value: string
if bees:
bees: []varint
# Custom data for the entity, always a Compound Tag. Same structure as the minecraft:custom_data component.
nbtData: anonymousNbt
ticksInHive: varint
minTicksInHive: varint
if lock: anonymousNbt
if container_loot: anonymousNbt
if break_sound: ItemSoundHolder
if villager/variant: varint
if wolf/variant: varint
if wolf/sound_variant: varint
if wolf/collar: varint
if fox/variant: varint
if salmon/size: varint
if parrot/variant: varint
if tropical_fish/pattern: varint
if tropical_fish/base_color: varint
if tropical_fish/pattern_color: varint
if mooshroom/variant: varint
if rabbit/variant: varint
if pig/variant: varint
if cow/variant: varint
if chicken/variant: ["registryEntryHolder", { "baseName": "variantId", "otherwise": { "name": "variantData", "type": "string" } }]
if frog/variant: varint
if horse/variant: varint
if painting/variant: ["registryEntryHolder", { "baseName": "variantId", "otherwise": { "name": "data", "type": "EntityMetadataPaintingVariant" } }]
if llama/variant: varint
if axolotl/variant: varint
if cat/variant: varint
if cat/collar: varint
if sheep/color: varint
if shulker/color: varint
ItemSoundEvent:
soundName: string
fixedRange?: f32
ItemSoundHolder: ["registryEntryHolder", {
"baseName": "soundId",
"otherwise": { name: "data", type: "ItemSoundEvent" }
}]
ItemFireworkExplosion:
shape: varint =>
- small_ball
- large_ball
- star
- creeper
- burst
# The RGB components of the color, encoded as an integer.
colors: i32[]varint
# The RGB components of the color, encoded as an integer.
fadeColors: i32[]varint
# Whether the firework has a trail.
hasTrail: bool
# Whether the firework has a twinkle effect.
hasTwinkle: bool
ItemEffectDetail:
amplifier: varint
duration: varint
ambient: bool
showParticles: bool
showIcon: bool
hiddenEffect?: ItemEffectDetail
ItemPotionEffect:
id: varint
details: ItemEffectDetail
ItemBlockProperty:
name: string
isExactMatch: bool
value: isExactMatch ?
if true:
exactValue: string
if false:
minValue: string
maxValue: string
ExactComponentMatcher: SlotComponent[]varint
DataComponentMatchers:
exactMatchers: ExactComponentMatcher
partialMatchers: varint[]varint
ItemBlockPredicate:
blockSet?: ["registryEntryHolderSet", {
"base": { name: "name", type: "string" },
"otherwise": { name: "blockIds", "type": "varint" }
}]
properties?: ItemBlockProperty[]varint
nbt: anonOptionalNbt
components: DataComponentMatchers
ItemBookPage:
# The raw text of the page. TextComponent, max 1024 characters.
content: string
filteredContent?: string
ItemWrittenBookPage:
content: anonymousNbt
filteredContent: anonOptionalNbt
ItemConsumeEffect: # 1.21.3
type: varint =>
- apply_effects
- remove_effects
- clear_all_effects
- teleport_randomly
- play_sound
_: type ?
if apply_effects:
effects: ItemPotionEffect[]varint
probability: f32
if remove_effects:
effects: IDSet
if clear_all_effects: void
if teleport_randomly:
diameter: f32
if play_sound:
sound: ItemSoundHolder
ArmorTrimMaterial:
assetBase: string
overrideArmorAssets: []varint
key: string
value: string
description: anonymousNbt
ArmorTrimPattern:
assetId: string
description: anonymousNbt
decal: bool
InstrumentData:
soundEvent: ItemSoundHolder
useDuration: f32
range: f32
description: anonymousNbt
JukeboxSongData:
soundEvent: ItemSoundHolder
description: anonymousNbt
lengthInSeconds: f32
comparatorOutput: varint
BannerPattern:
assetId: string
translationKey: string
BannerPatternLayer:
pattern: ["registryEntryHolder", { "baseName": "patternId", "otherwise": { "name": "data", "type": "BannerPattern" } }]
colorId: varint
# This represents a single component within an UntrustedSlot.
# The 'data' field is a varint-prefixed byte array that contains the actual component data.
# The code generator will need to know that it should read a varint for length, then the bytes.
UntrustedSlotComponent:
type: SlotComponentType
data: ByteArray
# An UntrustedSlot is structurally identical to a regular Slot,
# but it uses the special UntrustedSlotComponent type for its component list.
# It's optional because the player might be clearing the slot.
UntrustedSlot:
itemCount: varint
_: itemCount ?
if 0: void
default:
itemId: varint
addedComponentCount: varint
removedComponentCount: varint
components: UntrustedSlotComponent[]$addedComponentCount
removeComponents: []$removedComponentCount
type: SlotComponentType
if false: void
Slot:
itemCount: varint
_: itemCount ?
if 0: void
default:
itemId: varint
# https://wiki.vg/Slot_Data#Structured_components
addedComponentCount: varint
removedComponentCount: varint
components: SlotComponent[]$addedComponentCount
removeComponents: []$removedComponentCount
type: SlotComponentType
HashedSlot:
itemId: varint
itemCount: varint
components: []varint
type: SlotComponentType
hash: i32
removeComponents: []varint
type: SlotComponentType
Particle:
# See client/net/minecraft/core/particles/ParticleTypes.java
type: varint =>
- angry_villager
- block
- block_marker
- bubble
- cloud
- crit
- damage_indicator
- dragon_breath
- dripping_lava
- falling_lava
- landing_lava
- dripping_water
- falling_water
- dust
- dust_color_transition
- effect
- elder_guardian
- enchanted_hit
- enchant
- end_rod
- entity_effect
- explosion_emitter
- explosion
- gust
- small_gust
- gust_emitter_large
- gust_emitter_small
- sonic_boom
- falling_dust
- firework
- fishing
- flame
- infested
- cherry_leaves
- pale_oak_leaves
- tinted_leaves
- sculk_soul
- sculk_charge
- sculk_charge_pop
- soul_fire_flame
- soul
- flash
- happy_villager
- composter
- heart
- instant_effect
- item
- vibration
- trail
- item_slime
- item_cobweb
- item_snowball
- large_smoke
- lava
- mycelium
- note
- poof
- portal
- rain
- smoke
- white_smoke
- sneeze
- spit
- squid_ink
- sweep_attack
- totem_of_undying
- underwater
- splash
- witch
- bubble_pop
- current_down
- bubble_column_up
- nautilus
- dolphin
- campfire_cosy_smoke
- campfire_signal_smoke
- dripping_honey
- falling_honey
- landing_honey
- falling_nectar
- falling_spore_blossom
- ash
- crimson_spore
- warped_spore
- spore_blossom_air
- dripping_obsidian_tear
- falling_obsidian_tear
- landing_obsidian_tear
- reverse_portal
- white_ash
- small_flame
- snowflake
- dripping_dripstone_lava
- falling_dripstone_lava
- dripping_dripstone_water
- falling_dripstone_water
- glow_squid_ink
- glow
- wax_on
- wax_off
- electric_spark
- scrape
- shriek
- egg_crack
- dust_plume
- trial_spawner_detected_player
- trial_spawner_detected_player_ominous
- vault_connection
- dust_pillar
- ominous_spawning
- raid_omen
- trial_omen
- block_crumble
- firefly
## ## Tips for reviewing particle data (as of 1.20.5)
## Inside the registry code, each particle can have an associated "options" type and
## each options type can add additional data to be encoded.
## For example, this line
## public static final ParticleType<BlockParticleOption> BLOCK = register("block", false, BlockParticleOption::codec, BlockParticleOption::streamCodec);
## will read the stream codec from BlockParticleOption.java's streamCodec member; then we see
## return ByteBufCodecs.idMapper(Block.BLOCK_STATE_REGISTRY).map(var1 -> new BlockParticleOption(var0, var1), var0x -> var0x.state);
## this encodes with the ByteBufCodecs.idMapper function. Inside this function we find
## public void encode(ByteBuf var1x, T var2) {
## int var3 = var1.applyAsInt(var2);
## VarInt.write(var1x, var3);
## }
## which as we can see writes the varint to the buffer.
## If you want to see all the serializers try regexp searching "StreamCodec.*Particle"
data: type ?
if block or block_marker or falling_dust or dust_pillar or block_crumble: varint
if dust:
red: f32
green: f32
blue: f32
scale: f32
if dust_color_transition:
fromRed: f32
fromGreen: f32
fromBlue: f32
scale: f32
toRed: f32
toGreen: f32
toBlue: f32
if entity_effect: i32
if item: Slot
if sculk_charge: f32
if shriek: varint
if vibration:
positionType: varint =>
- block
- entity
position: positionType ?
if block: position
if entity:
entityId: varint
entityEyeHeight: f32
ticks: varint
if trail:
target: vec3f64
color: u8
if tinted_leaves: i32
if firefly: void
ingredient: Slot[]varint
position: [
"bitfield",
[
{
"name": "x",
"size": 26,
"signed": true
},
{
"name": "z",
"size": 26,
"signed": true
},
{
"name": "y",
"size": 12,
"signed": true
}
]
]
soundSource: varint =>
0: master
1: music
2: record
3: weather
4: block
5: hostile
6: neutral
7: player
8: ambient
9: voice
packedChunkPos:
z: i32
x: i32
previousMessages: []varint
id: varint
signature: id ?
if 0: [
"buffer",
{
"count": 256
}
]
default: void
entityMetadataEntry:
key: u8
type: varint =>
- byte
- int
- long
- float
- string
- component
- optional_component
- item_stack
- boolean
- rotations
- block_pos
- optional_block_pos
- direction
- optional_uuid
- block_state
- optional_block_state
- compound_tag
- particle
- particles
- villager_data
- optional_unsigned_int
- pose
- cat_variant
- cow_variant
- wolf_variant
- wolf_sound_variant
- frog_variant
- pig_variant
- chicken_variant
- optional_global_pos
- painting_variant
- sniffer_state
- armadillo_state
- vector3
- quaternion
value: type ?
if byte: i8
if int: varint
if long: varlong
if float: f32
if string: string
if component: anonymousNbt
if optional_component: ["option", "anonymousNbt"]
if item_stack: Slot
if boolean: bool
if rotations:
pitch: f32
yaw: f32
roll: f32
if block_pos: position
if optional_block_pos: ["option", "position"]
if direction: varint
if optional_uuid: ["option", "UUID"]
if block_state: varint
if optional_block_state: optvarint
if compound_tag: anonymousNbt
if particle: Particle
if particles: Particle[]varint
if villager_data:
villagerType: varint
villagerProfession: varint
level: varint
if optional_unsigned_int: optvarint
if pose: varint
if cat_variant: varint
if cow_variant: varint
if wolf_variant: varint
if wolf_sound_variant: varint
if frog_variant: varint
if pig_variant: varint
if chicken_variant: ["registryEntryHolder", { "baseName": "variantId", "otherwise": { "name": "variantData", "type": "string" } }]
if optional_global_pos: ["option", "string"]
if painting_variant: ["registryEntryHolder", {
"baseName": "variantId",
"otherwise": { name: "variantData", type: "EntityMetadataPaintingVariant" }
}]
if sniffer_state: varint
if armadillo_state: varint
if vector3: vec3f
if quaternion: vec4f
EntityMetadataPaintingVariant:
width: i32
height: i32
assetId: string
title?: anonymousNbt
author?: anonymousNbt
entityMetadata: ["entityMetadataLoop", { "endVal": 255, "type": "entityMetadataEntry" }]
tags: []varint
tagName: string
entries: varint[]varint
chunkBlockEntity:
_: [
"bitfield",
[
{
"name": "x",
"size": 4,
"signed": false
},
{
"name": "z",
"size": 4,
"signed": false
}
]
]
y: i16
type: varint
nbtData: anonOptionalNbt
chat_session?:
uuid: UUID
publicKey:
expireTime: i64
keyBytes: [
"buffer",
{
"countType": "varint"
}
]
keySignature: [
"buffer",
{
"countType": "varint"
}
]
game_profile:
name: string
properties: []varint
name: string
value: string
signature?: string
command_node:
flags: [
"bitfield",
[
{
"name": "unused",
"size": 3,
"signed": false
},
{
"name": "has_custom_suggestions",
"size": 1,
"signed": false
},
{
"name": "has_redirect_node",
"size": 1,
"signed": false
},
{
"name": "has_command",
"size": 1,
"signed": false
},
{
"name": "command_node_type",
"size": 2,
"signed": false
}
]
]
children: varint[]varint
redirectNode: flags/has_redirect_node ?
if 1: varint
default: void
extraNodeData: flags/command_node_type ?
if 0: void
if 1:
name: string
if 2:
name: string
parser: varint =>
- brigadier:bool
- brigadier:float
- brigadier:double
- brigadier:integer
- brigadier:long
- brigadier:string
- minecraft:entity
- minecraft:game_profile
- minecraft:block_pos
- minecraft:column_pos
- minecraft:vec3
- minecraft:vec2
- minecraft:block_state
- minecraft:block_predicate
- minecraft:item_stack
- minecraft:item_predicate
- minecraft:color
- minecraft:component
- minecraft:style
- minecraft:message
- minecraft:nbt
- minecraft:nbt_tag
- minecraft:nbt_path
- minecraft:objective
- minecraft:objective_criteria
- minecraft:operation
- minecraft:particle
- minecraft:angle
- minecraft:rotation
- minecraft:scoreboard_slot
- minecraft:score_holder
- minecraft:swizzle
- minecraft:team
- minecraft:item_slot
- minecraft:item_slots # 1.20.5
- minecraft:resource_location
- minecraft:function
- minecraft:entity_anchor
- minecraft:int_range
- minecraft:float_range
- minecraft:dimension
- minecraft:gamemode
- minecraft:time
- minecraft:resource_or_tag
- minecraft:resource_or_tag_key
- minecraft:resource
- minecraft:resource_key
- minecraft:resource_selector
- minecraft:template_mirror
- minecraft:template_rotation
- minecraft:heightmap
- minecraft:loot_table # 1.20.5
- minecraft:loot_predicate # 1.20.5
- minecraft:loot_modifier # 1.20.5
- minecraft:uuid
properties: parser ?
if brigadier:bool: void
if brigadier:float:
flags: [
"bitfield",
[
{
"name": "unused",
"size": 6,
"signed": false
},
{
"name": "max_present",
"size": 1,
"signed": false
},
{
"name": "min_present",
"size": 1,
"signed": false
}
]
]
min: flags/min_present ?
if 1: f32
default: void
max: flags/max_present ?
if 1: f32
default: void
if brigadier:double:
flags: [
"bitfield",
[
{
"name": "unused",
"size": 6,
"signed": false
},
{
"name": "max_present",
"size": 1,
"signed": false
},
{
"name": "min_present",
"size": 1,
"signed": false
}
]
]
min: flags/min_present ?
if 1: f64
default: void
max: flags/max_present ?
if 1: f64
default: void
if brigadier:integer:
flags: [
"bitfield",
[
{
"name": "unused",
"size": 6,
"signed": false
},
{
"name": "max_present",
"size": 1,
"signed": false
},
{
"name": "min_present",
"size": 1,
"signed": false
}
]
]
min: flags/min_present ?
if 1: i32
default: void
max: flags/max_present ?
if 1: i32
default: void
if brigadier:long:
flags: [
"bitfield",
[
{
"name": "unused",
"size": 6,
"signed": false
},
{
"name": "max_present",
"size": 1,
"signed": false
},
{
"name": "min_present",
"size": 1,
"signed": false
}
]
]
min: flags/min_present ?
if 1: i64
default: void
max: flags/max_present ?
if 1: i64
default: void
if brigadier:string: varint =>
0: SINGLE_WORD
1: QUOTABLE_PHRASE
2: GREEDY_PHRASE
if minecraft:entity: [
"bitfield",
[
{
"name": "unused",
"size": 6,
"signed": false
},
{
"name": "onlyAllowPlayers",
"size": 1,
"signed": false
},
{
"name": "onlyAllowEntities",
"size": 1,
"signed": false
}
]
]
if minecraft:game_profile: void
if minecraft:block_pos: void
if minecraft:column_pos: void
if minecraft:vec3: void
if minecraft:vec2: void
if minecraft:block_state: void
if minecraft:block_predicate: void
if minecraft:item_stack: void
if minecraft:item_predicate: void
if minecraft:color: void
if minecraft:component: void
if minecraft:message: void
if minecraft:nbt: void
if minecraft:nbt_path: void
if minecraft:objective: void
if minecraft:objective_criteria: void
if minecraft:operation: void
if minecraft:particle: void
if minecraft:angle: void
if minecraft:rotation: void
if minecraft:scoreboard_slot: void
if minecraft:score_holder: [
"bitfield",
[
{
"name": "unused",
"size": 7,
"signed": false
},
{
"name": "allowMultiple",
"size": 1,
"signed": false
}
]
]
if minecraft:swizzle: void
if minecraft:team: void
if minecraft:item_slot: void
if minecraft:resource_location: void
if minecraft:function: void
if minecraft:entity_anchor: void
if minecraft:int_range: void
if minecraft:float_range: void
if minecraft:dimension: void
if minecraft:gamemode: void
if minecraft:time:
min: i32
if minecraft:resource_or_tag or minecraft:resource_or_tag_key or minecraft:resource or minecraft:resource_key or minecraft:resource_selector:
registry: string
if minecraft:template_mirror: void
if minecraft:template_rotation: void
if minecraft:heightmap: void
if minecraft:uuid: void
suggestionType: ../flags/has_custom_suggestions ?
if 1: string
default: void
# # Shared Packets
# These are packets that are shared between multiple states.
# They are defined here to avoid duplication.
# =====
# MC: ServerboundClientInformationPacket
packet_common_settings:
locale: string
viewDistance: i8
chatFlags: varint
chatColors: bool
skinParts: u8
mainHand: varint
enableTextFiltering: bool
enableServerListing: bool
particleStatus: varint =>
- all
- decreased
- minimal
# MC: ClientboundCookieRequestPacket
packet_common_cookie_request:
cookie: string
# MC: ClientboundStoreCookiePacket
packet_common_store_cookie:
key: string
value: ByteArray
# MC: ClientboundTransferPacket
packet_common_transfer:
host: string
port: varint
# MC: ServerboundCookieResponsePacket
packet_common_cookie_response:
key: string
value: ByteArray
# MC: ServerboundSelectKnownPacks
# MC: ClientboundSelectKnownPacks
packet_common_select_known_packs:
packs: []varint
namespace: string
id: string
version: string
# MC: ClientboundCustomReportDetailsPacket
packet_common_custom_report_details:
details: []varint
key: string
value: string
# MC: ClientboundResourcePackPopPacket
packet_common_remove_resource_pack:
uuid?: UUID
# MC: ClientboundResourcePackPushPacket
packet_common_add_resource_pack:
uuid: UUID
url: string
hash: string
forced: bool
promptMessage?: anonymousNbt
ServerLinkType: varint =>
- bug_report
- community_guidelines
- support
- status
- feedback
- community
- website
- forums
- news
- announcements
# MC: ClientboundServerLinksPacket
# This packet contains a list of links that the Notchian client will display in the menu
# available from the pause menu. Link labels can be built-in or custom (i.e., any text).
packet_common_server_links:
links: []varint
hasKnownType: bool
knownType: hasKnownType ?
if true: ServerLinkType
unknownType: hasKnownType ?
if false: anonymousNbt
link: string
^handshaking.toClient.types:
packet:
name: varint =>
params: ["switch",{"compareTo":"name","fields":{}}]
^handshaking.toServer.types:
packet_set_protocol:
protocolVersion: varint
serverHost: string
serverPort: u16
nextState: varint
packet_legacy_server_list_ping:
payload: u8
packet:
name: varint =>
0x00: set_protocol
0xfe: legacy_server_list_ping
params: name ?
if set_protocol: packet_set_protocol
if legacy_server_list_ping: packet_legacy_server_list_ping
^status.toClient.types:
# MC: ClientboundStatusResponsePacket
packet_server_info:
response: string
# MC: ClientboundPongResponsePacket
packet_ping:
time: i64
packet:
name: varint =>
0x00: server_info
0x01: ping
params: name ?
if server_info: packet_server_info
if ping: packet_ping
^status.toServer.types:
# MC: ServerboundStatusRequestPacket
packet_ping_start:
# Empty
# MC: ServerboundPingRequestPacket
packet_ping:
time: i64
packet:
name: varint =>
0x00: ping_start
0x01: ping
params: name ?
if ping_start: packet_ping_start
if ping: packet_ping
^login.toClient.types:
# MC: ClientboundLoginDisconnectPacket
packet_disconnect:
reason: string
# MC: ClientboundHelloPacket
packet_encryption_begin:
serverId: string
publicKey: [
"buffer",
{
"countType": "varint"
}
]
verifyToken: [
"buffer",
{
"countType": "varint"
}
]
shouldAuthenticate: bool
# MC: ClientboundLoginFinishedPacket
packet_success:
uuid: UUID
username: string
properties: []varint
name: string
value: string
signature?: string
# MC: ClientboundLoginCompressionPacket
packet_compress:
threshold: varint
# MC: ClientboundCustomQueryPacket
packet_login_plugin_request:
messageId: varint
channel: string
data: restBuffer
## (Cookie Request is Common) ##
packet:
name: varint =>
- disconnect
- encryption_begin
- success
- compress
- login_plugin_request
- cookie_request
params: name ?
if disconnect: packet_disconnect
if encryption_begin: packet_encryption_begin
if success: packet_success
if compress: packet_compress
if login_plugin_request: packet_login_plugin_request
if cookie_request: packet_common_cookie_request
^login.toServer.types:
# MC: ServerboundHelloPacket
packet_login_start:
username: string
playerUUID: UUID
# MC: ServerboundKeyPacket
packet_encryption_begin:
sharedSecret: [
"buffer",
{
"countType": "varint"
}
]
verifyToken: [
"buffer",
{
"countType": "varint"
}
]
# MC: ServerboundCustomQueryAnswerPacket
packet_login_plugin_response:
messageId: varint
data?: restBuffer
# MC: ServerboundLoginAcknowledgedPacket
packet_login_acknowledged:
# Empty
## (Cookie Response is Common) ##
packet:
name: varint =>
- login_start
- encryption_begin
- login_plugin_response
- login_acknowledged
- cookie_response
params: name ?
if login_start: packet_login_start
if encryption_begin: packet_encryption_begin
if login_plugin_response: packet_login_plugin_response
if login_acknowledged: packet_login_acknowledged
if cookie_response: packet_common_cookie_response
^configuration.toClient.types:
## (Cookie Request is common)
# MC: ClientboundCustomPayloadPacket
packet_custom_payload:
channel: string
data: restBuffer
# MC: ClientboundDisconnectPacket
packet_disconnect:
reason: anonymousNbt
# MC: ClientboundFinishConfigurationPacket
packet_finish_configuration:
# Empty
# MC: ClientboundKeepAlivePacket
packet_keep_alive:
keepAliveId: i64
# MC: ClientboundPingPacket
packet_ping:
id: i32
# MC: ClientboundResetChatPacket
packet_reset_chat:
# Empty
# MC: ClientboundRegistryDataPacket
packet_registry_data:
# The server can send multiple registries
id: string
entries: []varint
key: string
value?: anonymousNbt
## (Store cookie and Transfer are Common) ##
# MC: ClientboundUpdateEnabledFeaturesPacket
packet_feature_flags:
features: string[]varint
# MC: ClientboundUpdateTagsPacket
packet_tags:
tags: []varint
tagType: string
tags: tags
## (Select known packs is common)
packet:
name: varint =>
- cookie_request
- custom_payload
- disconnect
- finish_configuration
- keep_alive
- ping
- reset_chat
- registry_data
- remove_resource_pack
- add_resource_pack
- store_cookie
- transfer
- feature_flags
- tags
- select_known_packs
- custom_report_details
- server_links
params: name ?
if cookie_request: packet_common_cookie_request
if custom_payload: packet_custom_payload
if disconnect: packet_disconnect
if finish_configuration: packet_finish_configuration
if keep_alive: packet_keep_alive
if ping: packet_ping
if reset_chat: packet_reset_chat
if registry_data: packet_registry_data
if remove_resource_pack: packet_common_remove_resource_pack
if add_resource_pack: packet_common_add_resource_pack
if store_cookie: packet_common_store_cookie
if transfer: packet_common_transfer
if feature_flags: packet_feature_flags
if tags: packet_tags
if select_known_packs: packet_common_select_known_packs
if custom_report_details: packet_common_custom_report_details
if server_links: packet_common_server_links
^configuration.toServer.types:
## (Settings is Common) ##
## (Cookie Response is Common) ##
# MC: ServerboundCustomPayloadPacket
packet_custom_payload:
channel: string
data: restBuffer
# MC: ServerboundFinishConfigurationPacket
packet_finish_configuration:
# Empty
# MC: ServerboundKeepAlivePacket
packet_keep_alive:
keepAliveId: i64
# MC: ServerboundPongPacket
packet_pong:
id: i32
# MC: ServerboundResourcePackPacket
packet_resource_pack_receive:
uuid: UUID
result: varint
packet:
name: varint =>
- settings
- cookie_response
- custom_payload
- finish_configuration
- keep_alive
- pong
- resource_pack_receive
- select_known_packs
- custom_report_details
- server_links
params: name ?
if settings: packet_common_settings
if cookie_response: packet_common_cookie_response
if custom_payload: packet_custom_payload
if finish_configuration: packet_finish_configuration
if keep_alive: packet_keep_alive
if pong: packet_pong
if resource_pack_receive: packet_resource_pack_receive
if select_known_packs: packet_common_select_known_packs
if custom_report_details: packet_common_custom_report_details
if server_links: packet_common_server_links
^play.toClient.types:
SlotDisplay:
type: varint =>
- empty
- any_fuel
- item
- item_stack
- tag
- smithing_trim #TODO: Old versions have typo
- with_remainder
- composite
data: type ?
if empty or any_fuel: void
if item: varint
if item_stack: Slot
if tag: string
if smithing_trim:
base: SlotDisplay
material: SlotDisplay
pattern: ["registryEntryHolder", { "baseName": "patternId", "otherwise": { "name": "data", "type": "ArmorTrimPattern" } }]
if with_remainder:
input: SlotDisplay
remainder: SlotDisplay
if composite: SlotDisplay[]varint
RecipeDisplay:
type: varint =>
- crafting_shapeless
- crafting_shaped
- furnace
- stonecutter
- smithing
data: type ?
if crafting_shapeless:
ingredients: SlotDisplay[]varint
result: SlotDisplay
craftingStation: SlotDisplay
if crafting_shaped:
width: varint
height: varint
ingredients: SlotDisplay[]varint
result: SlotDisplay
craftingStation: SlotDisplay
if furnace:
ingredient: SlotDisplay
fuel: SlotDisplay
result: SlotDisplay
craftingStation: SlotDisplay
duration: varint
experience: f32
if stonecutter:
ingredient: SlotDisplay
result: SlotDisplay
craftingStation: SlotDisplay
if smithing:
template: SlotDisplay
base: SlotDisplay
addition: SlotDisplay
result: SlotDisplay
craftingStation: SlotDisplay
# World state information for spawn and respawn packets
SpawnInfo:
dimension: varint
name: string
hashedSeed: i64
gamemode: i8 =>
- survival
- creative
- adventure
- spectator
previousGamemode: u8
isDebug: bool
isFlat: bool
death?:
dimensionName: string
location: position
portalCooldown: varint
seaLevel: varint
# MC: ClientboundAddEntityPacket
packet_spawn_entity:
entityId: varint
objectUUID: UUID
type: varint
x: f64
y: f64
z: f64
pitch: i8
yaw: i8
headPitch: i8
objectData: varint
velocityX: i16
velocityY: i16
velocityZ: i16
# MC: ClientboundAnimatePacket
packet_animation:
entityId: varint
animation: u8
# MC: ClientboundAwardStatsPacket
packet_statistics:
entries: []varint
categoryId: varint
statisticId: varint
value: