Callback
Index
Interfaces
- BlockChangedFunction
- BreakBlockFunction
- BuildBlockFunction
- ConnectingToHostFunction
- ContainerClosedFunction
- ContainerOpenedFunction
- CoreConfiguredFunction
- CraftRecipePreProvidedFunction
- CraftRecipeProvidedFunction
- CustomBlockTessellationFunction
- CustomDimensionTransferFunction
- CustomWindowFunction
- DestroyBlockContinueFunction
- DestroyBlockFunction
- DimensionChunkFunction
- DimensionLoadedFunction
- DimensionUnloadedFunction
- EntityDeathFunction
- EntityFunction
- EntityHurtFunction
- EntityInteractFunction
- EntityPickUpDropFunction
- ExpAddFunction
- ExpLevelAddFunction
- ExpOrbsSpawnedFunction
- ExplosionFunction
- ExplosionParams
- FoodEatenFunction
- GenerateChunkFunction
- GenerateCustomDimensionChunkFunction
- ItemDispensedFunction
- ItemIconOverrideFunction
- ItemNameOverrideFunction
- ItemUseCoordinates
- ItemUseFunction
- ItemUseNoTargetFunction
- ItemUsingCompleteFunction
- ItemUsingReleasedFunction
- LegacyItemUseFunction
- LevelLoadedFunction
- LevelSelectedFunction
- NativeCommandFunction
- NativeGuiChangedFunction
- PlayerAttackFunction
- PlayerChangedDimensionFunction
- PlayerEatFunction
- PlayerFunction
- PlayerTickFunction
- PopBlockResourcesFunction
- ProjectileHitFunction
- ProjectileHitTarget
- RedstoneSignalFunction
- RedstoneSignalParams
- SavesFunction
- SystemKeyEventDispatchedFunction
- TileEntityAddedFunction
- TileEntityRemovedFunction
- VanillaWorkbenchCraftFunction
- VanillaWorkbenchRecipeSelectedFunction
Type Aliases
Functions
Type Aliases
InferCallbackFunction
Type parameters
- T: unknown[]
Functions
addCallback
Adds callback function for the specified callback name. Most of native events can be prevented using Game.prevent call.
Parameters
name: string
callback name, should be one of the pre-defined or a custom name if invoked via Callback.invokeCallback
func: Function
function to be called when an event occurs
optionalpriority: number
the more this value is, the earlier your callback handler will be called when an event occurs
Returns void
invokeCallback
Invokes callback with any name and up to 10 additional parameters. You should not generally call pre-defined callbacks until you really need to do so. If you want to trigger some event in your mod, use your own callback names.
That feature is obsoleteAvoid untyped callbacks, use generic function to pass argument types and more convenient calls.
Parameters
name: string
callback name
optionalo1: any
optionalo2: any
optionalo3: any
optionalo4: any
optionalo5: any
optionalo6: any
optionalo7: any
optionalo8: any
optionalo9: any
optionalo10: any
Returns void
Module used to handle callbacks. Investigate details about the callback mechanism and the list of pre-defined callbacks.