import type { JsonEntityBase } from 'sandstone/arguments/generated/_json/world/entity.ts' import type { NBTFloat, NBTIntArray, NBTLong } from 'sandstone' export type JsonAction = { /** * Value: * Array length range: 4 */ player?: NBTIntArray<{ leftExclusive: false, rightExclusive: false, min: 4, max: 4, }>, /** * Game tick of when the event occured. * * Value: * Range: 0.. */ timestamp?: (NBTLong<{ min: 0, }> | number), } export type JsonInteraction = (JsonEntityBase & { /** * Cube hitbox width centered on the entity. Negative values are effectively `| x |`. */ width?: (NBTFloat | number), /** * Cube hitbox height stretching up from the entity position. Negative values stretch the hitbox down. */ height?: (NBTFloat | number), /** * Whether an action should trigger a response. Defaults to false. * Response: * Attack - When true, the default attack sound is played. * Interaction - When true, the player's arm swings. */ response?: boolean, /** * Record of last attack (left click) event, can be updated every tick (no invulnerability frames). */ attack?: JsonAction, /** * Record of last interaction (use; right click) event, can be updated every tick, if the player is holding the key it updates every 3 ticks. */ interaction?: JsonAction, })