import type { MinMaxBounds } from 'sandstone/arguments/generated/data/util.ts' import type { SymbolBlock, SymbolEntity, SymbolMcdocBlockStates, SymbolStatisticType, } from 'sandstone/arguments/generated/dispatcher.ts' import type { Registry } from 'sandstone/arguments/generated/registry.ts' import type { EquipmentSlot } from 'sandstone/arguments/generated/util/slot.ts' import type { DataComponentExactPredicate, DataComponentPredicate, } from 'sandstone/arguments/generated/world/component.ts' import type { AxolotlVariant, FoxType, HorseVariant, LlamaVariant, MooshroomType, ParrotVariant, RabbitVariant, TropicalFishPattern, } from 'sandstone/arguments/generated/world/component/entity.ts' import type { BoatType } from 'sandstone/arguments/generated/world/entity/boat.ts' import type { ENTITY_SLOTS } from 'sandstone/arguments' import type { RootNBT } from 'sandstone/arguments/nbt.ts' import type { DamageTypeClass, EnchantmentClass, LabelClass, LiteralUnion, NBTClass, NBTDouble, NBTFloat, NBTInt, NonEmptyString, TagClass, VariantClass, } from 'sandstone' export type AxolotlPredicate = { /** * Value: * * - Lucy(`lucy`) * - Wild(`wild`) * - Gold(`gold`) * - Cyan(`cyan`) * - Blue(`blue`): The rare variant. */ variant: AxolotlVariant, } export type BlockPredicate = { blocks?: (( | Registry['minecraft:block'] | `#${Registry['minecraft:tag/block']}` | TagClass<'block'>) | Array), state?: BlockPredicateState, nbt?: ((NonEmptyString | NBTClass) | (S extends keyof SymbolBlock ? SymbolBlock[S] : SymbolBlock<'%unknown'>)), /** * Match exact data component values on the block entity. */ components?: DataComponentExactPredicate, /** * Test data component values on the block entity. */ predicates?: DataComponentPredicate, } export type BlockPredicateState = SymbolMcdocBlockStates<'%unknown'> export type BoatPredicate = { /** * Value: * * - Oak(`oak`) * - Spruce(`spruce`) * - Birch(`birch`) * - Jungle(`jungle`) * - Acacia(`acacia`) * - DarkOak(`dark_oak`) * - Mangrove(`mangrove`) * - Bamboo(`bamboo`) * - Cherry(`cherry`) */ variant: BoatType, } export type CatPredicate = { variant: (( | Registry['minecraft:cat_variant'] | `#${string}:${string}` | TagClass<'cat_variant'> | VariantClass<'cat'>) | Array<(Registry['minecraft:cat_variant'] | VariantClass<'cat'>)>), } export type DamagePredicate = { /** * Amount of incoming damage before damage reduction. */ dealt?: MinMaxBounds, /** * Amount of incoming damage after damage reduction. */ taken?: MinMaxBounds, /** * Whether the damage was successfully blocked. */ blocked?: boolean, /** * Source of the damage (eg: a skeleton shooting an arrow or player igniting tnt). */ source_entity?: EntityPredicate, type?: DamageSourcePredicate, } export type DamageSourceFlags = { is_explosion?: boolean, is_fire?: boolean, is_magic?: boolean, is_projectile?: boolean, is_lightning?: boolean, bypasses_armor?: boolean, bypasses_invulnerability?: boolean, bypasses_magic?: boolean, } export type DamageSourcePredicate = { /** * Damage type tags that the damage type is in. */ tags?: Array, /** * Source of the damage (eg: a skeleton shooting an arrow or player igniting tnt). */ source_entity?: EntityPredicate, /** * Direct entity responsible for the damage (eg: the arrow or tnt). */ direct_entity?: EntityPredicate, /** * Damage is direct when its direct and source entities are the same. */ is_direct?: boolean, } export type DamageTagPredicate = { id: (( | Registry['minecraft:damage_type'] | `#${Registry['minecraft:tag/damage_type']}` | TagClass<'damage_type'> | DamageTypeClass) | Array<(Registry['minecraft:damage_type'] | DamageTypeClass)>), /** * Whether the damage is expected to have or not have the tag. */ expected: boolean, } export type DistancePredicate = { x?: MinMaxBounds, y?: MinMaxBounds, z?: MinMaxBounds, absolute?: MinMaxBounds, horizontal?: MinMaxBounds, } export type EnchantmentPredicate = { enchantments?: (( | Registry['minecraft:enchantment'] | `#${Registry['minecraft:tag/enchantment']}` | TagClass<'enchantment'> | EnchantmentClass) | Array<(Registry['minecraft:enchantment'] | EnchantmentClass)>), levels?: MinMaxBounds, } export type EntityEffectsPredicate = ({ [Key in Extract]?: MobEffectPredicate }) export type EntityEquipmentPredicate = ({ [Key in Extract]?: ItemPredicate }) export type EntityFlagsPredicate = { is_on_fire?: boolean, is_sneaking?: boolean, is_sprinting?: boolean, is_swimming?: boolean, is_baby?: boolean, is_on_ground?: boolean, is_flying?: boolean, is_in_water?: boolean, is_fall_flying?: boolean, } export type EntityPredicate = EntitySubPredicateMap export type EntitySlotsPredicate = ({ [Key in Extract, string>]?: ItemPredicate }) export type EntitySubPredicate = NonNullable<({ [S in Extract, string>]?: ({ type: S, } & (S extends keyof SymbolEntitySubPredicate ? SymbolEntitySubPredicate[S] : RootNBT)) }[Extract])> export type EntitySubPredicateMap = ({ [Key in Extract]?: (Key extends keyof SymbolEntitySubPredicate ? SymbolEntitySubPredicate[Key] : RootNBT) }) export type EntityTagPredicate = { /** * Must have at least one of the listed tags. */ any_of?: Array, /** * Must have all the listed tags. */ all_of?: Array, /** * Must have none of the listed tags. */ none_of?: Array, } export type EntityTypePredicate = (( | Registry['minecraft:entity_type'] | `#${Registry['minecraft:tag/entity_type']}` | TagClass<'entity_type'>) | Array) export type FishingHookPredicate = { in_open_water?: boolean, } export type FluidPredicate = { fluids?: (( | Registry['minecraft:fluid'] | `#${Registry['minecraft:tag/fluid']}` | TagClass<'fluid'>) | Array), state?: ({ [Key in NonEmptyString]?: (MinMaxBounds | boolean | string) }), } export type FluidPredicateState = ({ [Key in NonEmptyString]?: (MinMaxBounds | boolean | string) }) export type FoodPredicate = { level?: MinMaxBounds, saturation?: MinMaxBounds<(NBTDouble | number)>, } export type FoxPredicate = { /** * Value: * * - Red(`red`) * - Snow(`snow`) */ variant: FoxType, } export type FrogPredicate = { variant: (( | Registry['minecraft:frog_variant'] | `#${string}:${string}` | TagClass<'frog_variant'> | VariantClass<'frog'>) | Array<(Registry['minecraft:frog_variant'] | VariantClass<'frog'>)>), } export type GameMode = ('survival' | 'creative' | 'adventure' | 'spectator') export type HorsePredicate = { /** * Value: * * - White(`white`) * - Creamy(`creamy`) * - Chestnut(`chestnut`) * - Brown(`brown`) * - Black(`black`) * - Gray(`gray`) * - DarkBrown(`dark_brown`) */ variant: HorseVariant, } export type InputPredicate = { forward?: boolean, backward?: boolean, left?: boolean, right?: boolean, jump?: boolean, sneak?: boolean, sprint?: boolean, } export type ItemPredicate = { items?: (( | Registry['minecraft:item'] | `#${Registry['minecraft:tag/item']}` | TagClass<'item'>) | Array), count?: MinMaxBounds, components?: DataComponentExactPredicate, predicates?: DataComponentPredicate, } export type LightningBoltPredicate = { blocks_set_on_fire?: MinMaxBounds, entity_struck?: EntityPredicate, } export type LlamaPredicate = { /** * Value: * * - Creamy(`creamy`) * - White(`white`) * - Brown(`brown`) * - Gray(`gray`) */ variant: LlamaVariant, } export type LocationPredicate = { position?: { x?: MinMaxBounds, y?: MinMaxBounds, z?: MinMaxBounds, }, biomes?: (( | Registry['minecraft:worldgen/biome'] | `#${Registry['minecraft:tag/worldgen/biome']}` | TagClass<'worldgen/biome'>) | Array), structures?: (( | Registry['minecraft:worldgen/structure'] | `#${Registry['minecraft:tag/worldgen/structure']}` | TagClass<'worldgen/structure'>) | Array), dimension?: Registry['minecraft:dimension'], /** * Calculated using: `max(sky-darkening, block)`. */ light?: { light?: MinMaxBounds>, }, block?: BlockPredicate, fluid?: FluidPredicate, /** * Whether the block is above (5 blocks or less) a campfire or soul campfire. */ smokey?: boolean, /** * Whether the location has the maximum possible level of sky light */ can_see_sky?: boolean, } export type LocationPredicateLight = { light?: MinMaxBounds>, } export type LocationPredicatePosition = { x?: MinMaxBounds, y?: MinMaxBounds, z?: MinMaxBounds, } export type MobEffectPredicate = { amplifier?: MinMaxBounds, duration?: MinMaxBounds, ambient?: boolean, visible?: boolean, } export type MooshroomPredicate = { /** * Value: * * - Red(`red`) * - Brown(`brown`) */ variant: MooshroomType, } export type MovementPredicate = { x?: MinMaxBounds, y?: MinMaxBounds, z?: MinMaxBounds, speed?: MinMaxBounds, horizontal_speed?: MinMaxBounds, vertical_speed?: MinMaxBounds, fall_distance?: MinMaxBounds, } export type OldEntityPredicate = NonNullable<({ [S in Extract, string>]?: { type?: S, type_specific?: EntitySubPredicate, team?: NonEmptyString, nbt?: ((NonEmptyString | NBTClass) | (S extends keyof SymbolEntity ? SymbolEntity[S] : RootNBT)), location?: LocationPredicate, distance?: DistancePredicate, flags?: EntityFlagsPredicate, equipment?: EntityEquipmentPredicate, vehicle?: EntityPredicate, passenger?: EntityPredicate, stepping_on?: LocationPredicate, /** * Entity that a mob's AI/aggro is targeting. */ targeted_entity?: EntityPredicate, effects?: EntityEffectsPredicate, slots?: EntitySlotsPredicate, movement?: MovementPredicate, /** * True every `n` ticks of an entity's lifetime. * * Value: * Range: 1.. */ periodic_tick?: NBTInt<{ min: 1, }>, /** * Whether the block at most 0.5 blocks below the entity is present which can affect its movement. */ movement_affected_by?: LocationPredicate, /** * Match exact data component values on the entity. */ components?: DataComponentExactPredicate, /** * Test data component values on the entity. */ predicates?: DataComponentPredicate, } }[Extract])> export type PaintingPredicate = { variant: (( | Registry['minecraft:painting_variant'] | `#${Registry['minecraft:tag/painting_variant']}` | TagClass<'painting_variant'> | VariantClass<'painting'>) | Array<(Registry['minecraft:painting_variant'] | VariantClass<'painting'>)>), } export type ParrotPredicate = { /** * Value: * * - RedBlue(`red_blue`) * - Blue(`blue`) * - Green(`green`) * - YellowBlue(`yellow_blue`) * - Gray(`gray`) */ variant: ParrotVariant, } export type PlayerAdvancementCriteria = ({ [Key in NonEmptyString]?: boolean }) export type PlayerAdvancements = ({ [Key in Extract]?: (boolean | ({ [Key in NonEmptyString]?: boolean })) }) export type PlayerPredicate = { advancements?: ({ [Key in Extract]?: (boolean | ({ [Key in NonEmptyString]?: boolean })) }), gamemode?: Array, /** * Experience/XP level. */ level?: MinMaxBounds, recipes?: ({ [Key in Extract]?: boolean }), stats?: Array, looking_at?: EntityPredicate, /** * Checks the movement keys of the player. */ input?: { forward?: boolean, backward?: boolean, left?: boolean, right?: boolean, jump?: boolean, sneak?: boolean, sprint?: boolean, }, food?: { level?: MinMaxBounds, saturation?: MinMaxBounds<(NBTDouble | number)>, }, } export type PlayerRecipes = ({ [Key in Extract]?: boolean }) export type PostComponentsItemPredicate = { items?: (( | Registry['minecraft:item'] | `#${Registry['minecraft:tag/item']}` | TagClass<'item'>) | Array), count?: MinMaxBounds, components?: DataComponentExactPredicate, predicates?: DataComponentPredicate, } export type PreComponentsItemPredicate = { items?: Array, tag?: (Registry['minecraft:tag/item']), durability?: MinMaxBounds, potion?: Registry['minecraft:potion'], enchantments?: Array, stored_enchantments?: Array, nbt?: NonEmptyString | NBTClass, } export type RabbitPredicate = { /** * Value: * * - Brown(`brown`) * - White(`white`) * - Black(`black`) * - WhiteSplotched(`white_splotched`) * - Gold(`gold`) * - Salt(`salt`) * - Evil(`evil`): Killer rabbit */ variant: RabbitVariant, } export type RaiderPredicate = { has_raid?: boolean, is_captain?: boolean, } export type SalmonPredicate = { /** * Value: * * - Small(`small`) * - Medium(`medium`) * - Large(`large`) */ variant?: SalmonVariant, } export type SalmonVariant = ('small' | 'medium' | 'large') export type SheepPredicate = { sheared?: boolean, } export type SlimePredicate = { size?: MinMaxBounds, } export type SpecificType = ( | 'any' | 'axolotl' | 'boat' | 'cat' | 'fishing_hook' | 'fox' | 'frog' | 'horse' | 'lightning' | 'llama' | 'mooshroom' | 'painting' | 'parrot' | 'player' | 'rabbit' | 'slime' | 'tropical_fish' | 'villager') export type StatisticPredicate = NonNullable<({ [S in Extract, string>]?: { type: S, stat: (S extends keyof SymbolStatisticType ? SymbolStatisticType[S] : SymbolStatisticType<'%unknown'>), value: MinMaxBounds, } }[Extract])> export type TropicalFishPredicate = { /** * Value: * * - Kob(`kob`) * - Sunstreak(`sunstreak`) * - Snooper(`snooper`) * - Dasher(`dasher`) * - Brinely(`brinely`) * - Spotty(`spotty`) * - Flopper(`flopper`) * - Stripey(`stripey`) * - Glitter(`glitter`) * - Blockfish(`blockfish`) * - Betty(`betty`) * - Clayfish(`clayfish`) */ variant: TropicalFishPattern, } export type VillagerPredicate = { variant: Registry['minecraft:villager_type'], } export type WolfPredicate = { variant: (( | Registry['minecraft:wolf_variant'] | `#${string}:${string}` | TagClass<'wolf_variant'> | VariantClass<'wolf'>) | Array<(Registry['minecraft:wolf_variant'] | VariantClass<'wolf'>)>), } type EntitySubPredicateDispatcherMap = { 'components': EntitySubPredicateComponents, 'minecraft:components': EntitySubPredicateComponents, 'distance': EntitySubPredicateDistance, 'minecraft:distance': EntitySubPredicateDistance, 'effects': EntitySubPredicateEffects, 'minecraft:effects': EntitySubPredicateEffects, 'entity_tags': EntitySubPredicateEntityTags, 'minecraft:entity_tags': EntitySubPredicateEntityTags, 'entity_type': EntitySubPredicateEntityType, 'minecraft:entity_type': EntitySubPredicateEntityType, 'equipment': EntitySubPredicateEquipment, 'minecraft:equipment': EntitySubPredicateEquipment, 'flags': EntitySubPredicateFlags, 'minecraft:flags': EntitySubPredicateFlags, 'location': EntitySubPredicateLocation, 'minecraft:location': EntitySubPredicateLocation, 'movement': EntitySubPredicateMovement, 'minecraft:movement': EntitySubPredicateMovement, 'movement_affected_by': EntitySubPredicateMovementAffectedBy, 'minecraft:movement_affected_by': EntitySubPredicateMovementAffectedBy, 'nbt': EntitySubPredicateNbt, 'minecraft:nbt': EntitySubPredicateNbt, 'passenger': EntitySubPredicatePassenger, 'minecraft:passenger': EntitySubPredicatePassenger, 'periodic_tick': EntitySubPredicatePeriodicTick, 'minecraft:periodic_tick': EntitySubPredicatePeriodicTick, 'predicates': EntitySubPredicatePredicates, 'minecraft:predicates': EntitySubPredicatePredicates, 'slots': EntitySubPredicateSlots, 'minecraft:slots': EntitySubPredicateSlots, 'stepping_on': EntitySubPredicateSteppingOn, 'minecraft:stepping_on': EntitySubPredicateSteppingOn, 'targeted_entity': EntitySubPredicateTargetedEntity, 'minecraft:targeted_entity': EntitySubPredicateTargetedEntity, 'team': EntitySubPredicateTeam, 'minecraft:team': EntitySubPredicateTeam, 'type_specific/cube_mob': EntitySubPredicateTypeSpecificCubeMob, 'minecraft:type_specific/cube_mob': EntitySubPredicateTypeSpecificCubeMob, 'type_specific/fishing_hook': EntitySubPredicateTypeSpecificFishingHook, 'minecraft:type_specific/fishing_hook': EntitySubPredicateTypeSpecificFishingHook, 'type_specific/lightning': EntitySubPredicateTypeSpecificLightning, 'minecraft:type_specific/lightning': EntitySubPredicateTypeSpecificLightning, 'type_specific/player': EntitySubPredicateTypeSpecificPlayer, 'minecraft:type_specific/player': EntitySubPredicateTypeSpecificPlayer, 'type_specific/raider': EntitySubPredicateTypeSpecificRaider, 'minecraft:type_specific/raider': EntitySubPredicateTypeSpecificRaider, 'type_specific/sheep': EntitySubPredicateTypeSpecificSheep, 'minecraft:type_specific/sheep': EntitySubPredicateTypeSpecificSheep, 'vehicle': EntitySubPredicateVehicle, 'minecraft:vehicle': EntitySubPredicateVehicle, } type EntitySubPredicateKeys = keyof EntitySubPredicateDispatcherMap type EntitySubPredicateFallback = ( | EntitySubPredicateComponents | EntitySubPredicateDistance | EntitySubPredicateEffects | EntitySubPredicateEntityTags | EntitySubPredicateEntityType | EntitySubPredicateEquipment | EntitySubPredicateFlags | EntitySubPredicateLocation | EntitySubPredicateMovement | EntitySubPredicateMovementAffectedBy | EntitySubPredicateNbt | EntitySubPredicatePassenger | EntitySubPredicatePeriodicTick | EntitySubPredicatePredicates | EntitySubPredicateSlots | EntitySubPredicateSteppingOn | EntitySubPredicateTargetedEntity | EntitySubPredicateTeam | EntitySubPredicateTypeSpecificCubeMob | EntitySubPredicateTypeSpecificFishingHook | EntitySubPredicateTypeSpecificLightning | EntitySubPredicateTypeSpecificPlayer | EntitySubPredicateTypeSpecificRaider | EntitySubPredicateTypeSpecificSheep | EntitySubPredicateVehicle) type EntitySubPredicateComponents = DataComponentExactPredicate type EntitySubPredicateDistance = DistancePredicate type EntitySubPredicateEffects = EntityEffectsPredicate type EntitySubPredicateEntityTags = EntityTagPredicate type EntitySubPredicateEntityType = EntityTypePredicate type EntitySubPredicateEquipment = EntityEquipmentPredicate type EntitySubPredicateFlags = EntityFlagsPredicate type EntitySubPredicateLocation = LocationPredicate type EntitySubPredicateMovement = MovementPredicate type EntitySubPredicateMovementAffectedBy = LocationPredicate type EntitySubPredicateNbt = ((NonEmptyString | NBTClass) | SymbolEntity<'%fallback'>) type EntitySubPredicatePassenger = EntityPredicate type EntitySubPredicatePeriodicTick = NBTInt<{ min: 1, }> type EntitySubPredicatePredicates = DataComponentPredicate type EntitySubPredicateSlots = EntitySlotsPredicate type EntitySubPredicateSteppingOn = LocationPredicate type EntitySubPredicateTargetedEntity = EntityPredicate type EntitySubPredicateTeam = NonEmptyString type EntitySubPredicateTypeSpecificCubeMob = SlimePredicate type EntitySubPredicateTypeSpecificFishingHook = FishingHookPredicate type EntitySubPredicateTypeSpecificLightning = LightningBoltPredicate type EntitySubPredicateTypeSpecificPlayer = PlayerPredicate type EntitySubPredicateTypeSpecificRaider = RaiderPredicate type EntitySubPredicateTypeSpecificSheep = SheepPredicate type EntitySubPredicateVehicle = EntityPredicate export type SymbolEntitySubPredicate = CASE extends 'map' ? EntitySubPredicateDispatcherMap : CASE extends 'keys' ? EntitySubPredicateKeys : CASE extends '%fallback' ? EntitySubPredicateFallback : never