PROMT: want you to act as a Bloxd.io coder AI that helps me only with Bloxd.io world code and code blocks. Your main job is to help me write code, fix errors, explain how things work, and create custom mechanics or game modes inside Bloxd.io. I do not know anything about coding. I only know how to copy and paste code, so treat me like a complete beginner and explain everything in the simplest way possible, step by step. I will ask you questions about Bloxd.io coding, and you must always answer based on how Bloxd.io actually works. Do not assume features from normal JavaScript or Minecraft unless they are clearly supported in Bloxd.io. For APIs, syntax, variables, and functions, always follow this website as the main and highest priority reference: https://github.com/Bloxdy/code-api You may also use this website for explanations and examples of code blocks: https://bloxd-io.fandom.com/wiki/Code_Block Before generating any code for me, make sure the code matches the Bloxd.io API and does not use unsupported features. Avoid guessing. If something is not confirmed in the API, clearly say so instead of making it up. Bloxd.io is a free to play, browser based multiplayer sandbox game inspired by Minecraft. It uses block based graphics and includes modes such as Survival, Creative, Peaceful, EvilTower parkour, and competitive PvP modes like Bedwars and Skywars. The game uses a fast paced 100 health system and runs on web browsers, Android, and the Microsoft Store. Bloxd.io allows players to create custom worlds and games using world code and code blocks. On PC, world code can be opened by pressing F8. On mobile devices, coding is done by placing code blocks in the world. Code blocks are used to run logic, detect players, trigger events, and control world behavior. You should clearly explain the difference between world code and code block code and tell me which one should be used in each situation. You should explain built in variables, functions, and events in very simple language. Any code you give should be short, clean, correct, and easy to copy and paste. Your goal is to help me build fun systems, custom mechanics, and full game modes in Bloxd.io while teaching me slowly and clearly, assuming I have no coding knowledge at all. Do not use comments (//) in the code unless I specifically ask for an explanation. Always give me plain, ready-to-use code. Use comments only when I ask you to explain something in the code. I will provide copy-pasted information from the Bloxd.io API and all item and block names. You must always use the correct names from these lists when making code. Do not invent or guess any item or block names. Always check and follow the official API and the item/block lists I provide. Accuracy is more important than making something work quickly. Never create code that could cause errors or bugs because of wrong names or unsupported functions. Everything I found in bloxd.io code api website (https://github.com/Bloxdy/code-api) Copy Pasting here for you: ( i copied the raw file and pasteing here ) Changelog Here you can discover the latest changes to the API. 11th May 2026 Added Changelog Added a bunch of new API Methods: api.addCustomKillfeedMessage api.deleteAllItems api.findItem api.findStandardChestItem api.getEffectLevel api.getItemDropName api.getItemIDsOverlappingWithPlayer api.getMobDbId api.hasEffect api.preventFallDamageNextGrounding api.removeItemNameFromStandardChest api.resetCanChangeBlock api.resetCanPickUpItem api.setOtherEntitySettingToDefault api.updateMeshParticleSystems 7th May 2026 Added api.copyChunk Added onPlayerToggledShopMenu 28th April 2026 Doubled code block size (16000 -> 32000) 'Hide World Code' option renamed to 'Hide Code' and also hides code of Code Blocks New docs page! 23rd April 2026 Added api.matchmakePlayer Added per-item gun stats in customAttributes.gunStats 21st April 2026 Added database methods to write persisted data to be saved between sessions. There are two sections of database values: Lobby api.getLobbyDBValue api.setLobbyDBValue api.deleteLobbyDBValue api.deleteAllLobbyDBValues Writes data that is persisted to the *lobby*, whether it's a worlds lobby or a lobby within a custom game Player api.getDBValue api.setDBValue api.deletePlayerDBValue api.deleteAllPlayerDBValues Writes data that is persisted to the player. For custom games, this data persists *between* lobbies 16th April 2026 Added api.setItemStat 11th April 2026 The Code Editor now supports collaborative editing You can now simultaneously code with your other fellow coders at the same time! Hop into a code block or World Code together to simultaneously create the best World or the best Custom Game ever!! 7th April 2026 New Code Editor UI! Syntax Highlighting, Autocomplete, Error Checking, and more! 25th March 2026 Increased world code size from 16000 to 64000 characters 24th March 2026 Added mesh entities! api.attemptCreateMeshEntity api.updateMeshEntity api.deleteMeshEntity Added throwables! api.attemptCreateThrowable api.deleteThrowable 23rd March 2026 Added the ability to open and close chests for players, going beyond reach distance to open chests from far away api.openChestForPlayer api.closeChestForPlayer # API Reference ## addFollowingEntityToPlayer Add following entity to player ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | eId | `EntityId` | | | offset | `number[]` | | | followsPlayerRotation | `boolean` | | ## addQTE Create and register the UI for the requested quicktime event (QTE) to the screen. Handle the result via the onPlayerFinishQTE engine callback. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | qteParameters | `QTEClientParameters` | includes type and parameters | ### Returns: `QTERequestId` an id that can be passed to deleteQTE ## animateEntity Animates the given entity. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | entityId | `EntityId` | | | animationSchema | `AnimationSchema \| BlockbenchAnimationSchema` | | | initialTimeFraction | `number` | | | animationSpeed | `number` | | ## applyAuraChange Add (or remove if negative) aura to a player. Will not go over max level or under 0 ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | auraDiff | `number` | | ### Returns: `number` The actual change in aura ## applyEffect Apply an effect to a lifeform. Can be an inbuilt effect E.g. "Speed" (speed boost), "Damage" (damage boost). For inbuilt just pass the name of the effect and the functionality is handled in-engine. For custom effect, you pass customEffectInfo. The icon can be an InGameIconName or a bloxd item name. The custom effect onEndCb is an optional helper within which you can undo the effect you applied. Note that onEndCb will not work for press to code boards, code blocks or world code. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | lifeformId | `LifeformId` | | | effectName | `string` | | | duration | `number \| null` | | | customEffectInfo | ` { icon?: IngameIconName \| ItemName; onEndCb?: () => void; displayName?: string \| TranslatedText } & Partial ` | | ## applyHealthChange ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | lifeformId | `LifeformId` | | | changeAmount | `number` | Must be an integer. A positive amount will increase the entity's health. A negative amount will decrease the entity's shield first, then their health. | | whoDidDamage | ` LifeformId \| { lifeformId: LifeformId; withItem: string } ` | Optional - If damage done by another player | | broadcastLifeformHurt | `boolean` | | ### Returns: `boolean` ## applyImpulse Apply an impulse to an entity ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | eId | `EntityId` | | | xImpulse | `number` | | | yImpulse | `number` | | | zImpulse | `number` | | ## applyMeleeHit Make it as if hittingEId hit hitEId ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | hittingEId | `LifeformId` | | | hitEId | `LifeformId` | | | dirFacing | `number[]` | | | bodyPartHit | `PNull` | | | overrides | ` { damage?: PNull heldItemName?: PNull horizontalKbMultiplier?: number verticalKbMultiplier?: number } ` | | ### Returns: `boolean` ## attemptApplyDamage Apply damage to a lifeform. eId is the player initiating the damage, hitEId is the lifeform being hit. It is recommended to self-inflict damage when the game code wants to apply damage to a lifeform. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | { eId, hitEId, attemptedDmgAmt, withItem, bodyPartHit = undefined, attackDir = undefined, showCritParticles = false, reduceVerticalKbVelocity = true, horizontalKbMultiplier = 1, verticalKbMultiplier = 1, broadcastEntityHurt = true, attackCooldownSettings = null, hittingSoundOverride = null, ignoreOtherEntitySettingCanAttack = false, isTrueDamage = false, damagerDbId = null, } | `PlayerAttemptDamageOtherPlayerOpts` | | ### Returns: `boolean` whether the attack damaged the lifeform ## attemptCreateMeshEntity Try to create a mesh entity. This creates an entity whose mesh position is synced with clients. Set entity position using setPosition There is a limit to the number of mesh entities and throwables that can be created, with an even smaller limit for mesh entities with physics. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | type | `MeshType` | | | opts | `MeshEntityOpts[MeshType]` | | | name | `string` | The default name for the nametag | | physicsOptions | `MeshEntityPhysicsOpts` | Physics Options | | initiatorId | `EntityId` | The entity that initiated the creation of the mesh entity. | ### Returns: `PNull` null if the entity creation failed, otherwise the entity ID. ## attemptCreateThrowable Try to create a throwable entity. Similar to creating a mesh entity and uses the same rate limiting. However, this uses the predefined throwables system and physics used by throwable items with the game Each throwable item has its own behaviour already, including default velocity, damage and gravity multipliers. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | throwerEId | `EntityId` | | | itemName | `ThrowableItem` | Must be an Item that is usually throwable in-engine | | position | `[number, number, number]` | Starting position | | direction | `[number, number, number]` | | | velocityMult | `number` | Multiplier for the default velocity of the throwable item | | damageMult | `number` | Multiplier for the default damage of the throwable item | | gravityMult | `number` | Multiplier for the default gravity of the throwable item | | attributes | `ItemAttributes` | item attributes (currently used only for the "Boomerag" item) | ### Returns: `string` null if throwable creation failed, otherwise the entity ID. ## attemptSpawnMob Try to spawn a mob into the world at a given position. Returns null on failure. WARNING: Either the "onPlayerAttemptSpawnMob" or the "onWorldAttemptSpawnMob" game callback will be called depending on whether "spawnerId" is provided. Calling this function inside those callbacks risks infinite recursion. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | mobType | `TMobType` | | | x | `number` | | | y | `number` | | | z | `number` | | | opts | `MobSpawnOpts` | Includes: - mobHerdId The ID of this mob's herd. (A mob herd represents a collection of mobs that move together.) - spawnerId The ID of the player who tried to spawn this mob. - mobDbId A persistent ID for the mob. This can be useful when loading mob data from the database. If the DB ID is already taken, null will be returned. - name If set, gives the mob a name that will be displayed as a nametag above their head. - playSoundOnSpawn - variation - physicsOpts { width: number; height: number; collidesEntities: boolean } | ### Returns: `PNull` null if the mob could not be spawned. This can happen when there are too many mobs in the world for the current number of players in the lobby, or if the area is protected e.g. by spawn area protection. ## attemptWorldChangeBlock Initiate a block change "by the world". This ends up calling the onWorldChangeBlock and only makes the change if not prevented by game/plugins. initiatorDbId is null if the change was initiated by the game code. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | initiatorDbId | `PNull` | | | x | `number` | | | y | `number` | | | z | `number` | | | blockName | `BlockName` | | | extraInfo | `WorldBlockChangedInfo` | | ### Returns: `"preventChange" | "preventDrop" | void` "preventChange" if the change was prevented, "preventDrop" if the change was allowed but without dropping any items, and undefined if the change was allowed with an item drop ## blockCoordToChunkId Get the unique id of the chunk containing pos in the current map ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | pos | `number[]` | | ### Returns: `string` ## blockIdToBlockName Goes from block id to block name. The reverse of blockNameToBlockId ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | blockId | `BlockId` | | ### Returns: `BlockName` ## blockNameToBlockId Get the numeric id of a block used in the ndarrays returned from getChunk I.e. chunk.blockData.set(x, y, z, api.blockNameToBlockId("Dirt")) or chunk.blockData.get(x, y, z) === api.blockNameToBlockId("Dirt") ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | blockName | `BlockName` | | | allowInvalidBlock | `boolean` | Don't throw an error if the block name is invalid. Defaults false. If true and name is invalid, returns null. | ### Returns: `PNull` ## broadcastMessage Send a message to everyone ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | message | `string \| CustomTextStyling` | The text contained within the message. Can use `Custom Text Styling`. | | style | ` { fontWeight?: number \| string; color?: string } ` | An optional style argument. Can contain values for fontWeight and color of the message. style is ignored if message uses custom text styling (i.e. is not a string). | ## broadcastSound See documentation for api.playSound ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | soundName | `string` | | | volume | `number` | | | rate | `number` | | | posSettings | ` { playerIdOrPos: PlayerId \| number[] maxHearDist?: number refDistance?: number } ` | | | exceptPlayerId | `PlayerId` | | ## calcExplosionForce ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | eId | `EntityId` | | | explosionType | `ExplosionType` | | | knockbackFactor | `number` | | | explosionRadius | `number` | | | explosionPos | `number[]` | | | ignoreProjectiles | `boolean` | | ### Returns: ` { force: [number, number, number]; forceFrac: number; } ` ## canOpenStandardChest Checks if a player is able to open a chest at a given location, as per the rules laid out by the "onPlayerAttemptOpenChest" game callback. Returns true if the player can open the chest, false if they cannot, and void if the chest does not exist. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | chestX | `number` | | | chestY | `number` | | | chestZ | `number` | | ### Returns: `PNull` ## changePlayerIntoSkin Change a part of a player's skin. UGC code is restricted to cosmetics from packs with ugcSelectable; internal code can use any cosmetics. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | Player to change | | cosmeticType | `CosmeticType` | Type of cosmetic | | cosmeticName | `CosmeticName` | Chosen cosmetic, will be made lowercase automatically | ## checkValid Check your game (and, optionally, a entity) is still valid and executing. Useful if you're using async functions and await within your game. If you use await/async or promises and do not check this, your game could have closed and then the rest of your async code executes. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | entityId | `PNull` | | ### Returns: `boolean` ## chunkIdToBotLeftCoord Get the co-ordinates of the block in the chunk with the lowest x, y, and z co-ordinates ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | chunkId | `string` | | ### Returns: `[number, number, number]` ## clearDirectionArrow Clear a directional arrow from the player's screen. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The player to clear the arrow for | | id | `PNull` | The arrow identifier to clear. If null, clears all arrows for this player. | ## clearInventory Clear the players inventory ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | ## clearKillstreak Clears the player's current killstreak ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | ## closeChestForPlayer Close a chest for a player. If the player does not have a chest open, do nothing. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | ## configureShopCategory Set properties of a shop category. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | categoryKey | `ShopCategoryKey` | The key of the category to configure | | config | `ShopCategoryConfig` | Category configuration properties | ## configureShopCategoryForPlayer Configure a shop category for a specific player. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The player to configure the category for | | categoryKey | `ShopCategoryKey` | The key of the category to configure | | config | `ShopCategoryConfig` | Category configuration properties | ## createItemDrop Create a dropped item. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | x | `number` | | | y | `number` | | | z | `number` | | | itemName | `ItemName` | Name of the item. Any item name, including blocks and 'Air' | | amount | `PNull` | The amount of the item to include in the drop - so when the player picks up the item drop, they get this many of the item. | | mergeItems | `boolean` | Whether to merge the item into a nearby item of same type, if one exists. Defaults to false. | | attributes | `ItemAttributes` | Attributes of the item being dropped | | timeTillDespawn | `number` | Time till the item automatically despawns in milliseconds. Max of 5 mins. | | dropperId | `PNull` | Who dropped the item. | | options | `ItemDropOptions` | Additional options, such as doPhysics and size. | ### Returns: `PNull` the id you can pass to setCantPickUpItem, or null if the item drop limit was reached ## createMobHerd Create a mob herd. A mob herd represents a collection of mobs that move together. ### Returns: `MobHerdId` ## createShopItem Create a new shop item under the given category. Will create a new category if it does not exist. If the shop item already exists then it will be replaced. If any per-player overrides exist under the same categoryKey and itemKey then they will be deleted. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | categoryKey | `ShopCategoryKey` | The key of the category to create the item in | | itemKey | `ShopItemKey` | The unique key for the item | | item | `ShopItem` | The shop item to create (will be mutated) | ## createShopItemForPlayer Create a new shop item for a specific player. Will create a new category if it does not exist. Will replace any overrides this player already has for the same item. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The player to create the item for | | categoryKey | `ShopCategoryKey` | The key of the category to create the item in | | itemKey | `ShopItemKey` | The unique key for the item | | item | `ShopItem` | The shop item to create (will be mutated) | ## deleteAllLobbyDbValues Deletes all database values that are saved per lobby. ## deleteAllPlayerDbValues Deletes all database values that are saved per player. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | ## deleteItemDrop Delete an item drop by item drop entity ID ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | itemId | `EntityId` | | ## deleteLobbyDbValue Deletes a database value that is saved per lobby. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | key | `string` | | ## deleteMeshEntity Delete a mesh entity ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | eId | `EntityId` | Returns whether the api successfully deleted the meshEntity | ### Returns: `boolean` ## deletePlayerDbValue Deletes a database value that is saved per player. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | key | `string` | | ## deleteQTE Delete a quicktime event from the screen ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | id | `QTERequestId` | Returned from the addQTE request you want to cancel | ## deleteShopItem Delete an existing shop item. Throws an error if the item does not exist. Will also delete all per-player overrides for the shop item. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | categoryKey | `ShopCategoryKey` | The key of the category containing the item | | itemKey | `ShopItemKey` | The unique key for the item | ## deleteThrowable Delete a throwable entity before it automatically removes itself. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | eId | `EntityId` | | ### Returns: `boolean` true if the entity was deleted, false if it was not a throwable entity ## despawnMob Dispose of a mob's state and remove them from the world without triggering "on death" flows. Always succeeds. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | mobId | `MobId` | | ## editItemCraftingRecipes Edit the crafting recipes for a player. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | itemName | `ItemName` | | | recipesForItem | `RecipesForItem` | | ## forceRespawn Force respawn a player ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | respawnPos | `number[]` | | ## getAuraInfo Get the aura info for a player ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | ### Returns: ` { level: number; totalAura: number; auraPerLevel: number } ` ## getBlock Get the name of a block. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | x | `number \| number[]` | could be an array [x, y, z]. If so, the other params shouldn't be passed. | | y | `number` | | | z | `number` | | ### Returns: `BlockName` ## getBlockCoordinatesPlayerStandingOn Get the co-ordinates of the blocks the player is standing on as a list. For example, if the center of the player is at 0,0,0 this function will return [[0, -1, 0], [-1, -1, 0], [0, -1, -1], [-1, -1, -1]] If the player is just standing on one block, the function would return e.g. [[0, 0, 0]] If the player is middair then returns an empty list []. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | ### Returns: `number[][]` ## getBlockData Get stored data about a block in a performant manner. Data is cleared when block changes. E.g. chest Works well with blocks marked tickable (e.g. wheat) ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | x | `number` | | | y | `number` | | | z | `number` | | ### Returns: `any` ## getBlockId Used to get the block id at a specific position. Intended only for use in hot code paths - default to getBlock for most use cases ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | x | `number` | | | y | `number` | | | z | `number` | | ### Returns: `BlockId` ## getBlockSolidity Returns whether a block is solid or not. E.g. Grass block is solid, while water, ladder and water are not. Will be true if the block is unloaded. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | x | `number \| number[]` | | | y | `number` | | | z | `number` | | ### Returns: `boolean` ## getBlockTypesPlayerStandingOn Get the types of block the player is standing on For example, if a player is standing on 4 dirt blocks, this will return ["Dirt", "Dirt", "Dirt", "Dirt"] ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | ### Returns: `any[]` ## getChunk Only use this instead of getBlock if you REALLY need the performance (i.e. you are iterating over tens of thousands of blocks) ReturnedObject.blockData is a 32x32x32 ndarray of block ids (see https://www.npmjs.com/package/ndarray) Each block id is a 16-bit number The ndarray should only be read from, writing to it will result in desync between the server and client ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | pos | `number[]` | The returned chunk contains pos | ### Returns: `PNull` null if the chunk is not loaded in a persisted world. ReturnedObject.blockData is an ndarray that can be accessed (but modifications have to be saved with resetChunk). ## getClientOption Returns the current value of a client option ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | option | `PassedOption` | | ### Returns: `ClientOptions[PassedOption]` ## getCurrentKillstreak Gets the player's current killstreak ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | ### Returns: `number` ## getDefaultMobSetting Returns the current default value for a mob setting. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | mobType | `TMobType` | | | setting | `TMobSetting` | | ### Returns: `MobSettings[TMobSetting]` ## getEffects Get all the effects currently applied to a lifeform. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | lifeformId | `LifeformId` | | ### Returns: `string[]` ## getEmptyChunk Use this to get a chunk ndarray you can edit and set in resetChunk. Only use chunk helpers if you REALLY need the performance (i.e. you are iterating over tens of thousands of blocks) ReturnedObject.blockData is a 32x32x32 ndarray of air. (see https://www.npmjs.com/package/ndarray) Each block id is a 16-bit number ### Returns: `GameChunk` ## getEntitiesInRect Get the entities in the rect between [minX, minY, minZ] and [maxX, maxY, maxZ] ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | minCoords | `number[]` | | | maxCoords | `number[]` | | ### Returns: `EntityId[]` ## getEntityHeading ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | entityId | `EntityId` | | ### Returns: `number` ## getEntityName Get the in game name of an entity. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | entityId | `EntityId` | | ### Returns: `string` ## getEntityRotation Get the rotation for a server-auth entity. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | entityId | `EntityId` | | ### Returns: `[number, number, number]` ## getEntityType ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | entityId | `EntityId` | | ### Returns: `EntityType` ## getHealth Get the current health of an entity. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | entityId | `PlayerId` | | ### Returns: `number` ## getHeldItem Get the currently held item of a player Returns null if no item is being held If an item is held, return an object of the format {name: itemName, amount: amountOfItem} ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | ### Returns: `PNull` ## getInitialItemMetadata Get the metadata about a block or item before stats have been modified by any client options (i.e. its entry in the initial metadata object) ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | itemName | `string` | | ### Returns: `Partial` ## getInventoryFreeSlotCount Get the amount of free slots in a player's inventory. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | ### Returns: `number` number ## getInventoryItemAmount The amount of an itemName a player has. Returns 0 if the player has none, and a negative number if infinite. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | itemName | `ItemName` | | ### Returns: `number` number ## getItemSlot Get the item at a specific index Returns null if there is no item at that index If there is an item, return an object of the format { name: string; amount: PNull; attributes: ItemAttributes; } ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | itemSlotIndex | `number` | | ### Returns: `PNull` ## getItemStat Get stat info about a block or item Either based on a client option for a player: (e.g. `DirtTtb`) or its entry in the initial metadata object if no client option is set. If null is passed for lifeformId, this is simply its entry in blockMetadata etc. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | lifeformId | `PNull` | | | itemName | `ItemName` | | | stat | `K` | | ### Returns: `AnyMetadataItem[K]` ## getLobbyDbValue Gets a database value that is saved per lobby. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | key | `string` | | ### Returns: `PNull` ## getLobbyName Get the name of the lobby this game is running in. ### Returns: `string` ## getLobbyType Returns if the current lobby the game is running in is special - e.g. a discord guild or dm, or simply a standard lobby ### Returns: `LobbyType` ## getMetaInfo Splits the block name by '|'. If no meta info, metaInfo is '' ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | blockName | `BlockName \| null \| undefined` | | ### Returns: `ItemMetaInfo` ## getMobAiState Gets the current AI state for the given mob. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | mobId | `MobId` | | ### Returns: ` { state: MobAiState; params: MobAiStateParams } ` ## getMobIds Get the mob IDs of all mobs in the world. ### Returns: `MobId[]` ## getMobSetting Get the current value of a mob setting for a specific mob. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | mobId | `MobId` | | | setting | `TMobSetting` | | | returnDefaultIfNotOverridden | `boolean` | If true, return the default setting if not overridden. | ### Returns: `MobSettings[TMobSetting]` ## getMoonstoneChestItems Get all the items from a moonstone chest in order. Use this instead of repetitive calls to getMoonstoneChestItemSlot Moonstone chests are a type of chest where a player accesses the same contents no matter the location of the moonstone chest ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | ### Returns: `PNull[]` ## getMoonstoneChestItemSlot Get the item in a player's moonstone chest slot. Null if empty Moonstone chests are a type of chest where a player accesses the same contents no matter the location of the moonstone chest ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | idx | `number` | | ### Returns: `PNull` ## getNumMobs Get the number of mobs in the world. ### Returns: `number` ## getNumPlayers Get the number of players in the room ### Returns: `number` ## getOtherEntitySetting Get the value of a player's other-entity setting for a specific entity. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | relevantPlayerId | `PlayerId` | | | targetedEntityId | `EntityId` | | | settingName | `Setting` | | ### Returns: `OtherEntitySettings[Setting]` ## getPlayerCosmetic Get a single equipped cosmetic for a player. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | cosmeticType | `CosmeticType` | Type of cosmetic | ### Returns: `CosmeticName` ## getPlayerDbId Given a player, get their permanent identifier that doesn't change when leaving and re-entering ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | ### Returns: `PlayerDbId` ## getPlayerDbValue Gets a database value that is saved per player. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | key | `string` | | ### Returns: `PNull` ## getPlayerFacingInfo Get the position of a player's camera and the direction (both in Euclidean and spherical coordinates) they are attempting to use an item. The camPos has the same limitations described in getPlayerTargetInfo ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | ### Returns: ` { camPos: [number, number, number]; dir: [number, number, number]; angleDir: AngleDir; moveHeading: number } ` ## getPlayerId Given the name of a player, get their id ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerName | `string` | | ### Returns: `PNull` ## getPlayerIdFromDbId Returns null if player not in lobby ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | dbId | `PlayerDbId` | | ### Returns: `PNull` ## getPlayerIds Get all the player ids. ### Returns: `PlayerId[]` ## getPlayerPartyWhenJoined Returns the party that the player was in when they joined the game. The returned object contains the playerDbIds, as well as the playerIds if available, of the party leader and members. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | ### Returns: `PNull<{ partyCode: string; playerDbIds: PlayerDbId[] }>` ## getPlayerPhysicsState Get physics state for player ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | ### Returns: `PlayerPhysicsStateData` ## getPlayerTargetInfo Get the position of a player's target block and the block adjacent to it (e.g. where a block would be placed) Note: This position is a tick ahead of the client's block target info (noa.targetedBlock), since the client updates the blocktarget before the entities tick (and since it uses the renderposition of the camera) This normally doesn't matter but if you are client predicting something based on noa.targetedBlock (currently only applicable to in-engine code), you should not verify using this ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | ### Returns: ` { position: [number, number, number]; normal: [number, number, number]; adjacent: [number, number, number] } ` ## getPosition Get position of a player / entity. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | entityId | `EntityId` | | ### Returns: `[number, number, number]` ## getSelectedInventorySlotI Get a player's currently selected inventory slot ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | ### Returns: `number` ## getShieldAmount Get the current shield of an entity. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | entityId | `EntityId` | | ### Returns: `number` ## getStandardChestFreeSlotCount Get the amount of free slots in a standard chest Returns null for non-chests ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | chestPos | `number[]` | | ### Returns: `PNull` number ## getStandardChestItemAmount The amount of an itemName a standard chest has. Returns 0 if the standard chest has none, and a negative number if infinite. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | chestPos | `number[]` | | | itemName | `ItemName` | | ### Returns: `number` number ## getStandardChestItems Get all the items from a standard chest in order. Use this instead of repetitive calls to getStandardChestItemSlot ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | chestPos | `number[]` | | ### Returns: `PNull[]` ## getStandardChestItemSlot Get the item at a chest slot. Null if empty otherwise format {name: itemName, amount: amountOfItem} ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | chestPos | `number[]` | | | idx | `number` | | ### Returns: `PNull` ## getUnitCoordinatesLifeformWithin Get the up to 12 unit co-ordinates the lifeform is located within (A lifeform is modelled as having four corners and can be in up to 3 blocks vertically) ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | lifeformId | `LifeformId` | | ### Returns: `number[][]` List of x, y, z positions e.g. [[-1, 0, 0], [-1, 1, 0], [-1, 2, 0]] ## getVelocity Get the velocity of an entity Will return [0, 0, 0] if the entity doesn't have a physics body ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | eId | `EntityId` | | ### Returns: `[number, number, number]` ## giveItem Inventory stuff Give a player an item and a certain amount of that item. Returns the amount of item added to the users inventory. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | itemName | `ItemName` | | | itemAmount | `number` | | | attributes | `ItemAttributes` | An optional object for certain types of item. For guns this can contain the shotsLeft field which is the amount of ammo the gun currently has. | ### Returns: `number` ## giveStandardChestItem Give a standard chest an item and a certain amount of that item. Returns the amount of item added to the chest. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | chestPos | `number[]` | | | itemName | `ItemName` | | | itemAmount | `number` | | | playerId | `PlayerId` | The player who is interacting with the chest. | | attributes | `ItemAttributes` | An optional object for certain types of item. For guns this can contain the shotsLeft field which is the amount of ammo the gun currently has. | ### Returns: `number` ## hasActiveQTE Returns whether the player has any qteRequests ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | ### Returns: `boolean` ## hasItem Whether a player has an item ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | itemName | `ItemName` | | ### Returns: `boolean` bool ## initiateMiddleScreenBar This will initiate the MiddleScreenBar, starting at empty and filling up to full over the given duration. Good to represent cooldowns (eg gun reload) or charged items (eg crossbow) ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | duration | `number` | ms over which the MiddleScreenBar fills up | | chargeExpiresAutomatically | `boolean` | Defaults to true. If true, the bar will disappear upon reaching full. If false, the bar will remain at full until hidden with removeMiddleScreenBar | | horizontalBarRemOffset | `number` | Offset the bar left or right (in css unit - rem) | ## inventoryIsFull Whether the player has space in their inventory to get new blocks ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | ### Returns: `boolean` ## isAlive Whether a lifeform is alive or dead (or on the respawn screen, in a player's case). ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | lifeformId | `LifeformId` | | ### Returns: `boolean` ## isBlockInLoadedChunk Check if the block at a specific position is in a loaded chunk. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | x | `number` | | | y | `number` | | | z | `number` | | ### Returns: `boolean` ## isInsideRect Check if a position is within a cubic rectangle ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | coordsToCheck | `number[]` | | | pos1 | `number[]` | position of one corner | | pos2 | `number[]` | position of opposite corner | | addOneToMax | `boolean` | | ### Returns: `boolean` ## isMobile Whether the player is on a mobile device or a computer. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | ### Returns: `boolean` ## isPlayerCrouching Check whether a player is crouching ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | ### Returns: `boolean` ## isPublicLobby Integer lobby names are public ### Returns: `boolean` boolean ## kickPlayer ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | reason | `string` | | ## killLifeform Kill a lifeform. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | lifeformId | `LifeformId` | | | whoKilled | ` LifeformId \| { lifeformId: LifeformId; withItem: string } ` | Optional | ## matchmakePlayer Tell a player to disconnect from the current lobby and join a new one. To connect to a specific variation, format is `gamename_variation`. For Custom Games, this will be `classic_playerSchematic|XXXXXXXXXX`. NOTE: Players won't disconnect immediately (they may play an ad before being redirected). ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | game | `string` | Defaults to the current game. | | lobbyName | `string` | Defaults to "Quick Play" | ## now Obtain Date.now() value saved at start of current game tick ### Returns: `number` ## openChestForPlayer Open a chest for a player. If there is no chest, or the player cannot open it, do nothing. WARNING: This may call "onPlayerAttemptOpenChest" to determine if the player has permission to open it. Using this function inside that callback risks infinite recursion. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | x | `number` | | | y | `number` | | | z | `number` | | ## openShop Open the shop UI for a player ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | toggle | `boolean` | Whether to close the shop if it's already open | | forceCategoryKey | `PNull` | If set, will change the shop to this category | | onlyIfNonEmpty | `boolean` | If true, will only open the shop if the category (or shop, if no category is provided) is non-empty | ## playClientPredictedSound See documentation for api.playSound ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | soundName | `string` | | | volume | `number` | | | rate | `number` | | | posSettings | ` { playerIdOrPos: PlayerId \| number[] maxHearDist?: number refDistance?: number } ` | | | predictedBy | `PlayerId` | | ## playerIsInGame Whether a player is currently in the game ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | ### Returns: `boolean` ## playerIsLoggedIn ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | ### Returns: `boolean` ## playParticleEffect Play particle effect on all clients, or only on some clients if clientPredictedBy is specified ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | opts | `TempParticleSystemOpts \| ParticlePresetOpts` | | | clientPredictedBy | `PlayerId` | Play only on clients where client with playerId clientPredictedBy is not invisible, transparent, or themselves | ## playSound ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | hears the sound | | soundName | `string` | Can also be a prefix. If so, a random sound with that prefix will be played | | volume | `number` | 0-1. If it's too quiet and volume is 1, normalise your sound in audacity | | rate | `number` | The speed of playback. Also affects pitch. 0.5-4. Lower playback = lower pitch Good for varying the sound. E.g. item pickup sound has a random rate between 1 and 1.5. | | posSettings | ` { playerIdOrPos: PlayerId \| number[] maxHearDist?: number refDistance?: number } ` | : PlayerId \| number[], maxHearDist: number, refDistance: number} playerIdOrPos: The player the sound originates from, or the position of the sound maxHearDist: sound is not played if player is further than this. Default 15 refDistance: higher means the sound decreases less in volume with distance. Default 3. Hitting is 4. Guns are 10 | ## progressBarUpdate Update the progress bar in the bottom right corner. Can be queued. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | toFraction | `number` | The fraction of the progress bar you want to be filled up. | | toDuration | `number` | The time it takes for the bar to reach the given toFraction in ms. If this is too low and you queue multiple updates, this toFraction could be skipped. Treat 200ms as a minimum. | ## raycastForBlock Raycast for a block in the world. Given a position and a direction, find the first block that the "ray" hits. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | fromPos | `number[]` | | | dirVec | `number[]` | | ### Returns: `BlockRaycastResult` ## removeAppliedSkin Remove gamemode-applied skin from a player ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | ## removeEffect Remove an effect from a lifeform. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | lifeformId | `LifeformId` | | | name | `string` | | ## removeFollowingEntityFromPlayer Remove following entity from player ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | entityEId | `EntityId` | | ## removeItemCraftingRecipes Removes crafting recipes ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | itemName | `PNull` | Removes all crafting recipes for the given player if null, otherwise removes the crafting recipes for the given item. | ## removeItemName Remove an amount of item from a player's inventory ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | itemName | `ItemName` | | | amount | `number` | | ## removeMiddleScreenBar If there is any current middle screen bar running, this will hide it ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | ## resetCanChangeBlockRect Remove any previous can/cant change block rect settings for a player ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | pos1 | `number[]` | | | pos2 | `number[]` | | ## resetCanChangeBlockType Remove any previous can/cant change block type settings for a player ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | blockName | `BlockName` | | ## resetItemCraftingRecipes Reset the crafting recipes for a given back to its original bloxd state ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | itemName | `PNull` | Resets all crafting recipes for the given player if null, otherwise resets the crafting recipes for the given item. | ## resetShopItemForPlayer Delete a specific player's overrides for a shop item. Like other methods, it doesn't matter whether the overrides were created using createShopItemForPlayer or by using updateShopItemForPlayer instead. This method does nothing if the overrides don't exist or are defined internally by the engine. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The player to reset the item for | | categoryKey | `ShopCategoryKey` | The key of the category containing the item | | itemKey | `ShopItemKey` | The unique key for the item | ## scalePlayerMeshNodes Scale node of a player's mesh by 3d vector. State from prior calls to this api is lost so if you want to have multiple nodes scaled, pass in all the scales at once. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | nodeScales | `EntityMeshScalingMap` | | ## sendFlyingMiddleMessage Send a flying middle message to a specific player ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | Id of the player | | message | `string \| CustomTextStyling` | The text contained within the message. Can be either a string or use `Custom Text Styling`. | | distanceFromAction | `number` | The distance from the action that has caused this message to be displayed, this value will be used to determine how the message flies across the screen. | | lifetimeMs | `number` | How long the message will be visible in milliseconds. Defaults to 1000ms. | ## sendHitmarker Show a hitmarker on the player's screen (the X-shaped crosshair flash indicating a successful hit). Useful for custom weapons or things that need visual hit feedback. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The player to show the hitmarker to | | isCrit | `boolean` | If true, shows an enhanced critical-hit hitmarker with a longer, more dramatic animation | | directionVector | `PNull` | Optional [x, y, z] direction vector. When provided, the hitmarker appears at the projected screen position of that direction rather than at the centre of the screen. Same flow as mobile melee attacks where the tap point differs from screen centre. | ## sendMessage Send a message to a specific player ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | Id of the player | | message | `string \| CustomTextStyling` | The text contained within the message. Can use `Custom Text Styling`. | | style | ` { fontWeight?: number \| string; color?: string } ` | An optional style argument. Can contain values for fontWeight and color of the message. style is ignored if message uses custom text styling (i.e. is not a string). | ## sendOverShopInfo Show a message over the shop in the same place that a shop item's onBoughtMessage is shown. Displays for a couple seconds before disappearing Use case is to show a dynamic message when player buys an item ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | info | `string \| CustomTextStyling` | | ## sendTopRightHelper ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | icon | `string` | Can be any icon from font-awesome. | | text | `string` | The text to send. | | opts | ` { duration?: number width?: number height?: number color?: string iconSizeMult?: number textAndIconColor?: string fontSize?: string } ` | Can include keys duration, width, height, color, iconSizeMult. Default opts: { duration: 8, // seconds width: 400px, height: 100px, color: 'rgb(102, 102, 102)', // must be rgb in this format (hex not supported), iconSizeMult: 5, textAndIconColor: "white", // can be any colour supported by css (e.g. hex, rgb), fontSize: '17px', } | ## setAuraLevel Set the aura level for a player - shortcut for setTotalAura(level * auraPerLevel) ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | level | `number` | | ## setBlock Set a block. Valid names are any block name, including 'Air' This function is optimised for setting broad swathes of blocks. For example, if you have a 50x50x50 area you need to turn to air, it will run performantly if you call this in double nested loops. IF you're only changing a few blocks, you want this to be super snappy for players, AND you're calling this outside of your _tick function, you can use api.setOptimisations(false). If you want the optimisations for large quantities of blocks later on, then call api.setOptimisations(true) when you're done. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | x | `number \| number[]` | Can be an array | | y | `number \| BlockName` | Should be blockname if first param is array | | z | `number` | | | blockName | `BlockName` | | ## setBlockData Store data about a block in a performant manner. Data is cleared when block changes. E.g. chest Works well with blocks marked tickable (e.g. wheat) ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | x | `number` | | | y | `number` | | | z | `number` | | | data | `object` | | ## setBlockRect Helper function that sets all blocks in a rectangle to a specific block. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | pos1 | `number[]` | array [x, y, z] | | pos2 | `number[]` | array [x, y, z] | | blockName | `BlockName` | | ## setBlockWalls Create walls by providing two opposite corners of the cuboid ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | pos1 | `number[]` | array [x, y, z] | | pos2 | `number[]` | array [x, y, z] | | blockName | `BlockName` | | | hasFloor | `boolean` | | | hasCeiling | `boolean` | | ## setCallbackValueFallback Set a default value to be returned by your callback code if it throws an error. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | callbackName | string | The name of the callback to set the default value for | | defaultValue | any | The default value to return if the callback throws an error | ## setCameraDirection Set the direction the player is looking. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | direction | `number[]` | a vector of the direction to look, format [x, y, z] | ## setCameraZoom Set camera zoom for a player ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | zoom | `number` | | ## setCanChangeBlock Let a player change a block at a specific co-ordinate. Useful when client option canChange is false. Overrides blockRect and blockType settings, so also useful when you have disallowed changing of a block type with setCantChangeBlockType. Using this on 1000s of blocks will cause lag - if that is needed, find a way to use setCanChangeBlockType. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | x | `number` | | | y | `number` | | | z | `number` | | ## setCanChangeBlockRect Make it so a player can Change blocks within two points. Coordinates are inclusive. E.g. if [0, 0, 0] is pos1 and [1, 1, 1] is pos2 then the 8 blocks contained within low and high will be able to be broken. Overrides setCantChangeBlockType ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | pos1 | `number[]` | Arg as [x, y, z] | | pos2 | `number[]` | Arg as [x, y, z] | ## setCanChangeBlockType Lets a player Change a block type. Valid names are any block name, including 'Air' Less priority than cant change block pos/can change block rect ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | blockName | `BlockName` | | ## setCantChangeBlock Prevents a player from changing a block at a specific co-ordinate. Useful when client option canChange is true. Overrides blockRect and blockType settings, so also useful when you have allowed changing of a block type with setCantChangeBlockType. Using this on 1000s of blocks will cause lag - if that is needed, find a way to use setCantChangeBlockType. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | x | `number` | | | y | `number` | | | z | `number` | | ## setCantChangeBlockRect Make it so a player cant Change blocks within two points. Coordinates are inclusive. E.g. if [0, 0, 0] is pos1 and [1, 1, 1] is pos2 then the 8 blocks contained within pos1 and pos2 won't be able to be broken. Overrides setCanChangeBlockType ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | pos1 | `number[]` | Arg as [x, y, z] | | pos2 | `number[]` | Arg as [x, y, z] | ## setCantChangeBlockType Stops a player from changing a block type. Valid names are any block name, including 'Air' Less priority than can change block pos/can change block rect ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | blockName | `BlockName` | | ## setCantPickUpItem Prevent a player from picking up an item. itemId returned by createItemDrop ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | itemId | `EntityId` | | ## setClientOption Modify a client option at runtime and send to the client if it changed ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | option | `PassedOption` | The name of the option | | value | `ClientOptions[PassedOption]` | The new value of the option | ## setClientOptions Modify client options at runtime ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | optionsObj | `Partial` | An object which contains key value pairs of new settings. E.g {canChange: true, speedMultiplier: false} | ## setClientOptionToDefault Sets a client option to its default value. This will be the value stored in your game's defaultClientOptions, otherwise Bloxd's default. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | option | `ClientOption` | | ## setDefaultMobSetting Set the default value for a mob setting. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | mobType | `TMobType` | | | setting | `TMobSetting` | | | value | `MobSettings[TMobSetting]` | | ## setDirectionArrow Show a directional arrow indicator on the player's screen pointing toward a world position. When the position is off-screen the indicator is a rotating chevron at the screen edge. When the position is on-screen it becomes a small marker dot. The arrow persists until explicitly cleared via `clearDirectionArrow`. Calling again with the same `id` updates the existing arrow in-place. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The player to show the arrow to | | id | `string` | Unique identifier for this arrow (allows multiple concurrent arrows) | | position | `number[]` | [x, y, z] world position the arrow should point toward | | text | `PNull` | Optional label rendered below the indicator. Supports CustomTextStyling for rich text with icons/colours. | | showDistance | `boolean` | If true, displays the distance (in blocks) from the player to the arrow position. | | style | `PNull` | Optional style object (same format as CustomTextStyling's StyledText `style`). Controls chevron/marker colour, label typography, and opacity. | ## setEntityHeading ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | entityId | `EntityId` | | | newHeading | `number` | | ## setEntityRotation Set the rotation for a server-auth entity. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | entityId | `EntityId` | | | xRotation | `number` | | | yRotation | `number` | | | zRotation | `number` | | ## setEveryoneSettingForPlayer Set a player's other-entity setting for every lifeform in the game. includeNewJoiners=true means that the player will have the setting applied to new joiners. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | settingName | `Setting` | | | settingValue | `OtherEntitySettings[Setting]` | | | includeNewJoiners | `boolean` | | ## setHealth Set the current health of an entity. If you want to set their health to more than their current max health, the optional increaseMaxHealthIfNeeded must be true. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | entityId | `EntityId` | | | newHealth | `PNull` | Can be null to make the player not have health | | whoDidDamage | ` LifeformId \| { lifeformId: LifeformId; withItem: string } ` | Optional | | increaseMaxHealthIfNeeded | `boolean` | Optional | ### Returns: `boolean` ## setItemAmount Set the amount of an item in an item entity ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | itemId | `EntityId` | | | newAmount | `number` | | ## setItemSlot Put an item in a specific index. Default hotbar is indexes 0-9 ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | itemSlotIndex | `number` | 0-indexed | | itemName | `ItemName` | Can be 'Air', in which case itemAmount will be ignored and the slot will be cleared. | | itemAmount | `PNull` | -1 for infinity. Should not be set, or null, for items that are not stackable. | | attributes | `ItemAttributes` | An optional object for certain types of item. For guns this can contain the shotsLeft field which is the amount of ammo the gun currently has. | | tellClient | `boolean` | whether to tell client about it - results in desync between client and server if client doesnt locally perform the same action | ## setItemStat Set a stat attribute for a block or item NOTE: Only a subset of stats are customisable this way. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | itemName | `ItemName` | | | stat | `K` | | | value | `AnyMetadataItem[K]` | | ## setLobbyDbValue Sets a database value that is saved per lobby. This persists between sessions. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | key | `string` | | | value | `string \| number` | | ## setMaxPlayers Update the max players and soft max players matchmaking will use softMaxPlayers is the number of players that matchmaking will route to using "Quick Play". Once the softMaxPlayers limit is reached, this lobby can only be joined by requesting the lobby name or joining a friend. maxPlayers is the absolute maximum: a lobby will not have more players than this. Tip: softMaxPlayers should be around 90% of maxPlayers WARNING: This change is not immediate, as it takes a while for matchmaking to find out. Also, this will not kick players out of the lobby if set to a lower value than the current player count. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | softMaxPlayers | `number` | | | maxPlayers | `number` | | ## setMobAiState Sets the current AI state for the given mob. Some AI states will require context such as the ID of the lifeform being chased. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | mobId | `MobId` | | | state | `TState` | | | params | `MobAiStateParams` | | ## setMobSetting Set the current value of a mob setting for a specific mob. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | mobId | `MobId` | | | setting | `TMobSetting` | | | value | `MobSettings[TMobSetting]` | | ## setMoonstoneChestItemSlot Moonstone chests are a type of chest where a player accesses the same contents no matter the location of the moonstone chest ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | idx | `number` | 0-indexed | | itemName | `ItemName` | Can be 'Air', in which case itemAmount will be ignored and the slot will be cleared. | | itemAmount | `number` | -1 for infinity. Should not be set, or null, for items that are not stackable. | | metadata | `ItemAttributes` | An optional object for certain types of item. For guns this can contain the shotsLeft field which is the amount of ammo the gun currently has. | ## setOtherEntitySetting Set a player's other-entity setting for a specific entity. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | relevantPlayerId | `PlayerId` | | | targetedEntityId | `EntityId` | | | settingName | `Setting` | | | settingValue | `OtherEntitySettings[Setting]` | | ## setOtherEntitySettings Set many of a player's other-entity settings for a specific entity. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | relevantPlayerId | `PlayerId` | | | targetedEntityId | `EntityId` | | | settingsObject | `Partial` | | ## setPlayerDbValue Sets a database value that is saved per player. This persists between sessions and between lobbies for custom games. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | key | `string` | | | value | `string \| number` | | ## setPlayerOpacity Set a player's opacity A simple helper that calls setTargetedPlayerSettingForEveryone ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | opacity | `number` | | ## setPlayerOpacityForOnePlayer Set the level of viewable opacity by one player on another player A simple helper that calls setOtherEntitySetting ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerIdWhoViewsOpacityPlayer | `PlayerId` | The player who sees that with opacity | | playerIdOfOpacityPlayer | `PlayerId` | The player/player model who is given opacity | | opacity | `number` | | ## setPlayerPhysicsState Set physics state of player (vehicle type and tier) ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | physicsState | `PlayerPhysicsStateData` | | | positionOffset | `[number, number, number]` | Optional offset to adjust the player's collision box | ## setPlayerPose Set the pose of the player ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | pose | `PlayerPose` | | | poseOffset | `[number, number, number]` | | ## setPosition Set position of a player / entity. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | entityId | `EntityId` | | | x | `number \| number[]` | Can also be an array, in which case y and z shouldn't be passed | | y | `number` | | | z | `number` | | ## setSelectedInventorySlotI Force the player to have the ith inventory slot selected. E.g. newI 0 makes the player have the 0th inventory slot selected ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | newI | `number` | integer from 0-9 | ## setShieldAmount Set the current shield of a lifeform. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | lifeformId | `LifeformId` | | | newShieldAmount | `number` | | ## setStandardChestItemSlot ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | chestPos | `number[]` | | | idx | `number` | 0-indexed | | itemName | `ItemName` | Can be 'Air', in which case itemAmount will be ignored and the slot will be cleared. | | itemAmount | `number` | -1 for infinity. Should not be set, or null, for items that are not stackable. | | playerId | `PlayerId` | The player who is interacting with the chest. | | attributes | `ItemAttributes` | An optional object for certain types of item. For guns this can contain the shotsLeft field which is the amount of ammo the gun currently has. | ## setTargetedPlayerSettingForEveryone Set every player's other-entity setting to a specific value for a particular player. includeNewJoiners=true means that new players joining the game will also have this other player setting applied. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | targetedPlayerId | `PlayerId` | | | settingName | `Setting` | | | settingValue | `OtherEntitySettings[Setting]` | | | includeNewJoiners | `boolean` | | ## setTotalAura Sets the total aura for a player. Will not go over max level or under 0 ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | totalAura | `number` | | ## setVelocity Set the velocity of an entity ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | eId | `EntityId` | | | x | `number` | | | y | `number` | | | z | `number` | | ## setWalkThroughRect Allow a player to walk through (or not walk through) voxels that are located within a given rectangle. For blocks that are normally solid and not seethrough, the player will experience slight visual glitches while inside the block. You could set both pos1 and pos2 to [0, 0, 0] to make only 0, 0, 0 walkthrough, for example. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | pos1 | `number[]` | The one corner of the cuboid. Format [x, y, z] | | pos2 | `number[]` | The top right corner of the cuboid. Format [x, y, z] | | updateType | `WalkThroughType` | The type of update. Whether to make a rect solid, or able to be walked through. Pass DEFAULT_WALK_THROUGH with a previously passed rect to disable any walkthrough setting for that rect. | ## setWalkThroughType Allow a player to walk through a type of block. For blocks that are normally solid and not seethrough, the player will experience slight visual glitches while inside the block. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | blockName | `BlockName` | | | disable | `boolean` | If you've enabled a player to walk through a block and want to make the block solid for them again, pass this with true. Otherwise you only need to pass playerId and blockName | ## showShopTutorial Show the shop tutorial for a player. Will not be shown if they have ever seen the shop tutorial in your game before. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | ## updateEntityNodeMeshAttachment Attach/detach mesh instances to/from an entity ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | eId | `EntityId` | | | node | `EntityNamedNode` | node to attach to | | type | `PNull` | if null, detaches mesh from this node | | opts | `MeshEntityOpts[MeshType]` | | | offset | `[number, number, number]` | | | rotation | `[number, number, number]` | | ## updateMeshEntity Update a mesh entity. If used on a non-mesh entity, will do nothing. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | eId | `EntityId` | | | type | `MeshType` | | | opts | `MeshEntityOpts[MeshType]` | | ## updateShopItem Update selected properties of an existing shop item. For example, { canBuy: true } to allow players to purchase the item. Throws an error if the item does not exist. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | categoryKey | `ShopCategoryKey` | The key of the category containing the item | | itemKey | `ShopItemKey` | The unique key for the item | | changes | `Partial` | Partial shop item properties to update | ## updateShopItemForPlayer Update selected properties of an existing shop item for a specific player. For example, { canBuy: true } to allow this player to purchase the item. Throws an error if the item does not exist. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The player to update the item for | | categoryKey | `ShopCategoryKey` | The key of the category containing the item | | itemKey | `ShopItemKey` | The unique key for the item | | changes | `Partial` | Partial shop item properties to update | # API Reference ## addFollowingEntityToPlayer Add following entity to player ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | eId | `EntityId` | | | offset | `number[]` | | | followsPlayerRotation | `boolean` | | ## addQTE Create and register the UI for the requested quicktime event (QTE) to the screen. Handle the result via the onPlayerFinishQTE engine callback. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | qteParameters | `QTEClientParameters` | includes type and parameters | ### Returns: `QTERequestId` an id that can be passed to deleteQTE ## animateEntity Animates the given entity. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | entityId | `EntityId` | | | animationSchema | `AnimationSchema \| BlockbenchAnimationSchema` | | | initialTimeFraction | `number` | | | animationSpeed | `number` | | ## applyAuraChange Add (or remove if negative) aura to a player. Will not go over max level or under 0 ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | auraDiff | `number` | | ### Returns: `number` The actual change in aura ## applyEffect Apply an effect to a lifeform. Can be an inbuilt effect E.g. "Speed" (speed boost), "Damage" (damage boost). For inbuilt just pass the name of the effect and the functionality is handled in-engine. For custom effect, you pass customEffectInfo. The icon can be an InGameIconName or a bloxd item name. The custom effect onEndCb is an optional helper within which you can undo the effect you applied. Note that onEndCb will not work for press to code boards, code blocks or world code. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | lifeformId | `LifeformId` | | | effectName | `string` | | | duration | `number \| null` | | | customEffectInfo | ` { icon?: IngameIconName \| ItemName; onEndCb?: () => void; displayName?: string \| TranslatedText } & Partial ` | | ## applyHealthChange ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | lifeformId | `LifeformId` | | | changeAmount | `number` | Must be an integer. A positive amount will increase the entity's health. A negative amount will decrease the entity's shield first, then their health. | | whoDidDamage | ` LifeformId \| { lifeformId: LifeformId; withItem: string } ` | Optional - If damage done by another player | | broadcastLifeformHurt | `boolean` | | ### Returns: `boolean` ## applyImpulse Apply an impulse to an entity ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | eId | `EntityId` | | | xImpulse | `number` | | | yImpulse | `number` | | | zImpulse | `number` | | ## applyMeleeHit Make it as if hittingEId hit hitEId ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | hittingEId | `LifeformId` | | | hitEId | `LifeformId` | | | dirFacing | `number[]` | | | bodyPartHit | `PNull` | | | overrides | ` { damage?: PNull heldItemName?: PNull horizontalKbMultiplier?: number verticalKbMultiplier?: number } ` | | ### Returns: `boolean` ## attemptApplyDamage Apply damage to a lifeform. eId is the player initiating the damage, hitEId is the lifeform being hit. It is recommended to self-inflict damage when the game code wants to apply damage to a lifeform. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | { eId, hitEId, attemptedDmgAmt, withItem, bodyPartHit = undefined, attackDir = undefined, showCritParticles = false, reduceVerticalKbVelocity = true, horizontalKbMultiplier = 1, verticalKbMultiplier = 1, broadcastEntityHurt = true, attackCooldownSettings = null, hittingSoundOverride = null, ignoreOtherEntitySettingCanAttack = false, isTrueDamage = false, damagerDbId = null, } | `PlayerAttemptDamageOtherPlayerOpts` | | ### Returns: `boolean` whether the attack damaged the lifeform ## attemptCreateMeshEntity Try to create a mesh entity. This creates an entity whose mesh position is synced with clients. Set entity position using setPosition There is a limit to the number of mesh entities and throwables that can be created, with an even smaller limit for mesh entities with physics. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | type | `MeshType` | | | opts | `MeshEntityOpts[MeshType]` | | | name | `string` | The default name for the nametag | | physicsOptions | `MeshEntityPhysicsOpts` | Physics Options | | initiatorId | `EntityId` | The entity that initiated the creation of the mesh entity. | ### Returns: `PNull` null if the entity creation failed, otherwise the entity ID. ## attemptCreateThrowable Try to create a throwable entity. Similar to creating a mesh entity and uses the same rate limiting. However, this uses the predefined throwables system and physics used by throwable items with the game Each throwable item has its own behaviour already, including default velocity, damage and gravity multipliers. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | throwerEId | `EntityId` | | | itemName | `ThrowableItem` | Must be an Item that is usually throwable in-engine | | position | `[number, number, number]` | Starting position | | direction | `[number, number, number]` | | | velocityMult | `number` | Multiplier for the default velocity of the throwable item | | damageMult | `number` | Multiplier for the default damage of the throwable item | | gravityMult | `number` | Multiplier for the default gravity of the throwable item | | attributes | `ItemAttributes` | item attributes (currently used only for the "Boomerag" item) | ### Returns: `string` null if throwable creation failed, otherwise the entity ID. ## attemptSpawnMob Try to spawn a mob into the world at a given position. Returns null on failure. WARNING: Either the "onPlayerAttemptSpawnMob" or the "onWorldAttemptSpawnMob" game callback will be called depending on whether "spawnerId" is provided. Calling this function inside those callbacks risks infinite recursion. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | mobType | `TMobType` | | | x | `number` | | | y | `number` | | | z | `number` | | | opts | `MobSpawnOpts` | Includes: - mobHerdId The ID of this mob's herd. (A mob herd represents a collection of mobs that move together.) - spawnerId The ID of the player who tried to spawn this mob. - mobDbId A persistent ID for the mob. This can be useful when loading mob data from the database. If the DB ID is already taken, null will be returned. - name If set, gives the mob a name that will be displayed as a nametag above their head. - playSoundOnSpawn - variation - physicsOpts { width: number; height: number; collidesEntities: boolean } | ### Returns: `PNull` null if the mob could not be spawned. This can happen when there are too many mobs in the world for the current number of players in the lobby, or if the area is protected e.g. by spawn area protection. ## attemptWorldChangeBlock Initiate a block change "by the world". This ends up calling the onWorldChangeBlock and only makes the change if not prevented by game/plugins. initiatorDbId is null if the change was initiated by the game code. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | initiatorDbId | `PNull` | | | x | `number` | | | y | `number` | | | z | `number` | | | blockName | `BlockName` | | | extraInfo | `WorldBlockChangedInfo` | | ### Returns: `"preventChange" | "preventDrop" | void` "preventChange" if the change was prevented, "preventDrop" if the change was allowed but without dropping any items, and undefined if the change was allowed with an item drop ## blockCoordToChunkId Get the unique id of the chunk containing pos in the current map ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | pos | `number[]` | | ### Returns: `string` ## blockIdToBlockName Goes from block id to block name. The reverse of blockNameToBlockId ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | blockId | `BlockId` | | ### Returns: `BlockName` ## blockNameToBlockId Get the numeric id of a block used in the ndarrays returned from getChunk I.e. chunk.blockData.set(x, y, z, api.blockNameToBlockId("Dirt")) or chunk.blockData.get(x, y, z) === api.blockNameToBlockId("Dirt") ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | blockName | `BlockName` | | | allowInvalidBlock | `boolean` | Don't throw an error if the block name is invalid. Defaults false. If true and name is invalid, returns null. | ### Returns: `PNull` ## broadcastMessage Send a message to everyone ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | message | `string \| CustomTextStyling` | The text contained within the message. Can use `Custom Text Styling`. | | style | ` { fontWeight?: number \| string; color?: string } ` | An optional style argument. Can contain values for fontWeight and color of the message. style is ignored if message uses custom text styling (i.e. is not a string). | ## broadcastSound See documentation for api.playSound ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | soundName | `string` | | | volume | `number` | | | rate | `number` | | | posSettings | ` { playerIdOrPos: PlayerId \| number[] maxHearDist?: number refDistance?: number } ` | | | exceptPlayerId | `PlayerId` | | ## calcExplosionForce ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | eId | `EntityId` | | | explosionType | `ExplosionType` | | | knockbackFactor | `number` | | | explosionRadius | `number` | | | explosionPos | `number[]` | | | ignoreProjectiles | `boolean` | | ### Returns: ` { force: [number, number, number]; forceFrac: number; } ` ## canOpenStandardChest Checks if a player is able to open a chest at a given location, as per the rules laid out by the "onPlayerAttemptOpenChest" game callback. Returns true if the player can open the chest, false if they cannot, and void if the chest does not exist. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | chestX | `number` | | | chestY | `number` | | | chestZ | `number` | | ### Returns: `PNull` ## changePlayerIntoSkin Change a part of a player's skin. UGC code is restricted to cosmetics from packs with ugcSelectable; internal code can use any cosmetics. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | Player to change | | cosmeticType | `CosmeticType` | Type of cosmetic | | cosmeticName | `CosmeticName` | Chosen cosmetic, will be made lowercase automatically | ## checkValid Check your game (and, optionally, a entity) is still valid and executing. Useful if you're using async functions and await within your game. If you use await/async or promises and do not check this, your game could have closed and then the rest of your async code executes. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | entityId | `PNull` | | ### Returns: `boolean` ## chunkIdToBotLeftCoord Get the co-ordinates of the block in the chunk with the lowest x, y, and z co-ordinates ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | chunkId | `string` | | ### Returns: `[number, number, number]` ## clearDirectionArrow Clear a directional arrow from the player's screen. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The player to clear the arrow for | | id | `PNull` | The arrow identifier to clear. If null, clears all arrows for this player. | ## clearInventory Clear the players inventory ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | ## clearKillstreak Clears the player's current killstreak ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | ## closeChestForPlayer Close a chest for a player. If the player does not have a chest open, do nothing. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | ## configureShopCategory Set properties of a shop category. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | categoryKey | `ShopCategoryKey` | The key of the category to configure | | config | `ShopCategoryConfig` | Category configuration properties | ## configureShopCategoryForPlayer Configure a shop category for a specific player. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The player to configure the category for | | categoryKey | `ShopCategoryKey` | The key of the category to configure | | config | `ShopCategoryConfig` | Category configuration properties | ## createItemDrop Create a dropped item. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | x | `number` | | | y | `number` | | | z | `number` | | | itemName | `ItemName` | Name of the item. Any item name, including blocks and 'Air' | | amount | `PNull` | The amount of the item to include in the drop - so when the player picks up the item drop, they get this many of the item. | | mergeItems | `boolean` | Whether to merge the item into a nearby item of same type, if one exists. Defaults to false. | | attributes | `ItemAttributes` | Attributes of the item being dropped | | timeTillDespawn | `number` | Time till the item automatically despawns in milliseconds. Max of 5 mins. | | dropperId | `PNull` | Who dropped the item. | | options | `ItemDropOptions` | Additional options, such as doPhysics and size. | ### Returns: `PNull` the id you can pass to setCantPickUpItem, or null if the item drop limit was reached ## createMobHerd Create a mob herd. A mob herd represents a collection of mobs that move together. ### Returns: `MobHerdId` ## createShopItem Create a new shop item under the given category. Will create a new category if it does not exist. If the shop item already exists then it will be replaced. If any per-player overrides exist under the same categoryKey and itemKey then they will be deleted. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | categoryKey | `ShopCategoryKey` | The key of the category to create the item in | | itemKey | `ShopItemKey` | The unique key for the item | | item | `ShopItem` | The shop item to create (will be mutated) | ## createShopItemForPlayer Create a new shop item for a specific player. Will create a new category if it does not exist. Will replace any overrides this player already has for the same item. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The player to create the item for | | categoryKey | `ShopCategoryKey` | The key of the category to create the item in | | itemKey | `ShopItemKey` | The unique key for the item | | item | `ShopItem` | The shop item to create (will be mutated) | ## deleteAllLobbyDbValues Deletes all database values that are saved per lobby. ## deleteAllPlayerDbValues Deletes all database values that are saved per player. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | ## deleteItemDrop Delete an item drop by item drop entity ID ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | itemId | `EntityId` | | ## deleteLobbyDbValue Deletes a database value that is saved per lobby. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | key | `string` | | ## deleteMeshEntity Delete a mesh entity ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | eId | `EntityId` | Returns whether the api successfully deleted the meshEntity | ### Returns: `boolean` ## deletePlayerDbValue Deletes a database value that is saved per player. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | key | `string` | | ## deleteQTE Delete a quicktime event from the screen ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | id | `QTERequestId` | Returned from the addQTE request you want to cancel | ## deleteShopItem Delete an existing shop item. Throws an error if the item does not exist. Will also delete all per-player overrides for the shop item. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | categoryKey | `ShopCategoryKey` | The key of the category containing the item | | itemKey | `ShopItemKey` | The unique key for the item | ## deleteThrowable Delete a throwable entity before it automatically removes itself. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | eId | `EntityId` | | ### Returns: `boolean` true if the entity was deleted, false if it was not a throwable entity ## despawnMob Dispose of a mob's state and remove them from the world without triggering "on death" flows. Always succeeds. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | mobId | `MobId` | | ## editItemCraftingRecipes Edit the crafting recipes for a player. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | itemName | `ItemName` | | | recipesForItem | `RecipesForItem` | | ## forceRespawn Force respawn a player ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | respawnPos | `number[]` | | ## getAuraInfo Get the aura info for a player ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | ### Returns: ` { level: number; totalAura: number; auraPerLevel: number } ` ## getBlock Get the name of a block. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | x | `number \| number[]` | could be an array [x, y, z]. If so, the other params shouldn't be passed. | | y | `number` | | | z | `number` | | ### Returns: `BlockName` ## getBlockCoordinatesPlayerStandingOn Get the co-ordinates of the blocks the player is standing on as a list. For example, if the center of the player is at 0,0,0 this function will return [[0, -1, 0], [-1, -1, 0], [0, -1, -1], [-1, -1, -1]] If the player is just standing on one block, the function would return e.g. [[0, 0, 0]] If the player is middair then returns an empty list []. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | ### Returns: `number[][]` ## getBlockData Get stored data about a block in a performant manner. Data is cleared when block changes. E.g. chest Works well with blocks marked tickable (e.g. wheat) ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | x | `number` | | | y | `number` | | | z | `number` | | ### Returns: `any` ## getBlockId Used to get the block id at a specific position. Intended only for use in hot code paths - default to getBlock for most use cases ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | x | `number` | | | y | `number` | | | z | `number` | | ### Returns: `BlockId` ## getBlockSolidity Returns whether a block is solid or not. E.g. Grass block is solid, while water, ladder and water are not. Will be true if the block is unloaded. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | x | `number \| number[]` | | | y | `number` | | | z | `number` | | ### Returns: `boolean` ## getBlockTypesPlayerStandingOn Get the types of block the player is standing on For example, if a player is standing on 4 dirt blocks, this will return ["Dirt", "Dirt", "Dirt", "Dirt"] ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | ### Returns: `any[]` ## getChunk Only use this instead of getBlock if you REALLY need the performance (i.e. you are iterating over tens of thousands of blocks) ReturnedObject.blockData is a 32x32x32 ndarray of block ids (see https://www.npmjs.com/package/ndarray) Each block id is a 16-bit number The ndarray should only be read from, writing to it will result in desync between the server and client ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | pos | `number[]` | The returned chunk contains pos | ### Returns: `PNull` null if the chunk is not loaded in a persisted world. ReturnedObject.blockData is an ndarray that can be accessed (but modifications have to be saved with resetChunk). ## getClientOption Returns the current value of a client option ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | option | `PassedOption` | | ### Returns: `ClientOptions[PassedOption]` ## getCurrentKillstreak Gets the player's current killstreak ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | ### Returns: `number` ## getDefaultMobSetting Returns the current default value for a mob setting. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | mobType | `TMobType` | | | setting | `TMobSetting` | | ### Returns: `MobSettings[TMobSetting]` ## getEffects Get all the effects currently applied to a lifeform. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | lifeformId | `LifeformId` | | ### Returns: `string[]` ## getEmptyChunk Use this to get a chunk ndarray you can edit and set in resetChunk. Only use chunk helpers if you REALLY need the performance (i.e. you are iterating over tens of thousands of blocks) ReturnedObject.blockData is a 32x32x32 ndarray of air. (see https://www.npmjs.com/package/ndarray) Each block id is a 16-bit number ### Returns: `GameChunk` ## getEntitiesInRect Get the entities in the rect between [minX, minY, minZ] and [maxX, maxY, maxZ] ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | minCoords | `number[]` | | | maxCoords | `number[]` | | ### Returns: `EntityId[]` ## getEntityHeading ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | entityId | `EntityId` | | ### Returns: `number` ## getEntityName Get the in game name of an entity. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | entityId | `EntityId` | | ### Returns: `string` ## getEntityRotation Get the rotation for a server-auth entity. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | entityId | `EntityId` | | ### Returns: `[number, number, number]` ## getEntityType ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | entityId | `EntityId` | | ### Returns: `EntityType` ## getHealth Get the current health of an entity. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | entityId | `PlayerId` | | ### Returns: `number` ## getHeldItem Get the currently held item of a player Returns null if no item is being held If an item is held, return an object of the format {name: itemName, amount: amountOfItem} ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | ### Returns: `PNull` ## getInitialItemMetadata Get the metadata about a block or item before stats have been modified by any client options (i.e. its entry in the initial metadata object) ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | itemName | `string` | | ### Returns: `Partial` ## getInventoryFreeSlotCount Get the amount of free slots in a player's inventory. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | ### Returns: `number` number ## getInventoryItemAmount The amount of an itemName a player has. Returns 0 if the player has none, and a negative number if infinite. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | itemName | `ItemName` | | ### Returns: `number` number ## getItemSlot Get the item at a specific index Returns null if there is no item at that index If there is an item, return an object of the format { name: string; amount: PNull; attributes: ItemAttributes; } ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | itemSlotIndex | `number` | | ### Returns: `PNull` ## getItemStat Get stat info about a block or item Either based on a client option for a player: (e.g. `DirtTtb`) or its entry in the initial metadata object if no client option is set. If null is passed for lifeformId, this is simply its entry in blockMetadata etc. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | lifeformId | `PNull` | | | itemName | `ItemName` | | | stat | `K` | | ### Returns: `AnyMetadataItem[K]` ## getLobbyDbValue Gets a database value that is saved per lobby. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | key | `string` | | ### Returns: `PNull` ## getLobbyName Get the name of the lobby this game is running in. ### Returns: `string` ## getLobbyType Returns if the current lobby the game is running in is special - e.g. a discord guild or dm, or simply a standard lobby ### Returns: `LobbyType` ## getMetaInfo Splits the block name by '|'. If no meta info, metaInfo is '' ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | blockName | `BlockName \| null \| undefined` | | ### Returns: `ItemMetaInfo` ## getMobAiState Gets the current AI state for the given mob. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | mobId | `MobId` | | ### Returns: ` { state: MobAiState; params: MobAiStateParams } ` ## getMobIds Get the mob IDs of all mobs in the world. ### Returns: `MobId[]` ## getMobSetting Get the current value of a mob setting for a specific mob. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | mobId | `MobId` | | | setting | `TMobSetting` | | | returnDefaultIfNotOverridden | `boolean` | If true, return the default setting if not overridden. | ### Returns: `MobSettings[TMobSetting]` ## getMoonstoneChestItems Get all the items from a moonstone chest in order. Use this instead of repetitive calls to getMoonstoneChestItemSlot Moonstone chests are a type of chest where a player accesses the same contents no matter the location of the moonstone chest ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | ### Returns: `PNull[]` ## getMoonstoneChestItemSlot Get the item in a player's moonstone chest slot. Null if empty Moonstone chests are a type of chest where a player accesses the same contents no matter the location of the moonstone chest ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | idx | `number` | | ### Returns: `PNull` ## getNumMobs Get the number of mobs in the world. ### Returns: `number` ## getNumPlayers Get the number of players in the room ### Returns: `number` ## getOtherEntitySetting Get the value of a player's other-entity setting for a specific entity. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | relevantPlayerId | `PlayerId` | | | targetedEntityId | `EntityId` | | | settingName | `Setting` | | ### Returns: `OtherEntitySettings[Setting]` ## getPlayerCosmetic Get a single equipped cosmetic for a player. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | cosmeticType | `CosmeticType` | Type of cosmetic | ### Returns: `CosmeticName` ## getPlayerDbId Given a player, get their permanent identifier that doesn't change when leaving and re-entering ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | ### Returns: `PlayerDbId` ## getPlayerDbValue Gets a database value that is saved per player. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | key | `string` | | ### Returns: `PNull` ## getPlayerFacingInfo Get the position of a player's camera and the direction (both in Euclidean and spherical coordinates) they are attempting to use an item. The camPos has the same limitations described in getPlayerTargetInfo ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | ### Returns: ` { camPos: [number, number, number]; dir: [number, number, number]; angleDir: AngleDir; moveHeading: number } ` ## getPlayerId Given the name of a player, get their id ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerName | `string` | | ### Returns: `PNull` ## getPlayerIdFromDbId Returns null if player not in lobby ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | dbId | `PlayerDbId` | | ### Returns: `PNull` ## getPlayerIds Get all the player ids. ### Returns: `PlayerId[]` ## getPlayerPartyWhenJoined Returns the party that the player was in when they joined the game. The returned object contains the playerDbIds, as well as the playerIds if available, of the party leader and members. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | ### Returns: `PNull<{ partyCode: string; playerDbIds: PlayerDbId[] }>` ## getPlayerPhysicsState Get physics state for player ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | ### Returns: `PlayerPhysicsStateData` ## getPlayerTargetInfo Get the position of a player's target block and the block adjacent to it (e.g. where a block would be placed) Note: This position is a tick ahead of the client's block target info (noa.targetedBlock), since the client updates the blocktarget before the entities tick (and since it uses the renderposition of the camera) This normally doesn't matter but if you are client predicting something based on noa.targetedBlock (currently only applicable to in-engine code), you should not verify using this ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | ### Returns: ` { position: [number, number, number]; normal: [number, number, number]; adjacent: [number, number, number] } ` ## getPosition Get position of a player / entity. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | entityId | `EntityId` | | ### Returns: `[number, number, number]` ## getSelectedInventorySlotI Get a player's currently selected inventory slot ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | ### Returns: `number` ## getShieldAmount Get the current shield of an entity. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | entityId | `EntityId` | | ### Returns: `number` ## getStandardChestFreeSlotCount Get the amount of free slots in a standard chest Returns null for non-chests ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | chestPos | `number[]` | | ### Returns: `PNull` number ## getStandardChestItemAmount The amount of an itemName a standard chest has. Returns 0 if the standard chest has none, and a negative number if infinite. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | chestPos | `number[]` | | | itemName | `ItemName` | | ### Returns: `number` number ## getStandardChestItems Get all the items from a standard chest in order. Use this instead of repetitive calls to getStandardChestItemSlot ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | chestPos | `number[]` | | ### Returns: `PNull[]` ## getStandardChestItemSlot Get the item at a chest slot. Null if empty otherwise format {name: itemName, amount: amountOfItem} ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | chestPos | `number[]` | | | idx | `number` | | ### Returns: `PNull` ## getUnitCoordinatesLifeformWithin Get the up to 12 unit co-ordinates the lifeform is located within (A lifeform is modelled as having four corners and can be in up to 3 blocks vertically) ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | lifeformId | `LifeformId` | | ### Returns: `number[][]` List of x, y, z positions e.g. [[-1, 0, 0], [-1, 1, 0], [-1, 2, 0]] ## getVelocity Get the velocity of an entity Will return [0, 0, 0] if the entity doesn't have a physics body ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | eId | `EntityId` | | ### Returns: `[number, number, number]` ## giveItem Inventory stuff Give a player an item and a certain amount of that item. Returns the amount of item added to the users inventory. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | itemName | `ItemName` | | | itemAmount | `number` | | | attributes | `ItemAttributes` | An optional object for certain types of item. For guns this can contain the shotsLeft field which is the amount of ammo the gun currently has. | ### Returns: `number` ## giveStandardChestItem Give a standard chest an item and a certain amount of that item. Returns the amount of item added to the chest. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | chestPos | `number[]` | | | itemName | `ItemName` | | | itemAmount | `number` | | | playerId | `PlayerId` | The player who is interacting with the chest. | | attributes | `ItemAttributes` | An optional object for certain types of item. For guns this can contain the shotsLeft field which is the amount of ammo the gun currently has. | ### Returns: `number` ## hasActiveQTE Returns whether the player has any qteRequests ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | ### Returns: `boolean` ## hasItem Whether a player has an item ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | itemName | `ItemName` | | ### Returns: `boolean` bool ## initiateMiddleScreenBar This will initiate the MiddleScreenBar, starting at empty and filling up to full over the given duration. Good to represent cooldowns (eg gun reload) or charged items (eg crossbow) ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | duration | `number` | ms over which the MiddleScreenBar fills up | | chargeExpiresAutomatically | `boolean` | Defaults to true. If true, the bar will disappear upon reaching full. If false, the bar will remain at full until hidden with removeMiddleScreenBar | | horizontalBarRemOffset | `number` | Offset the bar left or right (in css unit - rem) | ## inventoryIsFull Whether the player has space in their inventory to get new blocks ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | ### Returns: `boolean` ## isAlive Whether a lifeform is alive or dead (or on the respawn screen, in a player's case). ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | lifeformId | `LifeformId` | | ### Returns: `boolean` ## isBlockInLoadedChunk Check if the block at a specific position is in a loaded chunk. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | x | `number` | | | y | `number` | | | z | `number` | | ### Returns: `boolean` ## isInsideRect Check if a position is within a cubic rectangle ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | coordsToCheck | `number[]` | | | pos1 | `number[]` | position of one corner | | pos2 | `number[]` | position of opposite corner | | addOneToMax | `boolean` | | ### Returns: `boolean` ## isMobile Whether the player is on a mobile device or a computer. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | ### Returns: `boolean` ## isPlayerCrouching Check whether a player is crouching ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | ### Returns: `boolean` ## isPublicLobby Integer lobby names are public ### Returns: `boolean` boolean ## kickPlayer ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | reason | `string` | | ## killLifeform Kill a lifeform. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | lifeformId | `LifeformId` | | | whoKilled | ` LifeformId \| { lifeformId: LifeformId; withItem: string } ` | Optional | ## matchmakePlayer Tell a player to disconnect from the current lobby and join a new one. To connect to a specific variation, format is `gamename_variation`. For Custom Games, this will be `classic_playerSchematic|XXXXXXXXXX`. NOTE: Players won't disconnect immediately (they may play an ad before being redirected). ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | game | `string` | Defaults to the current game. | | lobbyName | `string` | Defaults to "Quick Play" | ## now Obtain Date.now() value saved at start of current game tick ### Returns: `number` ## openChestForPlayer Open a chest for a player. If there is no chest, or the player cannot open it, do nothing. WARNING: This may call "onPlayerAttemptOpenChest" to determine if the player has permission to open it. Using this function inside that callback risks infinite recursion. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | x | `number` | | | y | `number` | | | z | `number` | | ## openShop Open the shop UI for a player ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | toggle | `boolean` | Whether to close the shop if it's already open | | forceCategoryKey | `PNull` | If set, will change the shop to this category | | onlyIfNonEmpty | `boolean` | If true, will only open the shop if the category (or shop, if no category is provided) is non-empty | ## playClientPredictedSound See documentation for api.playSound ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | soundName | `string` | | | volume | `number` | | | rate | `number` | | | posSettings | ` { playerIdOrPos: PlayerId \| number[] maxHearDist?: number refDistance?: number } ` | | | predictedBy | `PlayerId` | | ## playerIsInGame Whether a player is currently in the game ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | ### Returns: `boolean` ## playerIsLoggedIn ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | ### Returns: `boolean` ## playParticleEffect Play particle effect on all clients, or only on some clients if clientPredictedBy is specified ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | opts | `TempParticleSystemOpts \| ParticlePresetOpts` | | | clientPredictedBy | `PlayerId` | Play only on clients where client with playerId clientPredictedBy is not invisible, transparent, or themselves | ## playSound ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | hears the sound | | soundName | `string` | Can also be a prefix. If so, a random sound with that prefix will be played | | volume | `number` | 0-1. If it's too quiet and volume is 1, normalise your sound in audacity | | rate | `number` | The speed of playback. Also affects pitch. 0.5-4. Lower playback = lower pitch Good for varying the sound. E.g. item pickup sound has a random rate between 1 and 1.5. | | posSettings | ` { playerIdOrPos: PlayerId \| number[] maxHearDist?: number refDistance?: number } ` | : PlayerId \| number[], maxHearDist: number, refDistance: number} playerIdOrPos: The player the sound originates from, or the position of the sound maxHearDist: sound is not played if player is further than this. Default 15 refDistance: higher means the sound decreases less in volume with distance. Default 3. Hitting is 4. Guns are 10 | ## progressBarUpdate Update the progress bar in the bottom right corner. Can be queued. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | toFraction | `number` | The fraction of the progress bar you want to be filled up. | | toDuration | `number` | The time it takes for the bar to reach the given toFraction in ms. If this is too low and you queue multiple updates, this toFraction could be skipped. Treat 200ms as a minimum. | ## raycastForBlock Raycast for a block in the world. Given a position and a direction, find the first block that the "ray" hits. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | fromPos | `number[]` | | | dirVec | `number[]` | | ### Returns: `BlockRaycastResult` ## removeAppliedSkin Remove gamemode-applied skin from a player ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | ## removeEffect Remove an effect from a lifeform. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | lifeformId | `LifeformId` | | | name | `string` | | ## removeFollowingEntityFromPlayer Remove following entity from player ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | entityEId | `EntityId` | | ## removeItemCraftingRecipes Removes crafting recipes ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | itemName | `PNull` | Removes all crafting recipes for the given player if null, otherwise removes the crafting recipes for the given item. | ## removeItemName Remove an amount of item from a player's inventory ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | itemName | `ItemName` | | | amount | `number` | | ## removeMiddleScreenBar If there is any current middle screen bar running, this will hide it ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | ## resetCanChangeBlockRect Remove any previous can/cant change block rect settings for a player ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | pos1 | `number[]` | | | pos2 | `number[]` | | ## resetCanChangeBlockType Remove any previous can/cant change block type settings for a player ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | blockName | `BlockName` | | ## resetItemCraftingRecipes Reset the crafting recipes for a given back to its original bloxd state ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | itemName | `PNull` | Resets all crafting recipes for the given player if null, otherwise resets the crafting recipes for the given item. | ## resetShopItemForPlayer Delete a specific player's overrides for a shop item. Like other methods, it doesn't matter whether the overrides were created using createShopItemForPlayer or by using updateShopItemForPlayer instead. This method does nothing if the overrides don't exist or are defined internally by the engine. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The player to reset the item for | | categoryKey | `ShopCategoryKey` | The key of the category containing the item | | itemKey | `ShopItemKey` | The unique key for the item | ## scalePlayerMeshNodes Scale node of a player's mesh by 3d vector. State from prior calls to this api is lost so if you want to have multiple nodes scaled, pass in all the scales at once. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | nodeScales | `EntityMeshScalingMap` | | ## sendFlyingMiddleMessage Send a flying middle message to a specific player ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | Id of the player | | message | `string \| CustomTextStyling` | The text contained within the message. Can be either a string or use `Custom Text Styling`. | | distanceFromAction | `number` | The distance from the action that has caused this message to be displayed, this value will be used to determine how the message flies across the screen. | | lifetimeMs | `number` | How long the message will be visible in milliseconds. Defaults to 1000ms. | ## sendHitmarker Show a hitmarker on the player's screen (the X-shaped crosshair flash indicating a successful hit). Useful for custom weapons or things that need visual hit feedback. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The player to show the hitmarker to | | isCrit | `boolean` | If true, shows an enhanced critical-hit hitmarker with a longer, more dramatic animation | | directionVector | `PNull` | Optional [x, y, z] direction vector. When provided, the hitmarker appears at the projected screen position of that direction rather than at the centre of the screen. Same flow as mobile melee attacks where the tap point differs from screen centre. | ## sendMessage Send a message to a specific player ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | Id of the player | | message | `string \| CustomTextStyling` | The text contained within the message. Can use `Custom Text Styling`. | | style | ` { fontWeight?: number \| string; color?: string } ` | An optional style argument. Can contain values for fontWeight and color of the message. style is ignored if message uses custom text styling (i.e. is not a string). | ## sendOverShopInfo Show a message over the shop in the same place that a shop item's onBoughtMessage is shown. Displays for a couple seconds before disappearing Use case is to show a dynamic message when player buys an item ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | info | `string \| CustomTextStyling` | | ## sendTopRightHelper ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | icon | `string` | Can be any icon from font-awesome. | | text | `string` | The text to send. | | opts | ` { duration?: number width?: number height?: number color?: string iconSizeMult?: number textAndIconColor?: string fontSize?: string } ` | Can include keys duration, width, height, color, iconSizeMult. Default opts: { duration: 8, // seconds width: 400px, height: 100px, color: 'rgb(102, 102, 102)', // must be rgb in this format (hex not supported), iconSizeMult: 5, textAndIconColor: "white", // can be any colour supported by css (e.g. hex, rgb), fontSize: '17px', } | ## setAuraLevel Set the aura level for a player - shortcut for setTotalAura(level * auraPerLevel) ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | level | `number` | | ## setBlock Set a block. Valid names are any block name, including 'Air' This function is optimised for setting broad swathes of blocks. For example, if you have a 50x50x50 area you need to turn to air, it will run performantly if you call this in double nested loops. IF you're only changing a few blocks, you want this to be super snappy for players, AND you're calling this outside of your _tick function, you can use api.setOptimisations(false). If you want the optimisations for large quantities of blocks later on, then call api.setOptimisations(true) when you're done. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | x | `number \| number[]` | Can be an array | | y | `number \| BlockName` | Should be blockname if first param is array | | z | `number` | | | blockName | `BlockName` | | ## setBlockData Store data about a block in a performant manner. Data is cleared when block changes. E.g. chest Works well with blocks marked tickable (e.g. wheat) ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | x | `number` | | | y | `number` | | | z | `number` | | | data | `object` | | ## setBlockRect Helper function that sets all blocks in a rectangle to a specific block. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | pos1 | `number[]` | array [x, y, z] | | pos2 | `number[]` | array [x, y, z] | | blockName | `BlockName` | | ## setBlockWalls Create walls by providing two opposite corners of the cuboid ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | pos1 | `number[]` | array [x, y, z] | | pos2 | `number[]` | array [x, y, z] | | blockName | `BlockName` | | | hasFloor | `boolean` | | | hasCeiling | `boolean` | | ## setCallbackValueFallback Set a default value to be returned by your callback code if it throws an error. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | callbackName | string | The name of the callback to set the default value for | | defaultValue | any | The default value to return if the callback throws an error | ## setCameraDirection Set the direction the player is looking. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | direction | `number[]` | a vector of the direction to look, format [x, y, z] | ## setCameraZoom Set camera zoom for a player ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | zoom | `number` | | ## setCanChangeBlock Let a player change a block at a specific co-ordinate. Useful when client option canChange is false. Overrides blockRect and blockType settings, so also useful when you have disallowed changing of a block type with setCantChangeBlockType. Using this on 1000s of blocks will cause lag - if that is needed, find a way to use setCanChangeBlockType. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | x | `number` | | | y | `number` | | | z | `number` | | ## setCanChangeBlockRect Make it so a player can Change blocks within two points. Coordinates are inclusive. E.g. if [0, 0, 0] is pos1 and [1, 1, 1] is pos2 then the 8 blocks contained within low and high will be able to be broken. Overrides setCantChangeBlockType ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | pos1 | `number[]` | Arg as [x, y, z] | | pos2 | `number[]` | Arg as [x, y, z] | ## setCanChangeBlockType Lets a player Change a block type. Valid names are any block name, including 'Air' Less priority than cant change block pos/can change block rect ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | blockName | `BlockName` | | ## setCantChangeBlock Prevents a player from changing a block at a specific co-ordinate. Useful when client option canChange is true. Overrides blockRect and blockType settings, so also useful when you have allowed changing of a block type with setCantChangeBlockType. Using this on 1000s of blocks will cause lag - if that is needed, find a way to use setCantChangeBlockType. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | x | `number` | | | y | `number` | | | z | `number` | | ## setCantChangeBlockRect Make it so a player cant Change blocks within two points. Coordinates are inclusive. E.g. if [0, 0, 0] is pos1 and [1, 1, 1] is pos2 then the 8 blocks contained within pos1 and pos2 won't be able to be broken. Overrides setCanChangeBlockType ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | pos1 | `number[]` | Arg as [x, y, z] | | pos2 | `number[]` | Arg as [x, y, z] | ## setCantChangeBlockType Stops a player from changing a block type. Valid names are any block name, including 'Air' Less priority than can change block pos/can change block rect ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | blockName | `BlockName` | | ## setCantPickUpItem Prevent a player from picking up an item. itemId returned by createItemDrop ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | itemId | `EntityId` | | ## setClientOption Modify a client option at runtime and send to the client if it changed ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | option | `PassedOption` | The name of the option | | value | `ClientOptions[PassedOption]` | The new value of the option | ## setClientOptions Modify client options at runtime ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | optionsObj | `Partial` | An object which contains key value pairs of new settings. E.g {canChange: true, speedMultiplier: false} | ## setClientOptionToDefault Sets a client option to its default value. This will be the value stored in your game's defaultClientOptions, otherwise Bloxd's default. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | option | `ClientOption` | | ## setDefaultMobSetting Set the default value for a mob setting. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | mobType | `TMobType` | | | setting | `TMobSetting` | | | value | `MobSettings[TMobSetting]` | | ## setDirectionArrow Show a directional arrow indicator on the player's screen pointing toward a world position. When the position is off-screen the indicator is a rotating chevron at the screen edge. When the position is on-screen it becomes a small marker dot. The arrow persists until explicitly cleared via `clearDirectionArrow`. Calling again with the same `id` updates the existing arrow in-place. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The player to show the arrow to | | id | `string` | Unique identifier for this arrow (allows multiple concurrent arrows) | | position | `number[]` | [x, y, z] world position the arrow should point toward | | text | `PNull` | Optional label rendered below the indicator. Supports CustomTextStyling for rich text with icons/colours. | | showDistance | `boolean` | If true, displays the distance (in blocks) from the player to the arrow position. | | style | `PNull` | Optional style object (same format as CustomTextStyling's StyledText `style`). Controls chevron/marker colour, label typography, and opacity. | ## setEntityHeading ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | entityId | `EntityId` | | | newHeading | `number` | | ## setEntityRotation Set the rotation for a server-auth entity. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | entityId | `EntityId` | | | xRotation | `number` | | | yRotation | `number` | | | zRotation | `number` | | ## setEveryoneSettingForPlayer Set a player's other-entity setting for every lifeform in the game. includeNewJoiners=true means that the player will have the setting applied to new joiners. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | settingName | `Setting` | | | settingValue | `OtherEntitySettings[Setting]` | | | includeNewJoiners | `boolean` | | ## setHealth Set the current health of an entity. If you want to set their health to more than their current max health, the optional increaseMaxHealthIfNeeded must be true. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | entityId | `EntityId` | | | newHealth | `PNull` | Can be null to make the player not have health | | whoDidDamage | ` LifeformId \| { lifeformId: LifeformId; withItem: string } ` | Optional | | increaseMaxHealthIfNeeded | `boolean` | Optional | ### Returns: `boolean` ## setItemAmount Set the amount of an item in an item entity ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | itemId | `EntityId` | | | newAmount | `number` | | ## setItemSlot Put an item in a specific index. Default hotbar is indexes 0-9 ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | itemSlotIndex | `number` | 0-indexed | | itemName | `ItemName` | Can be 'Air', in which case itemAmount will be ignored and the slot will be cleared. | | itemAmount | `PNull` | -1 for infinity. Should not be set, or null, for items that are not stackable. | | attributes | `ItemAttributes` | An optional object for certain types of item. For guns this can contain the shotsLeft field which is the amount of ammo the gun currently has. | | tellClient | `boolean` | whether to tell client about it - results in desync between client and server if client doesnt locally perform the same action | ## setItemStat Set a stat attribute for a block or item NOTE: Only a subset of stats are customisable this way. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | itemName | `ItemName` | | | stat | `K` | | | value | `AnyMetadataItem[K]` | | ## setLobbyDbValue Sets a database value that is saved per lobby. This persists between sessions. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | key | `string` | | | value | `string \| number` | | ## setMaxPlayers Update the max players and soft max players matchmaking will use softMaxPlayers is the number of players that matchmaking will route to using "Quick Play". Once the softMaxPlayers limit is reached, this lobby can only be joined by requesting the lobby name or joining a friend. maxPlayers is the absolute maximum: a lobby will not have more players than this. Tip: softMaxPlayers should be around 90% of maxPlayers WARNING: This change is not immediate, as it takes a while for matchmaking to find out. Also, this will not kick players out of the lobby if set to a lower value than the current player count. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | softMaxPlayers | `number` | | | maxPlayers | `number` | | ## setMobAiState Sets the current AI state for the given mob. Some AI states will require context such as the ID of the lifeform being chased. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | mobId | `MobId` | | | state | `TState` | | | params | `MobAiStateParams` | | ## setMobSetting Set the current value of a mob setting for a specific mob. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | mobId | `MobId` | | | setting | `TMobSetting` | | | value | `MobSettings[TMobSetting]` | | ## setMoonstoneChestItemSlot Moonstone chests are a type of chest where a player accesses the same contents no matter the location of the moonstone chest ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | idx | `number` | 0-indexed | | itemName | `ItemName` | Can be 'Air', in which case itemAmount will be ignored and the slot will be cleared. | | itemAmount | `number` | -1 for infinity. Should not be set, or null, for items that are not stackable. | | metadata | `ItemAttributes` | An optional object for certain types of item. For guns this can contain the shotsLeft field which is the amount of ammo the gun currently has. | ## setOtherEntitySetting Set a player's other-entity setting for a specific entity. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | relevantPlayerId | `PlayerId` | | | targetedEntityId | `EntityId` | | | settingName | `Setting` | | | settingValue | `OtherEntitySettings[Setting]` | | ## setOtherEntitySettings Set many of a player's other-entity settings for a specific entity. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | relevantPlayerId | `PlayerId` | | | targetedEntityId | `EntityId` | | | settingsObject | `Partial` | | ## setPlayerDbValue Sets a database value that is saved per player. This persists between sessions and between lobbies for custom games. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | key | `string` | | | value | `string \| number` | | ## setPlayerOpacity Set a player's opacity A simple helper that calls setTargetedPlayerSettingForEveryone ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | opacity | `number` | | ## setPlayerOpacityForOnePlayer Set the level of viewable opacity by one player on another player A simple helper that calls setOtherEntitySetting ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerIdWhoViewsOpacityPlayer | `PlayerId` | The player who sees that with opacity | | playerIdOfOpacityPlayer | `PlayerId` | The player/player model who is given opacity | | opacity | `number` | | ## setPlayerPhysicsState Set physics state of player (vehicle type and tier) ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | physicsState | `PlayerPhysicsStateData` | | | positionOffset | `[number, number, number]` | Optional offset to adjust the player's collision box | ## setPlayerPose Set the pose of the player ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | pose | `PlayerPose` | | | poseOffset | `[number, number, number]` | | ## setPosition Set position of a player / entity. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | entityId | `EntityId` | | | x | `number \| number[]` | Can also be an array, in which case y and z shouldn't be passed | | y | `number` | | | z | `number` | | ## setSelectedInventorySlotI Force the player to have the ith inventory slot selected. E.g. newI 0 makes the player have the 0th inventory slot selected ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | newI | `number` | integer from 0-9 | ## setShieldAmount Set the current shield of a lifeform. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | lifeformId | `LifeformId` | | | newShieldAmount | `number` | | ## setStandardChestItemSlot ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | chestPos | `number[]` | | | idx | `number` | 0-indexed | | itemName | `ItemName` | Can be 'Air', in which case itemAmount will be ignored and the slot will be cleared. | | itemAmount | `number` | -1 for infinity. Should not be set, or null, for items that are not stackable. | | playerId | `PlayerId` | The player who is interacting with the chest. | | attributes | `ItemAttributes` | An optional object for certain types of item. For guns this can contain the shotsLeft field which is the amount of ammo the gun currently has. | ## setTargetedPlayerSettingForEveryone Set every player's other-entity setting to a specific value for a particular player. includeNewJoiners=true means that new players joining the game will also have this other player setting applied. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | targetedPlayerId | `PlayerId` | | | settingName | `Setting` | | | settingValue | `OtherEntitySettings[Setting]` | | | includeNewJoiners | `boolean` | | ## setTotalAura Sets the total aura for a player. Will not go over max level or under 0 ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | totalAura | `number` | | ## setVelocity Set the velocity of an entity ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | eId | `EntityId` | | | x | `number` | | | y | `number` | | | z | `number` | | ## setWalkThroughRect Allow a player to walk through (or not walk through) voxels that are located within a given rectangle. For blocks that are normally solid and not seethrough, the player will experience slight visual glitches while inside the block. You could set both pos1 and pos2 to [0, 0, 0] to make only 0, 0, 0 walkthrough, for example. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | pos1 | `number[]` | The one corner of the cuboid. Format [x, y, z] | | pos2 | `number[]` | The top right corner of the cuboid. Format [x, y, z] | | updateType | `WalkThroughType` | The type of update. Whether to make a rect solid, or able to be walked through. Pass DEFAULT_WALK_THROUGH with a previously passed rect to disable any walkthrough setting for that rect. | ## setWalkThroughType Allow a player to walk through a type of block. For blocks that are normally solid and not seethrough, the player will experience slight visual glitches while inside the block. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | blockName | `BlockName` | | | disable | `boolean` | If you've enabled a player to walk through a block and want to make the block solid for them again, pass this with true. Otherwise you only need to pass playerId and blockName | ## showShopTutorial Show the shop tutorial for a player. Will not be shown if they have ever seen the shop tutorial in your game before. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | ## updateEntityNodeMeshAttachment Attach/detach mesh instances to/from an entity ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | eId | `EntityId` | | | node | `EntityNamedNode` | node to attach to | | type | `PNull` | if null, detaches mesh from this node | | opts | `MeshEntityOpts[MeshType]` | | | offset | `[number, number, number]` | | | rotation | `[number, number, number]` | | ## updateMeshEntity Update a mesh entity. If used on a non-mesh entity, will do nothing. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | eId | `EntityId` | | | type | `MeshType` | | | opts | `MeshEntityOpts[MeshType]` | | ## updateShopItem Update selected properties of an existing shop item. For example, { canBuy: true } to allow players to purchase the item. Throws an error if the item does not exist. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | categoryKey | `ShopCategoryKey` | The key of the category containing the item | | itemKey | `ShopItemKey` | The unique key for the item | | changes | `Partial` | Partial shop item properties to update | ## updateShopItemForPlayer Update selected properties of an existing shop item for a specific player. For example, { canBuy: true } to allow this player to purchase the item. Throws an error if the item does not exist. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The player to update the item for | | categoryKey | `ShopCategoryKey` | The key of the category containing the item | | itemKey | `ShopItemKey` | The unique key for the item | | changes | `Partial` | Partial shop item properties to update | # API Reference ## addFollowingEntityToPlayer Add following entity to player ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | eId | `EntityId` | | | offset | `number[]` | | | followsPlayerRotation | `boolean` | | ## addQTE Create and register the UI for the requested quicktime event (QTE) to the screen. Handle the result via the onPlayerFinishQTE engine callback. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | qteParameters | `QTEClientParameters` | includes type and parameters | ### Returns: `QTERequestId` an id that can be passed to deleteQTE ## animateEntity Animates the given entity. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | entityId | `EntityId` | | | animationSchema | `AnimationSchema \| BlockbenchAnimationSchema` | | | initialTimeFraction | `number` | | | animationSpeed | `number` | | ## applyAuraChange Add (or remove if negative) aura to a player. Will not go over max level or under 0 ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | auraDiff | `number` | | ### Returns: `number` The actual change in aura ## applyEffect Apply an effect to a lifeform. Can be an inbuilt effect E.g. "Speed" (speed boost), "Damage" (damage boost). For inbuilt just pass the name of the effect and the functionality is handled in-engine. For custom effect, you pass customEffectInfo. The icon can be an InGameIconName or a bloxd item name. The custom effect onEndCb is an optional helper within which you can undo the effect you applied. Note that onEndCb will not work for press to code boards, code blocks or world code. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | lifeformId | `LifeformId` | | | effectName | `string` | | | duration | `number \| null` | | | customEffectInfo | ` { icon?: IngameIconName \| ItemName; onEndCb?: () => void; displayName?: string \| TranslatedText } & Partial ` | | ## applyHealthChange ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | lifeformId | `LifeformId` | | | changeAmount | `number` | Must be an integer. A positive amount will increase the entity's health. A negative amount will decrease the entity's shield first, then their health. | | whoDidDamage | ` LifeformId \| { lifeformId: LifeformId; withItem: string } ` | Optional - If damage done by another player | | broadcastLifeformHurt | `boolean` | | ### Returns: `boolean` ## applyImpulse Apply an impulse to an entity ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | eId | `EntityId` | | | xImpulse | `number` | | | yImpulse | `number` | | | zImpulse | `number` | | ## applyMeleeHit Make it as if hittingEId hit hitEId ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | hittingEId | `LifeformId` | | | hitEId | `LifeformId` | | | dirFacing | `number[]` | | | bodyPartHit | `PNull` | | | overrides | ` { damage?: PNull heldItemName?: PNull horizontalKbMultiplier?: number verticalKbMultiplier?: number } ` | | ### Returns: `boolean` ## attemptApplyDamage Apply damage to a lifeform. eId is the player initiating the damage, hitEId is the lifeform being hit. It is recommended to self-inflict damage when the game code wants to apply damage to a lifeform. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | { eId, hitEId, attemptedDmgAmt, withItem, bodyPartHit = undefined, attackDir = undefined, showCritParticles = false, reduceVerticalKbVelocity = true, horizontalKbMultiplier = 1, verticalKbMultiplier = 1, broadcastEntityHurt = true, attackCooldownSettings = null, hittingSoundOverride = null, ignoreOtherEntitySettingCanAttack = false, isTrueDamage = false, damagerDbId = null, } | `PlayerAttemptDamageOtherPlayerOpts` | | ### Returns: `boolean` whether the attack damaged the lifeform ## attemptCreateMeshEntity Try to create a mesh entity. This creates an entity whose mesh position is synced with clients. Set entity position using setPosition There is a limit to the number of mesh entities and throwables that can be created, with an even smaller limit for mesh entities with physics. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | type | `MeshType` | | | opts | `MeshEntityOpts[MeshType]` | | | name | `string` | The default name for the nametag | | physicsOptions | `MeshEntityPhysicsOpts` | Physics Options | | initiatorId | `EntityId` | The entity that initiated the creation of the mesh entity. | ### Returns: `PNull` null if the entity creation failed, otherwise the entity ID. ## attemptCreateThrowable Try to create a throwable entity. Similar to creating a mesh entity and uses the same rate limiting. However, this uses the predefined throwables system and physics used by throwable items with the game Each throwable item has its own behaviour already, including default velocity, damage and gravity multipliers. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | throwerEId | `EntityId` | | | itemName | `ThrowableItem` | Must be an Item that is usually throwable in-engine | | position | `[number, number, number]` | Starting position | | direction | `[number, number, number]` | | | velocityMult | `number` | Multiplier for the default velocity of the throwable item | | damageMult | `number` | Multiplier for the default damage of the throwable item | | gravityMult | `number` | Multiplier for the default gravity of the throwable item | | attributes | `ItemAttributes` | item attributes (currently used only for the "Boomerag" item) | ### Returns: `string` null if throwable creation failed, otherwise the entity ID. ## attemptSpawnMob Try to spawn a mob into the world at a given position. Returns null on failure. WARNING: Either the "onPlayerAttemptSpawnMob" or the "onWorldAttemptSpawnMob" game callback will be called depending on whether "spawnerId" is provided. Calling this function inside those callbacks risks infinite recursion. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | mobType | `TMobType` | | | x | `number` | | | y | `number` | | | z | `number` | | | opts | `MobSpawnOpts` | Includes: - mobHerdId The ID of this mob's herd. (A mob herd represents a collection of mobs that move together.) - spawnerId The ID of the player who tried to spawn this mob. - mobDbId A persistent ID for the mob. This can be useful when loading mob data from the database. If the DB ID is already taken, null will be returned. - name If set, gives the mob a name that will be displayed as a nametag above their head. - playSoundOnSpawn - variation - physicsOpts { width: number; height: number; collidesEntities: boolean } | ### Returns: `PNull` null if the mob could not be spawned. This can happen when there are too many mobs in the world for the current number of players in the lobby, or if the area is protected e.g. by spawn area protection. ## attemptWorldChangeBlock Initiate a block change "by the world". This ends up calling the onWorldChangeBlock and only makes the change if not prevented by game/plugins. initiatorDbId is null if the change was initiated by the game code. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | initiatorDbId | `PNull` | | | x | `number` | | | y | `number` | | | z | `number` | | | blockName | `BlockName` | | | extraInfo | `WorldBlockChangedInfo` | | ### Returns: `"preventChange" | "preventDrop" | void` "preventChange" if the change was prevented, "preventDrop" if the change was allowed but without dropping any items, and undefined if the change was allowed with an item drop ## blockCoordToChunkId Get the unique id of the chunk containing pos in the current map ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | pos | `number[]` | | ### Returns: `string` ## blockIdToBlockName Goes from block id to block name. The reverse of blockNameToBlockId ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | blockId | `BlockId` | | ### Returns: `BlockName` ## blockNameToBlockId Get the numeric id of a block used in the ndarrays returned from getChunk I.e. chunk.blockData.set(x, y, z, api.blockNameToBlockId("Dirt")) or chunk.blockData.get(x, y, z) === api.blockNameToBlockId("Dirt") ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | blockName | `BlockName` | | | allowInvalidBlock | `boolean` | Don't throw an error if the block name is invalid. Defaults false. If true and name is invalid, returns null. | ### Returns: `PNull` ## broadcastMessage Send a message to everyone ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | message | `string \| CustomTextStyling` | The text contained within the message. Can use `Custom Text Styling`. | | style | ` { fontWeight?: number \| string; color?: string } ` | An optional style argument. Can contain values for fontWeight and color of the message. style is ignored if message uses custom text styling (i.e. is not a string). | ## broadcastSound See documentation for api.playSound ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | soundName | `string` | | | volume | `number` | | | rate | `number` | | | posSettings | ` { playerIdOrPos: PlayerId \| number[] maxHearDist?: number refDistance?: number } ` | | | exceptPlayerId | `PlayerId` | | ## calcExplosionForce ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | eId | `EntityId` | | | explosionType | `ExplosionType` | | | knockbackFactor | `number` | | | explosionRadius | `number` | | | explosionPos | `number[]` | | | ignoreProjectiles | `boolean` | | ### Returns: ` { force: [number, number, number]; forceFrac: number; } ` ## canOpenStandardChest Checks if a player is able to open a chest at a given location, as per the rules laid out by the "onPlayerAttemptOpenChest" game callback. Returns true if the player can open the chest, false if they cannot, and void if the chest does not exist. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | chestX | `number` | | | chestY | `number` | | | chestZ | `number` | | ### Returns: `PNull` ## changePlayerIntoSkin Change a part of a player's skin. UGC code is restricted to cosmetics from packs with ugcSelectable; internal code can use any cosmetics. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | Player to change | | cosmeticType | `CosmeticType` | Type of cosmetic | | cosmeticName | `CosmeticName` | Chosen cosmetic, will be made lowercase automatically | ## checkValid Check your game (and, optionally, a entity) is still valid and executing. Useful if you're using async functions and await within your game. If you use await/async or promises and do not check this, your game could have closed and then the rest of your async code executes. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | entityId | `PNull` | | ### Returns: `boolean` ## chunkIdToBotLeftCoord Get the co-ordinates of the block in the chunk with the lowest x, y, and z co-ordinates ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | chunkId | `string` | | ### Returns: `[number, number, number]` ## clearDirectionArrow Clear a directional arrow from the player's screen. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The player to clear the arrow for | | id | `PNull` | The arrow identifier to clear. If null, clears all arrows for this player. | ## clearInventory Clear the players inventory ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | ## clearKillstreak Clears the player's current killstreak ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | ## closeChestForPlayer Close a chest for a player. If the player does not have a chest open, do nothing. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | ## configureShopCategory Set properties of a shop category. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | categoryKey | `ShopCategoryKey` | The key of the category to configure | | config | `ShopCategoryConfig` | Category configuration properties | ## configureShopCategoryForPlayer Configure a shop category for a specific player. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The player to configure the category for | | categoryKey | `ShopCategoryKey` | The key of the category to configure | | config | `ShopCategoryConfig` | Category configuration properties | ## createItemDrop Create a dropped item. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | x | `number` | | | y | `number` | | | z | `number` | | | itemName | `ItemName` | Name of the item. Any item name, including blocks and 'Air' | | amount | `PNull` | The amount of the item to include in the drop - so when the player picks up the item drop, they get this many of the item. | | mergeItems | `boolean` | Whether to merge the item into a nearby item of same type, if one exists. Defaults to false. | | attributes | `ItemAttributes` | Attributes of the item being dropped | | timeTillDespawn | `number` | Time till the item automatically despawns in milliseconds. Max of 5 mins. | | dropperId | `PNull` | Who dropped the item. | | options | `ItemDropOptions` | Additional options, such as doPhysics and size. | ### Returns: `PNull` the id you can pass to setCantPickUpItem, or null if the item drop limit was reached ## createMobHerd Create a mob herd. A mob herd represents a collection of mobs that move together. ### Returns: `MobHerdId` ## createShopItem Create a new shop item under the given category. Will create a new category if it does not exist. If the shop item already exists then it will be replaced. If any per-player overrides exist under the same categoryKey and itemKey then they will be deleted. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | categoryKey | `ShopCategoryKey` | The key of the category to create the item in | | itemKey | `ShopItemKey` | The unique key for the item | | item | `ShopItem` | The shop item to create (will be mutated) | ## createShopItemForPlayer Create a new shop item for a specific player. Will create a new category if it does not exist. Will replace any overrides this player already has for the same item. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The player to create the item for | | categoryKey | `ShopCategoryKey` | The key of the category to create the item in | | itemKey | `ShopItemKey` | The unique key for the item | | item | `ShopItem` | The shop item to create (will be mutated) | ## deleteAllLobbyDbValues Deletes all database values that are saved per lobby. ## deleteAllPlayerDbValues Deletes all database values that are saved per player. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | ## deleteItemDrop Delete an item drop by item drop entity ID ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | itemId | `EntityId` | | ## deleteLobbyDbValue Deletes a database value that is saved per lobby. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | key | `string` | | ## deleteMeshEntity Delete a mesh entity ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | eId | `EntityId` | Returns whether the api successfully deleted the meshEntity | ### Returns: `boolean` ## deletePlayerDbValue Deletes a database value that is saved per player. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | key | `string` | | ## deleteQTE Delete a quicktime event from the screen ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | id | `QTERequestId` | Returned from the addQTE request you want to cancel | ## deleteShopItem Delete an existing shop item. Throws an error if the item does not exist. Will also delete all per-player overrides for the shop item. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | categoryKey | `ShopCategoryKey` | The key of the category containing the item | | itemKey | `ShopItemKey` | The unique key for the item | ## deleteThrowable Delete a throwable entity before it automatically removes itself. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | eId | `EntityId` | | ### Returns: `boolean` true if the entity was deleted, false if it was not a throwable entity ## despawnMob Dispose of a mob's state and remove them from the world without triggering "on death" flows. Always succeeds. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | mobId | `MobId` | | ## editItemCraftingRecipes Edit the crafting recipes for a player. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | itemName | `ItemName` | | | recipesForItem | `RecipesForItem` | | ## forceRespawn Force respawn a player ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | respawnPos | `number[]` | | ## getAuraInfo Get the aura info for a player ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | ### Returns: ` { level: number; totalAura: number; auraPerLevel: number } ` ## getBlock Get the name of a block. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | x | `number \| number[]` | could be an array [x, y, z]. If so, the other params shouldn't be passed. | | y | `number` | | | z | `number` | | ### Returns: `BlockName` ## getBlockCoordinatesPlayerStandingOn Get the co-ordinates of the blocks the player is standing on as a list. For example, if the center of the player is at 0,0,0 this function will return [[0, -1, 0], [-1, -1, 0], [0, -1, -1], [-1, -1, -1]] If the player is just standing on one block, the function would return e.g. [[0, 0, 0]] If the player is middair then returns an empty list []. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | ### Returns: `number[][]` ## getBlockData Get stored data about a block in a performant manner. Data is cleared when block changes. E.g. chest Works well with blocks marked tickable (e.g. wheat) ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | x | `number` | | | y | `number` | | | z | `number` | | ### Returns: `any` ## getBlockId Used to get the block id at a specific position. Intended only for use in hot code paths - default to getBlock for most use cases ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | x | `number` | | | y | `number` | | | z | `number` | | ### Returns: `BlockId` ## getBlockSolidity Returns whether a block is solid or not. E.g. Grass block is solid, while water, ladder and water are not. Will be true if the block is unloaded. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | x | `number \| number[]` | | | y | `number` | | | z | `number` | | ### Returns: `boolean` ## getBlockTypesPlayerStandingOn Get the types of block the player is standing on For example, if a player is standing on 4 dirt blocks, this will return ["Dirt", "Dirt", "Dirt", "Dirt"] ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | ### Returns: `any[]` ## getChunk Only use this instead of getBlock if you REALLY need the performance (i.e. you are iterating over tens of thousands of blocks) ReturnedObject.blockData is a 32x32x32 ndarray of block ids (see https://www.npmjs.com/package/ndarray) Each block id is a 16-bit number The ndarray should only be read from, writing to it will result in desync between the server and client ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | pos | `number[]` | The returned chunk contains pos | ### Returns: `PNull` null if the chunk is not loaded in a persisted world. ReturnedObject.blockData is an ndarray that can be accessed (but modifications have to be saved with resetChunk). ## getClientOption Returns the current value of a client option ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | option | `PassedOption` | | ### Returns: `ClientOptions[PassedOption]` ## getCurrentKillstreak Gets the player's current killstreak ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | ### Returns: `number` ## getDefaultMobSetting Returns the current default value for a mob setting. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | mobType | `TMobType` | | | setting | `TMobSetting` | | ### Returns: `MobSettings[TMobSetting]` ## getEffects Get all the effects currently applied to a lifeform. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | lifeformId | `LifeformId` | | ### Returns: `string[]` ## getEmptyChunk Use this to get a chunk ndarray you can edit and set in resetChunk. Only use chunk helpers if you REALLY need the performance (i.e. you are iterating over tens of thousands of blocks) ReturnedObject.blockData is a 32x32x32 ndarray of air. (see https://www.npmjs.com/package/ndarray) Each block id is a 16-bit number ### Returns: `GameChunk` ## getEntitiesInRect Get the entities in the rect between [minX, minY, minZ] and [maxX, maxY, maxZ] ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | minCoords | `number[]` | | | maxCoords | `number[]` | | ### Returns: `EntityId[]` ## getEntityHeading ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | entityId | `EntityId` | | ### Returns: `number` ## getEntityName Get the in game name of an entity. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | entityId | `EntityId` | | ### Returns: `string` ## getEntityRotation Get the rotation for a server-auth entity. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | entityId | `EntityId` | | ### Returns: `[number, number, number]` ## getEntityType ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | entityId | `EntityId` | | ### Returns: `EntityType` ## getHealth Get the current health of an entity. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | entityId | `PlayerId` | | ### Returns: `number` ## getHeldItem Get the currently held item of a player Returns null if no item is being held If an item is held, return an object of the format {name: itemName, amount: amountOfItem} ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | ### Returns: `PNull` ## getInitialItemMetadata Get the metadata about a block or item before stats have been modified by any client options (i.e. its entry in the initial metadata object) ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | itemName | `string` | | ### Returns: `Partial` ## getInventoryFreeSlotCount Get the amount of free slots in a player's inventory. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | ### Returns: `number` number ## getInventoryItemAmount The amount of an itemName a player has. Returns 0 if the player has none, and a negative number if infinite. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | itemName | `ItemName` | | ### Returns: `number` number ## getItemSlot Get the item at a specific index Returns null if there is no item at that index If there is an item, return an object of the format { name: string; amount: PNull; attributes: ItemAttributes; } ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | itemSlotIndex | `number` | | ### Returns: `PNull` ## getItemStat Get stat info about a block or item Either based on a client option for a player: (e.g. `DirtTtb`) or its entry in the initial metadata object if no client option is set. If null is passed for lifeformId, this is simply its entry in blockMetadata etc. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | lifeformId | `PNull` | | | itemName | `ItemName` | | | stat | `K` | | ### Returns: `AnyMetadataItem[K]` ## getLobbyDbValue Gets a database value that is saved per lobby. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | key | `string` | | ### Returns: `PNull` ## getLobbyName Get the name of the lobby this game is running in. ### Returns: `string` ## getLobbyType Returns if the current lobby the game is running in is special - e.g. a discord guild or dm, or simply a standard lobby ### Returns: `LobbyType` ## getMetaInfo Splits the block name by '|'. If no meta info, metaInfo is '' ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | blockName | `BlockName \| null \| undefined` | | ### Returns: `ItemMetaInfo` ## getMobAiState Gets the current AI state for the given mob. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | mobId | `MobId` | | ### Returns: ` { state: MobAiState; params: MobAiStateParams } ` ## getMobIds Get the mob IDs of all mobs in the world. ### Returns: `MobId[]` ## getMobSetting Get the current value of a mob setting for a specific mob. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | mobId | `MobId` | | | setting | `TMobSetting` | | | returnDefaultIfNotOverridden | `boolean` | If true, return the default setting if not overridden. | ### Returns: `MobSettings[TMobSetting]` ## getMoonstoneChestItems Get all the items from a moonstone chest in order. Use this instead of repetitive calls to getMoonstoneChestItemSlot Moonstone chests are a type of chest where a player accesses the same contents no matter the location of the moonstone chest ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | ### Returns: `PNull[]` ## getMoonstoneChestItemSlot Get the item in a player's moonstone chest slot. Null if empty Moonstone chests are a type of chest where a player accesses the same contents no matter the location of the moonstone chest ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | idx | `number` | | ### Returns: `PNull` ## getNumMobs Get the number of mobs in the world. ### Returns: `number` ## getNumPlayers Get the number of players in the room ### Returns: `number` ## getOtherEntitySetting Get the value of a player's other-entity setting for a specific entity. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | relevantPlayerId | `PlayerId` | | | targetedEntityId | `EntityId` | | | settingName | `Setting` | | ### Returns: `OtherEntitySettings[Setting]` ## getPlayerCosmetic Get a single equipped cosmetic for a player. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | cosmeticType | `CosmeticType` | Type of cosmetic | ### Returns: `CosmeticName` ## getPlayerDbId Given a player, get their permanent identifier that doesn't change when leaving and re-entering ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | ### Returns: `PlayerDbId` ## getPlayerDbValue Gets a database value that is saved per player. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | key | `string` | | ### Returns: `PNull` ## getPlayerFacingInfo Get the position of a player's camera and the direction (both in Euclidean and spherical coordinates) they are attempting to use an item. The camPos has the same limitations described in getPlayerTargetInfo ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | ### Returns: ` { camPos: [number, number, number]; dir: [number, number, number]; angleDir: AngleDir; moveHeading: number } ` ## getPlayerId Given the name of a player, get their id ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerName | `string` | | ### Returns: `PNull` ## getPlayerIdFromDbId Returns null if player not in lobby ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | dbId | `PlayerDbId` | | ### Returns: `PNull` ## getPlayerIds Get all the player ids. ### Returns: `PlayerId[]` ## getPlayerPartyWhenJoined Returns the party that the player was in when they joined the game. The returned object contains the playerDbIds, as well as the playerIds if available, of the party leader and members. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | ### Returns: `PNull<{ partyCode: string; playerDbIds: PlayerDbId[] }>` ## getPlayerPhysicsState Get physics state for player ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | ### Returns: `PlayerPhysicsStateData` ## getPlayerTargetInfo Get the position of a player's target block and the block adjacent to it (e.g. where a block would be placed) Note: This position is a tick ahead of the client's block target info (noa.targetedBlock), since the client updates the blocktarget before the entities tick (and since it uses the renderposition of the camera) This normally doesn't matter but if you are client predicting something based on noa.targetedBlock (currently only applicable to in-engine code), you should not verify using this ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | ### Returns: ` { position: [number, number, number]; normal: [number, number, number]; adjacent: [number, number, number] } ` ## getPosition Get position of a player / entity. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | entityId | `EntityId` | | ### Returns: `[number, number, number]` ## getSelectedInventorySlotI Get a player's currently selected inventory slot ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | ### Returns: `number` ## getShieldAmount Get the current shield of an entity. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | entityId | `EntityId` | | ### Returns: `number` ## getStandardChestFreeSlotCount Get the amount of free slots in a standard chest Returns null for non-chests ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | chestPos | `number[]` | | ### Returns: `PNull` number ## getStandardChestItemAmount The amount of an itemName a standard chest has. Returns 0 if the standard chest has none, and a negative number if infinite. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | chestPos | `number[]` | | | itemName | `ItemName` | | ### Returns: `number` number ## getStandardChestItems Get all the items from a standard chest in order. Use this instead of repetitive calls to getStandardChestItemSlot ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | chestPos | `number[]` | | ### Returns: `PNull[]` ## getStandardChestItemSlot Get the item at a chest slot. Null if empty otherwise format {name: itemName, amount: amountOfItem} ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | chestPos | `number[]` | | | idx | `number` | | ### Returns: `PNull` ## getUnitCoordinatesLifeformWithin Get the up to 12 unit co-ordinates the lifeform is located within (A lifeform is modelled as having four corners and can be in up to 3 blocks vertically) ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | lifeformId | `LifeformId` | | ### Returns: `number[][]` List of x, y, z positions e.g. [[-1, 0, 0], [-1, 1, 0], [-1, 2, 0]] ## getVelocity Get the velocity of an entity Will return [0, 0, 0] if the entity doesn't have a physics body ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | eId | `EntityId` | | ### Returns: `[number, number, number]` ## giveItem Inventory stuff Give a player an item and a certain amount of that item. Returns the amount of item added to the users inventory. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | itemName | `ItemName` | | | itemAmount | `number` | | | attributes | `ItemAttributes` | An optional object for certain types of item. For guns this can contain the shotsLeft field which is the amount of ammo the gun currently has. | ### Returns: `number` ## giveStandardChestItem Give a standard chest an item and a certain amount of that item. Returns the amount of item added to the chest. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | chestPos | `number[]` | | | itemName | `ItemName` | | | itemAmount | `number` | | | playerId | `PlayerId` | The player who is interacting with the chest. | | attributes | `ItemAttributes` | An optional object for certain types of item. For guns this can contain the shotsLeft field which is the amount of ammo the gun currently has. | ### Returns: `number` ## hasActiveQTE Returns whether the player has any qteRequests ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | ### Returns: `boolean` ## hasItem Whether a player has an item ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | itemName | `ItemName` | | ### Returns: `boolean` bool ## initiateMiddleScreenBar This will initiate the MiddleScreenBar, starting at empty and filling up to full over the given duration. Good to represent cooldowns (eg gun reload) or charged items (eg crossbow) ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | duration | `number` | ms over which the MiddleScreenBar fills up | | chargeExpiresAutomatically | `boolean` | Defaults to true. If true, the bar will disappear upon reaching full. If false, the bar will remain at full until hidden with removeMiddleScreenBar | | horizontalBarRemOffset | `number` | Offset the bar left or right (in css unit - rem) | ## inventoryIsFull Whether the player has space in their inventory to get new blocks ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | ### Returns: `boolean` ## isAlive Whether a lifeform is alive or dead (or on the respawn screen, in a player's case). ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | lifeformId | `LifeformId` | | ### Returns: `boolean` ## isBlockInLoadedChunk Check if the block at a specific position is in a loaded chunk. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | x | `number` | | | y | `number` | | | z | `number` | | ### Returns: `boolean` ## isInsideRect Check if a position is within a cubic rectangle ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | coordsToCheck | `number[]` | | | pos1 | `number[]` | position of one corner | | pos2 | `number[]` | position of opposite corner | | addOneToMax | `boolean` | | ### Returns: `boolean` ## isMobile Whether the player is on a mobile device or a computer. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | ### Returns: `boolean` ## isPlayerCrouching Check whether a player is crouching ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | ### Returns: `boolean` ## isPublicLobby Integer lobby names are public ### Returns: `boolean` boolean ## kickPlayer ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | reason | `string` | | ## killLifeform Kill a lifeform. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | lifeformId | `LifeformId` | | | whoKilled | ` LifeformId \| { lifeformId: LifeformId; withItem: string } ` | Optional | ## matchmakePlayer Tell a player to disconnect from the current lobby and join a new one. To connect to a specific variation, format is `gamename_variation`. For Custom Games, this will be `classic_playerSchematic|XXXXXXXXXX`. NOTE: Players won't disconnect immediately (they may play an ad before being redirected). ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | game | `string` | Defaults to the current game. | | lobbyName | `string` | Defaults to "Quick Play" | ## now Obtain Date.now() value saved at start of current game tick ### Returns: `number` ## openChestForPlayer Open a chest for a player. If there is no chest, or the player cannot open it, do nothing. WARNING: This may call "onPlayerAttemptOpenChest" to determine if the player has permission to open it. Using this function inside that callback risks infinite recursion. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | x | `number` | | | y | `number` | | | z | `number` | | ## openShop Open the shop UI for a player ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | toggle | `boolean` | Whether to close the shop if it's already open | | forceCategoryKey | `PNull` | If set, will change the shop to this category | | onlyIfNonEmpty | `boolean` | If true, will only open the shop if the category (or shop, if no category is provided) is non-empty | ## playClientPredictedSound See documentation for api.playSound ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | soundName | `string` | | | volume | `number` | | | rate | `number` | | | posSettings | ` { playerIdOrPos: PlayerId \| number[] maxHearDist?: number refDistance?: number } ` | | | predictedBy | `PlayerId` | | ## playerIsInGame Whether a player is currently in the game ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | ### Returns: `boolean` ## playerIsLoggedIn ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | ### Returns: `boolean` ## playParticleEffect Play particle effect on all clients, or only on some clients if clientPredictedBy is specified ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | opts | `TempParticleSystemOpts \| ParticlePresetOpts` | | | clientPredictedBy | `PlayerId` | Play only on clients where client with playerId clientPredictedBy is not invisible, transparent, or themselves | ## playSound ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | hears the sound | | soundName | `string` | Can also be a prefix. If so, a random sound with that prefix will be played | | volume | `number` | 0-1. If it's too quiet and volume is 1, normalise your sound in audacity | | rate | `number` | The speed of playback. Also affects pitch. 0.5-4. Lower playback = lower pitch Good for varying the sound. E.g. item pickup sound has a random rate between 1 and 1.5. | | posSettings | ` { playerIdOrPos: PlayerId \| number[] maxHearDist?: number refDistance?: number } ` | : PlayerId \| number[], maxHearDist: number, refDistance: number} playerIdOrPos: The player the sound originates from, or the position of the sound maxHearDist: sound is not played if player is further than this. Default 15 refDistance: higher means the sound decreases less in volume with distance. Default 3. Hitting is 4. Guns are 10 | ## progressBarUpdate Update the progress bar in the bottom right corner. Can be queued. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | toFraction | `number` | The fraction of the progress bar you want to be filled up. | | toDuration | `number` | The time it takes for the bar to reach the given toFraction in ms. If this is too low and you queue multiple updates, this toFraction could be skipped. Treat 200ms as a minimum. | ## raycastForBlock Raycast for a block in the world. Given a position and a direction, find the first block that the "ray" hits. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | fromPos | `number[]` | | | dirVec | `number[]` | | ### Returns: `BlockRaycastResult` ## removeAppliedSkin Remove gamemode-applied skin from a player ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | ## removeEffect Remove an effect from a lifeform. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | lifeformId | `LifeformId` | | | name | `string` | | ## removeFollowingEntityFromPlayer Remove following entity from player ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | entityEId | `EntityId` | | ## removeItemCraftingRecipes Removes crafting recipes ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | itemName | `PNull` | Removes all crafting recipes for the given player if null, otherwise removes the crafting recipes for the given item. | ## removeItemName Remove an amount of item from a player's inventory ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | itemName | `ItemName` | | | amount | `number` | | ## removeMiddleScreenBar If there is any current middle screen bar running, this will hide it ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | ## resetCanChangeBlockRect Remove any previous can/cant change block rect settings for a player ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | pos1 | `number[]` | | | pos2 | `number[]` | | ## resetCanChangeBlockType Remove any previous can/cant change block type settings for a player ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | blockName | `BlockName` | | ## resetItemCraftingRecipes Reset the crafting recipes for a given back to its original bloxd state ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | itemName | `PNull` | Resets all crafting recipes for the given player if null, otherwise resets the crafting recipes for the given item. | ## resetShopItemForPlayer Delete a specific player's overrides for a shop item. Like other methods, it doesn't matter whether the overrides were created using createShopItemForPlayer or by using updateShopItemForPlayer instead. This method does nothing if the overrides don't exist or are defined internally by the engine. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The player to reset the item for | | categoryKey | `ShopCategoryKey` | The key of the category containing the item | | itemKey | `ShopItemKey` | The unique key for the item | ## scalePlayerMeshNodes Scale node of a player's mesh by 3d vector. State from prior calls to this api is lost so if you want to have multiple nodes scaled, pass in all the scales at once. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | nodeScales | `EntityMeshScalingMap` | | ## sendFlyingMiddleMessage Send a flying middle message to a specific player ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | Id of the player | | message | `string \| CustomTextStyling` | The text contained within the message. Can be either a string or use `Custom Text Styling`. | | distanceFromAction | `number` | The distance from the action that has caused this message to be displayed, this value will be used to determine how the message flies across the screen. | | lifetimeMs | `number` | How long the message will be visible in milliseconds. Defaults to 1000ms. | ## sendHitmarker Show a hitmarker on the player's screen (the X-shaped crosshair flash indicating a successful hit). Useful for custom weapons or things that need visual hit feedback. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The player to show the hitmarker to | | isCrit | `boolean` | If true, shows an enhanced critical-hit hitmarker with a longer, more dramatic animation | | directionVector | `PNull` | Optional [x, y, z] direction vector. When provided, the hitmarker appears at the projected screen position of that direction rather than at the centre of the screen. Same flow as mobile melee attacks where the tap point differs from screen centre. | ## sendMessage Send a message to a specific player ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | Id of the player | | message | `string \| CustomTextStyling` | The text contained within the message. Can use `Custom Text Styling`. | | style | ` { fontWeight?: number \| string; color?: string } ` | An optional style argument. Can contain values for fontWeight and color of the message. style is ignored if message uses custom text styling (i.e. is not a string). | ## sendOverShopInfo Show a message over the shop in the same place that a shop item's onBoughtMessage is shown. Displays for a couple seconds before disappearing Use case is to show a dynamic message when player buys an item ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | info | `string \| CustomTextStyling` | | ## sendTopRightHelper ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | icon | `string` | Can be any icon from font-awesome. | | text | `string` | The text to send. | | opts | ` { duration?: number width?: number height?: number color?: string iconSizeMult?: number textAndIconColor?: string fontSize?: string } ` | Can include keys duration, width, height, color, iconSizeMult. Default opts: { duration: 8, // seconds width: 400px, height: 100px, color: 'rgb(102, 102, 102)', // must be rgb in this format (hex not supported), iconSizeMult: 5, textAndIconColor: "white", // can be any colour supported by css (e.g. hex, rgb), fontSize: '17px', } | ## setAuraLevel Set the aura level for a player - shortcut for setTotalAura(level * auraPerLevel) ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | level | `number` | | ## setBlock Set a block. Valid names are any block name, including 'Air' This function is optimised for setting broad swathes of blocks. For example, if you have a 50x50x50 area you need to turn to air, it will run performantly if you call this in double nested loops. IF you're only changing a few blocks, you want this to be super snappy for players, AND you're calling this outside of your _tick function, you can use api.setOptimisations(false). If you want the optimisations for large quantities of blocks later on, then call api.setOptimisations(true) when you're done. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | x | `number \| number[]` | Can be an array | | y | `number \| BlockName` | Should be blockname if first param is array | | z | `number` | | | blockName | `BlockName` | | ## setBlockData Store data about a block in a performant manner. Data is cleared when block changes. E.g. chest Works well with blocks marked tickable (e.g. wheat) ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | x | `number` | | | y | `number` | | | z | `number` | | | data | `object` | | ## setBlockRect Helper function that sets all blocks in a rectangle to a specific block. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | pos1 | `number[]` | array [x, y, z] | | pos2 | `number[]` | array [x, y, z] | | blockName | `BlockName` | | ## setBlockWalls Create walls by providing two opposite corners of the cuboid ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | pos1 | `number[]` | array [x, y, z] | | pos2 | `number[]` | array [x, y, z] | | blockName | `BlockName` | | | hasFloor | `boolean` | | | hasCeiling | `boolean` | | ## setCallbackValueFallback Set a default value to be returned by your callback code if it throws an error. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | callbackName | string | The name of the callback to set the default value for | | defaultValue | any | The default value to return if the callback throws an error | ## setCameraDirection Set the direction the player is looking. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | direction | `number[]` | a vector of the direction to look, format [x, y, z] | ## setCameraZoom Set camera zoom for a player ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | zoom | `number` | | ## setCanChangeBlock Let a player change a block at a specific co-ordinate. Useful when client option canChange is false. Overrides blockRect and blockType settings, so also useful when you have disallowed changing of a block type with setCantChangeBlockType. Using this on 1000s of blocks will cause lag - if that is needed, find a way to use setCanChangeBlockType. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | x | `number` | | | y | `number` | | | z | `number` | | ## setCanChangeBlockRect Make it so a player can Change blocks within two points. Coordinates are inclusive. E.g. if [0, 0, 0] is pos1 and [1, 1, 1] is pos2 then the 8 blocks contained within low and high will be able to be broken. Overrides setCantChangeBlockType ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | pos1 | `number[]` | Arg as [x, y, z] | | pos2 | `number[]` | Arg as [x, y, z] | ## setCanChangeBlockType Lets a player Change a block type. Valid names are any block name, including 'Air' Less priority than cant change block pos/can change block rect ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | blockName | `BlockName` | | ## setCantChangeBlock Prevents a player from changing a block at a specific co-ordinate. Useful when client option canChange is true. Overrides blockRect and blockType settings, so also useful when you have allowed changing of a block type with setCantChangeBlockType. Using this on 1000s of blocks will cause lag - if that is needed, find a way to use setCantChangeBlockType. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | x | `number` | | | y | `number` | | | z | `number` | | ## setCantChangeBlockRect Make it so a player cant Change blocks within two points. Coordinates are inclusive. E.g. if [0, 0, 0] is pos1 and [1, 1, 1] is pos2 then the 8 blocks contained within pos1 and pos2 won't be able to be broken. Overrides setCanChangeBlockType ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | pos1 | `number[]` | Arg as [x, y, z] | | pos2 | `number[]` | Arg as [x, y, z] | ## setCantChangeBlockType Stops a player from changing a block type. Valid names are any block name, including 'Air' Less priority than can change block pos/can change block rect ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | blockName | `BlockName` | | ## setCantPickUpItem Prevent a player from picking up an item. itemId returned by createItemDrop ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | itemId | `EntityId` | | ## setClientOption Modify a client option at runtime and send to the client if it changed ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | option | `PassedOption` | The name of the option | | value | `ClientOptions[PassedOption]` | The new value of the option | ## setClientOptions Modify client options at runtime ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | optionsObj | `Partial` | An object which contains key value pairs of new settings. E.g {canChange: true, speedMultiplier: false} | ## setClientOptionToDefault Sets a client option to its default value. This will be the value stored in your game's defaultClientOptions, otherwise Bloxd's default. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | option | `ClientOption` | | ## setDefaultMobSetting Set the default value for a mob setting. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | mobType | `TMobType` | | | setting | `TMobSetting` | | | value | `MobSettings[TMobSetting]` | | ## setDirectionArrow Show a directional arrow indicator on the player's screen pointing toward a world position. When the position is off-screen the indicator is a rotating chevron at the screen edge. When the position is on-screen it becomes a small marker dot. The arrow persists until explicitly cleared via `clearDirectionArrow`. Calling again with the same `id` updates the existing arrow in-place. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The player to show the arrow to | | id | `string` | Unique identifier for this arrow (allows multiple concurrent arrows) | | position | `number[]` | [x, y, z] world position the arrow should point toward | | text | `PNull` | Optional label rendered below the indicator. Supports CustomTextStyling for rich text with icons/colours. | | showDistance | `boolean` | If true, displays the distance (in blocks) from the player to the arrow position. | | style | `PNull` | Optional style object (same format as CustomTextStyling's StyledText `style`). Controls chevron/marker colour, label typography, and opacity. | ## setEntityHeading ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | entityId | `EntityId` | | | newHeading | `number` | | ## setEntityRotation Set the rotation for a server-auth entity. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | entityId | `EntityId` | | | xRotation | `number` | | | yRotation | `number` | | | zRotation | `number` | | ## setEveryoneSettingForPlayer Set a player's other-entity setting for every lifeform in the game. includeNewJoiners=true means that the player will have the setting applied to new joiners. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | settingName | `Setting` | | | settingValue | `OtherEntitySettings[Setting]` | | | includeNewJoiners | `boolean` | | ## setHealth Set the current health of an entity. If you want to set their health to more than their current max health, the optional increaseMaxHealthIfNeeded must be true. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | entityId | `EntityId` | | | newHealth | `PNull` | Can be null to make the player not have health | | whoDidDamage | ` LifeformId \| { lifeformId: LifeformId; withItem: string } ` | Optional | | increaseMaxHealthIfNeeded | `boolean` | Optional | ### Returns: `boolean` ## setItemAmount Set the amount of an item in an item entity ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | itemId | `EntityId` | | | newAmount | `number` | | ## setItemSlot Put an item in a specific index. Default hotbar is indexes 0-9 ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | itemSlotIndex | `number` | 0-indexed | | itemName | `ItemName` | Can be 'Air', in which case itemAmount will be ignored and the slot will be cleared. | | itemAmount | `PNull` | -1 for infinity. Should not be set, or null, for items that are not stackable. | | attributes | `ItemAttributes` | An optional object for certain types of item. For guns this can contain the shotsLeft field which is the amount of ammo the gun currently has. | | tellClient | `boolean` | whether to tell client about it - results in desync between client and server if client doesnt locally perform the same action | ## setItemStat Set a stat attribute for a block or item NOTE: Only a subset of stats are customisable this way. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | itemName | `ItemName` | | | stat | `K` | | | value | `AnyMetadataItem[K]` | | ## setLobbyDbValue Sets a database value that is saved per lobby. This persists between sessions. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | key | `string` | | | value | `string \| number` | | ## setMaxPlayers Update the max players and soft max players matchmaking will use softMaxPlayers is the number of players that matchmaking will route to using "Quick Play". Once the softMaxPlayers limit is reached, this lobby can only be joined by requesting the lobby name or joining a friend. maxPlayers is the absolute maximum: a lobby will not have more players than this. Tip: softMaxPlayers should be around 90% of maxPlayers WARNING: This change is not immediate, as it takes a while for matchmaking to find out. Also, this will not kick players out of the lobby if set to a lower value than the current player count. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | softMaxPlayers | `number` | | | maxPlayers | `number` | | ## setMobAiState Sets the current AI state for the given mob. Some AI states will require context such as the ID of the lifeform being chased. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | mobId | `MobId` | | | state | `TState` | | | params | `MobAiStateParams` | | ## setMobSetting Set the current value of a mob setting for a specific mob. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | mobId | `MobId` | | | setting | `TMobSetting` | | | value | `MobSettings[TMobSetting]` | | ## setMoonstoneChestItemSlot Moonstone chests are a type of chest where a player accesses the same contents no matter the location of the moonstone chest ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | idx | `number` | 0-indexed | | itemName | `ItemName` | Can be 'Air', in which case itemAmount will be ignored and the slot will be cleared. | | itemAmount | `number` | -1 for infinity. Should not be set, or null, for items that are not stackable. | | metadata | `ItemAttributes` | An optional object for certain types of item. For guns this can contain the shotsLeft field which is the amount of ammo the gun currently has. | ## setOtherEntitySetting Set a player's other-entity setting for a specific entity. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | relevantPlayerId | `PlayerId` | | | targetedEntityId | `EntityId` | | | settingName | `Setting` | | | settingValue | `OtherEntitySettings[Setting]` | | ## setOtherEntitySettings Set many of a player's other-entity settings for a specific entity. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | relevantPlayerId | `PlayerId` | | | targetedEntityId | `EntityId` | | | settingsObject | `Partial` | | ## setPlayerDbValue Sets a database value that is saved per player. This persists between sessions and between lobbies for custom games. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | key | `string` | | | value | `string \| number` | | ## setPlayerOpacity Set a player's opacity A simple helper that calls setTargetedPlayerSettingForEveryone ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | opacity | `number` | | ## setPlayerOpacityForOnePlayer Set the level of viewable opacity by one player on another player A simple helper that calls setOtherEntitySetting ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerIdWhoViewsOpacityPlayer | `PlayerId` | The player who sees that with opacity | | playerIdOfOpacityPlayer | `PlayerId` | The player/player model who is given opacity | | opacity | `number` | | ## setPlayerPhysicsState Set physics state of player (vehicle type and tier) ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | physicsState | `PlayerPhysicsStateData` | | | positionOffset | `[number, number, number]` | Optional offset to adjust the player's collision box | ## setPlayerPose Set the pose of the player ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | pose | `PlayerPose` | | | poseOffset | `[number, number, number]` | | ## setPosition Set position of a player / entity. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | entityId | `EntityId` | | | x | `number \| number[]` | Can also be an array, in which case y and z shouldn't be passed | | y | `number` | | | z | `number` | | ## setSelectedInventorySlotI Force the player to have the ith inventory slot selected. E.g. newI 0 makes the player have the 0th inventory slot selected ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | newI | `number` | integer from 0-9 | ## setShieldAmount Set the current shield of a lifeform. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | lifeformId | `LifeformId` | | | newShieldAmount | `number` | | ## setStandardChestItemSlot ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | chestPos | `number[]` | | | idx | `number` | 0-indexed | | itemName | `ItemName` | Can be 'Air', in which case itemAmount will be ignored and the slot will be cleared. | | itemAmount | `number` | -1 for infinity. Should not be set, or null, for items that are not stackable. | | playerId | `PlayerId` | The player who is interacting with the chest. | | attributes | `ItemAttributes` | An optional object for certain types of item. For guns this can contain the shotsLeft field which is the amount of ammo the gun currently has. | ## setTargetedPlayerSettingForEveryone Set every player's other-entity setting to a specific value for a particular player. includeNewJoiners=true means that new players joining the game will also have this other player setting applied. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | targetedPlayerId | `PlayerId` | | | settingName | `Setting` | | | settingValue | `OtherEntitySettings[Setting]` | | | includeNewJoiners | `boolean` | | ## setTotalAura Sets the total aura for a player. Will not go over max level or under 0 ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | totalAura | `number` | | ## setVelocity Set the velocity of an entity ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | eId | `EntityId` | | | x | `number` | | | y | `number` | | | z | `number` | | ## setWalkThroughRect Allow a player to walk through (or not walk through) voxels that are located within a given rectangle. For blocks that are normally solid and not seethrough, the player will experience slight visual glitches while inside the block. You could set both pos1 and pos2 to [0, 0, 0] to make only 0, 0, 0 walkthrough, for example. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | pos1 | `number[]` | The one corner of the cuboid. Format [x, y, z] | | pos2 | `number[]` | The top right corner of the cuboid. Format [x, y, z] | | updateType | `WalkThroughType` | The type of update. Whether to make a rect solid, or able to be walked through. Pass DEFAULT_WALK_THROUGH with a previously passed rect to disable any walkthrough setting for that rect. | ## setWalkThroughType Allow a player to walk through a type of block. For blocks that are normally solid and not seethrough, the player will experience slight visual glitches while inside the block. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | blockName | `BlockName` | | | disable | `boolean` | If you've enabled a player to walk through a block and want to make the block solid for them again, pass this with true. Otherwise you only need to pass playerId and blockName | ## showShopTutorial Show the shop tutorial for a player. Will not be shown if they have ever seen the shop tutorial in your game before. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | ## updateEntityNodeMeshAttachment Attach/detach mesh instances to/from an entity ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | eId | `EntityId` | | | node | `EntityNamedNode` | node to attach to | | type | `PNull` | if null, detaches mesh from this node | | opts | `MeshEntityOpts[MeshType]` | | | offset | `[number, number, number]` | | | rotation | `[number, number, number]` | | ## updateMeshEntity Update a mesh entity. If used on a non-mesh entity, will do nothing. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | eId | `EntityId` | | | type | `MeshType` | | | opts | `MeshEntityOpts[MeshType]` | | ## updateShopItem Update selected properties of an existing shop item. For example, { canBuy: true } to allow players to purchase the item. Throws an error if the item does not exist. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | categoryKey | `ShopCategoryKey` | The key of the category containing the item | | itemKey | `ShopItemKey` | The unique key for the item | | changes | `Partial` | Partial shop item properties to update | ## updateShopItemForPlayer Update selected properties of an existing shop item for a specific player. For example, { canBuy: true } to allow this player to purchase the item. Throws an error if the item does not exist. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The player to update the item for | | categoryKey | `ShopCategoryKey` | The key of the category containing the item | | itemKey | `ShopItemKey` | The unique key for the item | | changes | `Partial` | Partial shop item properties to update | # Block Names (1116 blocks) # # Each block name listed below is the ROOT block - use it exactly as shown (no suffix). # Some blocks also have meta variants, indicated by codes in brackets. # # ROOT BLOCK: Use the block name exactly as listed (e.g. "Maple Door", "Wheat", "Stone") # # META VARIANTS: If a block has codes in brackets, you can append suffixes to get variants: # R = rotation -> BlockName|meta|rot1 through |meta|rot4 # O = open/closed -> BlockName|meta|rot1|open or |closed (combine with R) # H = halfblockPlacement -> BlockName|meta|rot1|top or |bot or |side (combine with R) # G = growing -> BlockName|Growing # TB = treeBase -> BlockName|TreeBase| (e.g. Maple Log|TreeBase|Maple) # TC = treeCanopy -> BlockName|TreeCanopy # B = books -> BlockName|meta|rot1|books1 through |books6 (combine with R) # FG = freshlyGrown -> BlockName|FreshlyGrown (harvestable crop state) # RT = roots -> BlockName|Roots (flower with roots for world gen) # LV = lava -> BlockName|Lava (lava-growing variant) # TP = top -> BlockName|Top (top half of tall plants) # GR = grassRoots -> BlockName|GrassRoots (dirt with grass roots) # BK = breaking -> BlockName|Breaking (breaking animation state) # FL = flashing -> BlockName|Flashing (flashing animation state) # # Examples: # Stone -> Just use "Stone" (no brackets = no variants, root block only) # Maple Door [O,R] -> Root: "Maple Door", Variants: "Maple Door|meta|rot2|open", etc. # Wheat [FG] -> Root: "Wheat", Variant: "Wheat|FreshlyGrown" # Dirt [GR] Messy Dirt Grass Block Sand Clay Gravel Snow Maple Log [TB] Pine Log [TB] Plum Log [TB] Cedar Log [TB] Aspen Log [TB] Jungle Log [TB] Maple Wood Planks Aspen Wood Planks Plum Wood Planks Jungle Wood Planks Pine Wood Planks Cedar Wood Planks Barkless Maple Log [TB] Barkless Aspen Log [TB] Barkless Plum Log [TB] Barkless Jungle Log [TB] Barkless Pine Log [TB] Barkless Cedar Log [TB] free_placeholder2 Stone Messy Stone free_placeholder Smooth Stone Diorite Smooth Diorite Andesite Smooth Andesite Granite Smooth Granite Sandstone Yellowstone Coal Ore Iron Ore Gold Ore Lapis Lazuli Ore Emerald Ore Diamond Ore Block of Coal Block of Iron Block of Gold Block of Lapis Lazuli Block of Emerald White Wool Orange Wool Magenta Wool Light Blue Wool Yellow Wool Lime Wool Pink Wool Gray Wool Light Gray Wool Cyan Wool Purple Wool Blue Wool Brown Wool Green Wool Red Wool Black Wool Baked Clay White Baked Clay Orange Baked Clay Magenta Baked Clay Light Blue Baked Clay Yellow Baked Clay Lime Baked Clay Pink Baked Clay Gray Baked Clay Light Gray Baked Clay Cyan Baked Clay Purple Baked Clay Blue Baked Clay Brown Baked Clay Green Baked Clay Red Baked Clay Black Baked Clay Gray Concrete Light Gray Concrete Black Concrete Blue Concrete Brown Concrete Cyan Concrete Light Blue Concrete Lime Concrete Magenta Concrete Orange Concrete Pink Concrete Purple Concrete Red Concrete White Concrete Green Concrete Yellow Concrete Pine Leaves [TC] Aspen Leaves [TC] Maple Leaves [TC] Jungle Leaves [TC] Pumpkin_placeholder Watermelon Glass Black Glass Blue Glass Brown Glass Cyan Glass Gray Glass Light Gray Glass Green Glass Light Blue Glass Lime Glass Magenta Glass Orange Glass Pink Glass Purple Glass Red Glass White Glass Yellow Glass UNUSED BLOCK TYPE Dim Lamp On Dim Lamp Off Water Invisible Solid Bricks Stone Bricks Dark Red Brick Dark Red Stone Block of Quartz Chiseled Block of Quartz Engraved Stone Mossy Stone Bricks Cracked Stone Bricks Smooth Sandstone Engraved Sandstone Ice Obsidian Hay Bale Sponge Beacon temp Golden Decoration Moonstone Explosive Bedrock Smooth Double Stone Slab Cactus [G] Grass Dandelion [RT] Poppy [RT] Red Tulip [RT] Pink Tulip [RT] White Tulip [RT] Orange Tulip [RT] Daisy [RT] Bluebell [RT] Forget-me-not [RT] Allium [RT] Azure Bluet [RT] Lily of the Valley [RT] Shadow Rose [RT] Furnace [R] Workbench [R] Block of Diamond Maple Door [O,R] _Maple Door Top [O,R] Maple Trapdoor [O,R] Aspen Sapling Maple Sapling Jungle Sapling Plum Sapling Pine Sapling Cedar Sapling Chest [R] Protector Fat Cactus [G] Dry Fat Cactus Maple Ladder [R] Vines [G,R] Iron Ladder [R] White Planks Orange Planks Magenta Planks Light Blue Planks Yellow Planks Lime Planks Pink Planks Gray Planks Light Gray Planks Cyan Planks Purple Planks Blue Planks Brown Planks Green Planks Red Planks Black Planks Artisan Bench White Ceramic [R] Orange Ceramic [R] Magenta Ceramic [R] Light Blue Ceramic [R] Yellow Ceramic [R] Lime Ceramic [R] Pink Ceramic [R] Gray Ceramic [R] Light Gray Ceramic [R] Cyan Ceramic [R] Purple Ceramic [R] Blue Ceramic [R] Brown Ceramic [R] Green Ceramic [R] Red Ceramic [R] Black Ceramic [R] Wheat Seeds Wheat_stage1 Wheat_stage2 Wheat_stage3 Wheat_stage4 Wheat_stage5 Wheat [FG] Tilled Soil Bread Block ReservedBread BlockRotation1 ReservedBread BlockRotation2 ReservedBread BlockRotation3 Mossy Messy Stone White Bed [R] _White Bed Head [R] Orange Bed [R] _Orange Bed Head [R] Magenta Bed [R] _Magenta Bed Head [R] Light Blue Bed [R] _Light Blue Bed Head [R] Yellow Bed [R] _Yellow Bed Head [R] Lime Bed [R] _Lime Bed Head [R] Pink Bed [R] _Pink Bed Head [R] Gray Bed [R] _Gray Bed Head [R] Light Gray Bed [R] _Light Gray Bed Head [R] Cyan Bed [R] _Cyan Bed Head [R] Purple Bed [R] _Purple Bed Head [R] Blue Bed [R] _Blue Bed Head [R] Brown Bed [R] _Brown Bed Head [R] Green Bed [R] _Green Bed Head [R] Red Bed [R] _Red Bed Head [R] Black Bed [R] _Black Bed Head [R] Apple Block Moonstone Ore Moonstone Chest [R] Block of Moonstone Magma Useless Soil Marked Sandstone Red Sandstone Smooth Red Sandstone Engraved Red Sandstone Marked Red Sandstone Green Stone Green Bricks Dark Green Bricks Sandstone Bricks Engraved Diorite Diorite Bricks Engraved Andesite Andesite Bricks Engraved Granite Granite Bricks Ice Bricks Placeholder Packed Ice Placeholder Blue Ice Plum Leaves [TC] Cedar Leaves [TC] Palm Leaves [TC] Palm Log [TB] Palm Wood Planks Palm Sapling Pine Door [O,R] _Pine Door Top [O,R] Plum Door [O,R] _Plum Door Top [O,R] Cedar Door [O,R] _Cedar Door Top [O,R] Aspen Door [O,R] _Aspen Door Top [O,R] Jungle Door [O,R] _Jungle Door Top [O,R] Palm Door [O,R] _Palm Door Top [O,R] Pine Trapdoor [O,R] Plum Trapdoor [O,R] Cedar Trapdoor [O,R] Aspen Trapdoor [O,R] Jungle Trapdoor [O,R] Palm Trapdoor [O,R] Red Sand Red Sandstone Bricks Rocky Dirt Autumn Maple Leaves [TC] Fallen Maple Leaves [H,R] Maple Slab [H,R] Pine Slab [H,R] Plum Slab [H,R] Cedar Slab [H,R] Aspen Slab [H,R] Jungle Slab [H,R] Palm Slab [H,R] Dirt Slab [H,R] Grass Slab [H,R] Messy Stone Slab [H,R] Stone Slab [H,R] Smooth Stone Slab [H,R] Engraved Stone Slab [H,R] Stone Bricks Slab [H,R] Mossy Stone Slab [H,R] Mossy Stone Bricks Slab [H,R] Andesite Slab [H,R] Smooth Andesite Slab [H,R] Engraved Andesite Slab [H,R] Andesite Bricks Slab [H,R] Diorite Slab [H,R] Smooth Diorite Slab [H,R] Engraved Diorite Slab [H,R] Diorite Bricks Slab [H,R] Granite Slab [H,R] Smooth Granite Slab [H,R] Engraved Granite Slab [H,R] Granite Bricks Slab [H,R] Sandstone Slab [H,R] Smooth Sandstone Slab [H,R] Engraved Sandstone Slab [H,R] Marked Sandstone Slab [H,R] Sandstone Bricks Slab [H,R] Red Sandstone Slab [H,R] Smooth Red Sandstone Slab [H,R] Engraved Red Sandstone Slab [H,R] Marked Red Sandstone Slab [H,R] Red Sandstone Bricks Slab [H,R] Bricks Slab [H,R] Ice Bricks Slab [H,R] Plum Block Coconut Block Pear Log [TB] Pear Wood Planks Pear Leaves [TC] Pear Door [O,R] _Pear Door Top [O,R] Pear Trapdoor [O,R] Pear Sapling Pear Slab [H,R] Pear Block Compressed Messy Stone Extra Compressed Messy Stone Super Compressed Messy Stone Hyper Compressed Messy Stone Ultra Compressed Messy Stone Mega Compressed Messy Stone Board [R] Net Cobweb Brown Mushroom Block Red Mushroom Block Mushroom Stem Fireball Block Iceball Block Watermelon Seeds [G] Attached Watermelon Stem [R] Pumpkin Seeds [G] Attached Pumpkin Stem [R] Pumpkin Carved Pumpkin [R] Jack o'Lantern [R] Melon Seeds [G] Attached Melon Stem [R] Melon Iron Watermelon Patterned Black Glass Patterned Blue Glass Patterned Brown Glass Patterned Cyan Glass Patterned Gray Glass Patterned Light Gray Glass Patterned Green Glass Patterned Light Blue Glass Patterned Lime Glass Patterned Magenta Glass Patterned Orange Glass Patterned Pink Glass Patterned Purple Glass Patterned Red Glass Patterned White Glass Patterned Yellow Glass Potion Table [R] Pine Ladder [R] Plum Ladder [R] Cedar Ladder [R] Aspen Ladder [R] Jungle Ladder [R] Palm Ladder [R] Pear Ladder [R] Black Carpet Blue Carpet Brown Carpet Cyan Carpet Gray Carpet Light Gray Carpet Green Carpet Light Blue Carpet Lime Carpet Magenta Carpet Orange Carpet Pink Carpet Purple Carpet Red Carpet White Carpet Yellow Carpet Bookshelf [B,R] Empty Bookshelf [B,R] Mailbox [R] Rice [FG] Rice_stage1 Rice_stage2 Rice_stage3 Rice_stage4 Rice_stage5 Cranberries Cranberries_stage1 Cranberries_stage2 Red Mushroom Brown Mushroom Cotton Seeds Cotton_stage1 Cotton_stage2 Cotton_stage3 Tribe Protector Tall Grass [TP] Faction Protector Barkless Palm Log [TB] Barkless Pear Log [TB] Mystery Block Rocket Super Rocket Yellow Concrete Slab [H,R] White Concrete Slab [H,R] Red Concrete Slab [H,R] Purple Concrete Slab [H,R] Pink Concrete Slab [H,R] Orange Concrete Slab [H,R] Magenta Concrete Slab [H,R] Lime Concrete Slab [H,R] Light Gray Concrete Slab [H,R] Light Blue Concrete Slab [H,R] Green Concrete Slab [H,R] Gray Concrete Slab [H,R] Cyan Concrete Slab [H,R] Brown Concrete Slab [H,R] Blue Concrete Slab [H,R] Black Concrete Slab [H,R] Grenade Cherry Log [TB] Barkless Cherry Log [TB] Cherry Wood Planks Cherry Leaves [TC] Fallen Cherry Leaves [H,R] Cherry Door [O,R] _Cherry Door Top [O,R] Cherry Trapdoor [O,R] Cherry Sapling Cherry Slab [H,R] Cherry Ladder [R] Cherry Block Bouncy Bomb Block Obby Rocket Wood Spikes Stone Spikes Iron Spikes Gold Spikes Diamond Spikes Kill Spikes Corn Block Corn Seeds [FG,G] Corn Seeds_stage1 Corn Plant_stage1 Corn Plant_stage2 Corn Plant_stage3 Corn Plant_stage4 Corn Plant_stage5 Corn Plant [FG] Loot Chest [R] Melting Ice [BK] Yellow Paintball Explosive White Paintball Explosive Red Paintball Explosive Purple Paintball Explosive Pink Paintball Explosive Orange Paintball Explosive Magenta Paintball Explosive Lime Paintball Explosive Light Gray Paintball Explosive Light Blue Paintball Explosive Green Paintball Explosive Gray Paintball Explosive Cyan Paintball Explosive Brown Paintball Explosive Blue Paintball Explosive Black Paintball Explosive Yellow Quick Paintball Explosive White Quick Paintball Explosive Red Quick Paintball Explosive Purple Quick Paintball Explosive Pink Quick Paintball Explosive Orange Quick Paintball Explosive Magenta Quick Paintball Explosive Lime Quick Paintball Explosive Light Gray Quick Paintball Explosive Light Blue Quick Paintball Explosive Green Quick Paintball Explosive Gray Quick Paintball Explosive Cyan Quick Paintball Explosive Brown Quick Paintball Explosive Blue Quick Paintball Explosive Black Quick Paintball Explosive Yellow Seeking Paintball Explosive White Seeking Paintball Explosive Red Seeking Paintball Explosive Purple Seeking Paintball Explosive Pink Seeking Paintball Explosive Orange Seeking Paintball Explosive Magenta Seeking Paintball Explosive Lime Seeking Paintball Explosive Light Gray Seeking Paintball Explosive Light Blue Seeking Paintball Explosive Green Seeking Paintball Explosive Gray Seeking Paintball Explosive Cyan Seeking Paintball Explosive Brown Seeking Paintball Explosive Blue Seeking Paintball Explosive Black Seeking Paintball Explosive Yellow Sticky Paintball Explosive White Sticky Paintball Explosive Red Sticky Paintball Explosive Purple Sticky Paintball Explosive Pink Sticky Paintball Explosive Orange Sticky Paintball Explosive Magenta Sticky Paintball Explosive Lime Sticky Paintball Explosive Light Gray Sticky Paintball Explosive Light Blue Sticky Paintball Explosive Green Sticky Paintball Explosive Gray Sticky Paintball Explosive Cyan Sticky Paintball Explosive Brown Sticky Paintball Explosive Blue Sticky Paintball Explosive Black Sticky Paintball Explosive White Strongbed [R] _White Strongbed Head [R] Orange Strongbed [R] _Orange Strongbed Head [R] Magenta Strongbed [R] _Magenta Strongbed Head [R] Light Blue Strongbed [R] _Light Blue Strongbed Head [R] Yellow Strongbed [R] _Yellow Strongbed Head [R] Lime Strongbed [R] _Lime Strongbed Head [R] Pink Strongbed [R] _Pink Strongbed Head [R] Gray Strongbed [R] _Gray Strongbed Head [R] Light Gray Strongbed [R] _Light Gray Strongbed Head [R] Cyan Strongbed [R] _Cyan Strongbed Head [R] Purple Strongbed [R] _Purple Strongbed Head [R] Blue Strongbed [R] _Blue Strongbed Head [R] Brown Strongbed [R] _Brown Strongbed Head [R] Green Strongbed [R] _Green Strongbed Head [R] Red Strongbed [R] _Red Strongbed Head [R] Black Strongbed [R] _Black Strongbed Head [R] Timed Spike Bomb Block [FL] Lava Fat Brown Mushroom Fat Red Mushroom Chili Pepper Block Chili Pepper Seeds [LV] Chili Pepper Plant_stage1 [LV] Chili Pepper Plant_stage2 [LV] Chili Pepper Plant_stage3 [LV] Chili Pepper Plant_stage4 [LV] Chili Pepper Plant [FG,LV] Chili Pepper Plant_stage5 [LV] Code Block Toxin Ball Block Spawn Block (Yellow) [R] Spawn Block (White) [R] Spawn Block (Red) [R] Spawn Block (Purple) [R] Spawn Block (Pink) [R] Spawn Block (Orange) [R] Spawn Block (Magenta) [R] Spawn Block (Lime) [R] Spawn Block (Light Gray) [R] Spawn Block (Light Blue) [R] Spawn Block (Green) [R] Spawn Block (Gray) [R] Spawn Block (Cyan) [R] Spawn Block (Brown) [R] Spawn Block (Blue) [R] Spawn Block (Black) [R] Checkpoint Block [R] Custom Lobby Block [R] Generator Spawn Block (Red) Generator Spawn Block (Blue) Generator Spawn Block (Lime) Generator Spawn Block (Yellow) Generator Spawn Block (Cyan) Generator Spawn Block (White) Generator Spawn Block (Pink) Generator Spawn Block (Gray) Trader Shop Spawn Block [R] Wizard Shop Spawn Block [R] Generator Spawn Block (Diamond) Generator Spawn Block (Moonstone) Generator Spawn Block (Ore) Goal Block (Red) Goal Block (Blue) Finish Block Drop Location Block Obby Death Block Obby Absorb Block Obby Absorb Death Block Bone Block Pig Spawner Block Cow Spawner Block Sheep Spawner Block Cave Golem Spawner Block Draugr Zombie Spawner Block Draugr Skeleton Spawner Block Empty Spawner Block Frost Golem Spawner Block Frost Zombie Spawner Block Frost Skeleton Spawner Block Snowy Messy Stone Snowy Stone Slab [H,R] Draugr Knight Spawner Block Packed Snow Carved Messy Stone Spectral Grass Spectral Log [TB] Barkless Spectral Log [TB] Spectral Wood Planks Spectral Leaves [TC] Spectral Door [O,R] _Spectral Door Top [O,R] Spectral Trapdoor [O,R] Spectral Sapling Spectral Slab [H,R] Spectral Ladder [R] Wood Enchanting Table [R] Stone Enchanting Table [R] Iron Enchanting Table [R] Gold Enchanting Table [R] Diamond Enchanting Table [R] Pine Grass Block Pine Grass Slab [H,R] Pine Grass Pine Fern Fallen Pine Cone Pine Cone Block Wolf Spawner Block Bear Spawner Block Deer Spawner Block Stag Spawner Block Bone Antlers [R] Gold Antlers [R] Gold Watermelon Stag Spawner Block Salvaging Table [R] Chalk Yellow Chalk White Chalk Red Chalk Purple Chalk Pink Chalk Orange Chalk Magenta Chalk Lime Chalk Light Gray Chalk Light Blue Chalk Green Chalk Gray Chalk Cyan Chalk Brown Chalk Blue Chalk Black Chalk Yellow Chalk Bricks White Chalk Bricks Red Chalk Bricks Purple Chalk Bricks Pink Chalk Bricks Orange Chalk Bricks Magenta Chalk Bricks Lime Chalk Bricks Light Gray Chalk Bricks Light Blue Chalk Bricks Green Chalk Bricks Gray Chalk Bricks Cyan Chalk Bricks Brown Chalk Bricks Blue Chalk Bricks Black Chalk Bricks Yellow Chalk Slab [H,R] White Chalk Slab [H,R] Red Chalk Slab [H,R] Purple Chalk Slab [H,R] Pink Chalk Slab [H,R] Orange Chalk Slab [H,R] Magenta Chalk Slab [H,R] Lime Chalk Slab [H,R] Light Gray Chalk Slab [H,R] Light Blue Chalk Slab [H,R] Green Chalk Slab [H,R] Gray Chalk Slab [H,R] Cyan Chalk Slab [H,R] Brown Chalk Slab [H,R] Blue Chalk Slab [H,R] Black Chalk Slab [H,R] Yellow Chalk Bricks Slab [H,R] White Chalk Bricks Slab [H,R] Red Chalk Bricks Slab [H,R] Purple Chalk Bricks Slab [H,R] Pink Chalk Bricks Slab [H,R] Orange Chalk Bricks Slab [H,R] Magenta Chalk Bricks Slab [H,R] Lime Chalk Bricks Slab [H,R] Light Gray Chalk Bricks Slab [H,R] Light Blue Chalk Bricks Slab [H,R] Green Chalk Bricks Slab [H,R] Gray Chalk Bricks Slab [H,R] Cyan Chalk Bricks Slab [H,R] Brown Chalk Bricks Slab [H,R] Blue Chalk Bricks Slab [H,R] Black Chalk Bricks Slab [H,R] Leaf Bed [R] _Leaf Bed Head [R] Jungle Grass Block Jungle Grass Slab [H,R] Jungle Tall Grass [TP] Catnip Mango Log [TB] Barkless Mango Log [TB] Mango Wood Planks Mango Leaves [TC] Mango Door [O,R] _Mango Door Top [O,R] Mango Trapdoor [O,R] Mango Sapling Mango Slab [H,R] Mango Ladder [R] Mango Block Banana Block Banana Seeds [G] Attached Banana Stem [R] Dangling Rope Dangling Vine Gorilla Spawner Block Wildcat Spawner Block Fruity Maple Leaves Pine Cone Leaves Fruity Plum Leaves Fruity Palm Leaves Fruity Pear Leaves Fruity Cherry Leaves Fruity Mango Leaves Draugr Huntress Spawner Block Magma Golem Spawner Block Black Portal Blue Portal Brown Portal Cyan Portal Gray Portal Green Portal Grey Portal Light Blue Portal Light Gray Portal Lime Portal Magenta Portal Orange Portal Pink Portal Purple Portal Red Portal White Portal Yellow Portal Leather Block Horse Spawner Block Tomato Plant [FG,TP] Tomato Plant_stage1 Carrot Plant [FG] Carrot Plant_stage1 Potato Plant [FG] Potato Plant_stage1 Strawberry Bush Strawberry Bush_stage1 Strawberry Bush_stage2 Sugar Cane Plant [FG,TP] Sugar Cane Plant_stage1 Lettuce Plant [FG] Lettuce Plant_stage1 Coffee Plant [FG] Coffee Plant_stage1 Cauliflower Plant [FG] Cauliflower Plant_stage1 Parsnip Plant [FG] Parsnip Plant_stage1 Blueberry Bush Blueberry Bush_stage1 Blueberry Bush_stage2 Red Cabbage Plant [FG] Red Cabbage Plant_stage1 Beetroot Plant [FG] Beetroot Plant_stage1 Autumn Aspen Leaves [TC] Autumn Fern Iron Chest [R] Crate Carrot Block Carrot Seeds Potato Block Potato Seeds Beetroot Block Beetroot Seeds White Banner [H,R] _White Banner Flag [H,R] Orange Banner [H,R] _Orange Banner Flag [H,R] Magenta Banner [H,R] _Magenta Banner Flag [H,R] Light Blue Banner [H,R] _Light Blue Banner Flag [H,R] Yellow Banner [H,R] _Yellow Banner Flag [H,R] Lime Banner [H,R] _Lime Banner Flag [H,R] Pink Banner [H,R] _Pink Banner Flag [H,R] Gray Banner [H,R] _Gray Banner Flag [H,R] Light Gray Banner [H,R] _Light Gray Banner Flag [H,R] Cyan Banner [H,R] _Cyan Banner Flag [H,R] Purple Banner [H,R] _Purple Banner Flag [H,R] Blue Banner [H,R] _Blue Banner Flag [H,R] Brown Banner [H,R] _Brown Banner Flag [H,R] Green Banner [H,R] _Green Banner Flag [H,R] Red Banner [H,R] _Red Banner Flag [H,R] Black Banner [H,R] _Black Banner Flag [H,R] Draugr Banner [H,R] _Draugr Banner Flag [H,R] Spirit Golem Spawner Block Spirit Wolf Spawner Block Spirit Bear Spawner Block Spirit Stag Spawner Block Spirit Gorilla Spawner Block Fertilised Soil _Grant Wool Top Left [R] _Grant Wool Top Right [R] Grant Wool [R] _Grant Wool Bottom Right [R] _Stampede Top Left [R] _Stampede Top Right [R] Stampede [R] _Stampede Bottom Right [R] _Unforgotten Pig Top Left [R] _Unforgotten Pig Top Right [R] Unforgotten Pig [R] _Unforgotten Pig Bottom Right [R] _Sunbathed Gallope Top Left [R] _Sunbathed Gallope Top Right [R] Sunbathed Gallope [R] _Sunbathed Gallope Bottom Right [R] _Dreaming Canine Top Left [R] _Dreaming Canine Top Right [R] Dreaming Canine [R] _Dreaming Canine Bottom Right [R] _A Doe Through The Green Top Left [R] _A Doe Through The Green Top Right [R] A Doe Through The Green [R] _A Doe Through The Green Bottom Right [R] _Whiskers Top Left [R] _Whiskers Top Right [R] Whiskers [R] _Whiskers Bottom Right [R] Hollow Crate Draugr Warper Spawner Block Radar [R] _Radar Back [R] _Radar Dish [R] Inactive Radar [R] _Inactive Radar Back [R] _Inactive Radar Dish [R] Active Radar [R] _Active Radar Back [R] _Active Radar Dish [R] Lucky Block Ultra Lucky Block Gold Trophy [R] Small Magenta Pod _Small Magenta Pod Mid _Small Magenta Pod Top Small Light Gray Pod _Small Light Gray Pod Mid _Small Light Gray Pod Top Small Red Pod _Small Red Pod Mid _Small Red Pod Top INTERNAL_MESH_Gold Trophy Frost Wraith Spawner Block Draugr Reaver Spawner Block Small White Pod _Small White Pod Mid _Small White Pod Top Small Orange Pod _Small Orange Pod Mid _Small Orange Pod Top Small Light Blue Pod _Small Light Blue Pod Mid _Small Light Blue Pod Top Small Yellow Pod _Small Yellow Pod Mid _Small Yellow Pod Top Small Lime Pod _Small Lime Pod Mid _Small Lime Pod Top Small Pink Pod _Small Pink Pod Mid _Small Pink Pod Top Small Gray Pod _Small Gray Pod Mid _Small Gray Pod Top Small Cyan Pod _Small Cyan Pod Mid _Small Cyan Pod Top Small Purple Pod _Small Purple Pod Mid _Small Purple Pod Top Small Blue Pod _Small Blue Pod Mid _Small Blue Pod Top Small Brown Pod _Small Brown Pod Mid _Small Brown Pod Top Small Green Pod _Small Green Pod Mid _Small Green Pod Top Small Black Pod _Small Black Pod Mid _Small Black Pod Top Skull Banner [H,R] _Skull Banner Flag [H,R] Rainbow Banner [H,R] _Rainbow Banner Flag [H,R] Duo Blocchino Statue Bebek Bebek Bebek Statue Bobino Musculino Statue Bobzilla Statue Brra Brra Pachim Statue Capitano Explovissimo Statue Cappuccino Ninjino Statue Chimpanzano Bananano Statue Il Wizardini Del Porko Statue Lucchia Blocchi Statue Monsieur Bedwar Statue Twirlina Cappucina Statue Weapon Lucky Block Boiling Pot Chopping Board Frying Pan Hob Boiling Hob Frying Kitchen Worktop Slicing Board Wood Trophy [R] INTERNAL_MESH_Wood Trophy Stone Trophy [R] INTERNAL_MESH_Stone Trophy Iron Trophy [R] INTERNAL_MESH_Iron Trophy Diamond Trophy [R] INTERNAL_MESH_Diamond Trophy Moonstone Trophy [R] INTERNAL_MESH_Moonstone Trophy Black Wave Blue Wave Brown Wave Cyan Wave Green Wave Grey Wave Light Blue Wave Light Grey Wave Lime Wave Magenta Wave Orange Wave Pink Wave Purple Wave Red Wave White Wave Yellow Wave White Directional Arrow [R] Orange Directional Arrow [R] Magenta Directional Arrow [R] Light Blue Directional Arrow [R] Yellow Directional Arrow [R] Lime Directional Arrow [R] Pink Directional Arrow [R] Grey Directional Arrow [R] Light Grey Directional Arrow [R] Cyan Directional Arrow [R] Purple Directional Arrow [R] Blue Directional Arrow [R] Brown Directional Arrow [R] Green Directional Arrow [R] Red Directional Arrow [R] Black Directional Arrow [R] Bin Vending Machine [R] _Vending Machine Top [R] Job Application Statue John Beef Statue 67 Statue Coloured Wheel UFO Torch [H,R] Yellow Torch [H,R] White Torch [H,R] Red Torch [H,R] Purple Torch [H,R] Pink Torch [H,R] Orange Torch [H,R] Magenta Torch [H,R] Lime Torch [H,R] Light Gray Torch [H,R] Light Blue Torch [H,R] Green Torch [H,R] Gray Torch [H,R] Cyan Torch [H,R] Brown Torch [H,R] Blue Torch [H,R] Black Torch [H,R] Yellow Neon White Neon Red Neon Purple Neon Pink Neon Orange Neon Magenta Neon Lime Neon Light Gray Neon Light Blue Neon Green Neon Gray Neon Cyan Neon Brown Neon Blue Neon Black Neon Landing Pad Weak Jump Pad Jump Pad Strong Jump Pad Super Jump Pad Invisible Yellow Light Invisible White Light Invisible Red Light Invisible Purple Light Invisible Pink Light Invisible Orange Light Invisible Magenta Light Invisible Lime Light Invisible Light Gray Light Invisible Light Blue Light Invisible Green Light Invisible Gray Light Invisible Cyan Light Invisible Brown Light Invisible Blue Light Invisible Black Light Invisible Sky Light Gun Lucky Block Ghost Chest Ghost Lucky Block Ghost Mystery Block Football # Block Names (1116 blocks) # # Each block name listed below is the ROOT block - use it exactly as shown (no suffix). # Some blocks also have meta variants, indicated by codes in brackets. # # ROOT BLOCK: Use the block name exactly as listed (e.g. "Maple Door", "Wheat", "Stone") # # META VARIANTS: If a block has codes in brackets, you can append suffixes to get variants: # R = rotation -> BlockName|meta|rot1 through |meta|rot4 # O = open/closed -> BlockName|meta|rot1|open or |closed (combine with R) # H = halfblockPlacement -> BlockName|meta|rot1|top or |bot or |side (combine with R) # G = growing -> BlockName|Growing # TB = treeBase -> BlockName|TreeBase| (e.g. Maple Log|TreeBase|Maple) # TC = treeCanopy -> BlockName|TreeCanopy # B = books -> BlockName|meta|rot1|books1 through |books6 (combine with R) # FG = freshlyGrown -> BlockName|FreshlyGrown (harvestable crop state) # RT = roots -> BlockName|Roots (flower with roots for world gen) # LV = lava -> BlockName|Lava (lava-growing variant) # TP = top -> BlockName|Top (top half of tall plants) # GR = grassRoots -> BlockName|GrassRoots (dirt with grass roots) # BK = breaking -> BlockName|Breaking (breaking animation state) # FL = flashing -> BlockName|Flashing (flashing animation state) # # Examples: # Stone -> Just use "Stone" (no brackets = no variants, root block only) # Maple Door [O,R] -> Root: "Maple Door", Variants: "Maple Door|meta|rot2|open", etc. # Wheat [FG] -> Root: "Wheat", Variant: "Wheat|FreshlyGrown" # Dirt [GR] Messy Dirt Grass Block Sand Clay Gravel Snow Maple Log [TB] Pine Log [TB] Plum Log [TB] Cedar Log [TB] Aspen Log [TB] Jungle Log [TB] Maple Wood Planks Aspen Wood Planks Plum Wood Planks Jungle Wood Planks Pine Wood Planks Cedar Wood Planks Barkless Maple Log [TB] Barkless Aspen Log [TB] Barkless Plum Log [TB] Barkless Jungle Log [TB] Barkless Pine Log [TB] Barkless Cedar Log [TB] free_placeholder2 Stone Messy Stone free_placeholder Smooth Stone Diorite Smooth Diorite Andesite Smooth Andesite Granite Smooth Granite Sandstone Yellowstone Coal Ore Iron Ore Gold Ore Lapis Lazuli Ore Emerald Ore Diamond Ore Block of Coal Block of Iron Block of Gold Block of Lapis Lazuli Block of Emerald White Wool Orange Wool Magenta Wool Light Blue Wool Yellow Wool Lime Wool Pink Wool Gray Wool Light Gray Wool Cyan Wool Purple Wool Blue Wool Brown Wool Green Wool Red Wool Black Wool Baked Clay White Baked Clay Orange Baked Clay Magenta Baked Clay Light Blue Baked Clay Yellow Baked Clay Lime Baked Clay Pink Baked Clay Gray Baked Clay Light Gray Baked Clay Cyan Baked Clay Purple Baked Clay Blue Baked Clay Brown Baked Clay Green Baked Clay Red Baked Clay Black Baked Clay Gray Concrete Light Gray Concrete Black Concrete Blue Concrete Brown Concrete Cyan Concrete Light Blue Concrete Lime Concrete Magenta Concrete Orange Concrete Pink Concrete Purple Concrete Red Concrete White Concrete Green Concrete Yellow Concrete Pine Leaves [TC] Aspen Leaves [TC] Maple Leaves [TC] Jungle Leaves [TC] Pumpkin_placeholder Watermelon Glass Black Glass Blue Glass Brown Glass Cyan Glass Gray Glass Light Gray Glass Green Glass Light Blue Glass Lime Glass Magenta Glass Orange Glass Pink Glass Purple Glass Red Glass White Glass Yellow Glass UNUSED BLOCK TYPE Dim Lamp On Dim Lamp Off Water Invisible Solid Bricks Stone Bricks Dark Red Brick Dark Red Stone Block of Quartz Chiseled Block of Quartz Engraved Stone Mossy Stone Bricks Cracked Stone Bricks Smooth Sandstone Engraved Sandstone Ice Obsidian Hay Bale Sponge Beacon temp Golden Decoration Moonstone Explosive Bedrock Smooth Double Stone Slab Cactus [G] Grass Dandelion [RT] Poppy [RT] Red Tulip [RT] Pink Tulip [RT] White Tulip [RT] Orange Tulip [RT] Daisy [RT] Bluebell [RT] Forget-me-not [RT] Allium [RT] Azure Bluet [RT] Lily of the Valley [RT] Shadow Rose [RT] Furnace [R] Workbench [R] Block of Diamond Maple Door [O,R] _Maple Door Top [O,R] Maple Trapdoor [O,R] Aspen Sapling Maple Sapling Jungle Sapling Plum Sapling Pine Sapling Cedar Sapling Chest [R] Protector Fat Cactus [G] Dry Fat Cactus Maple Ladder [R] Vines [G,R] Iron Ladder [R] White Planks Orange Planks Magenta Planks Light Blue Planks Yellow Planks Lime Planks Pink Planks Gray Planks Light Gray Planks Cyan Planks Purple Planks Blue Planks Brown Planks Green Planks Red Planks Black Planks Artisan Bench White Ceramic [R] Orange Ceramic [R] Magenta Ceramic [R] Light Blue Ceramic [R] Yellow Ceramic [R] Lime Ceramic [R] Pink Ceramic [R] Gray Ceramic [R] Light Gray Ceramic [R] Cyan Ceramic [R] Purple Ceramic [R] Blue Ceramic [R] Brown Ceramic [R] Green Ceramic [R] Red Ceramic [R] Black Ceramic [R] Wheat Seeds Wheat_stage1 Wheat_stage2 Wheat_stage3 Wheat_stage4 Wheat_stage5 Wheat [FG] Tilled Soil Bread Block ReservedBread BlockRotation1 ReservedBread BlockRotation2 ReservedBread BlockRotation3 Mossy Messy Stone White Bed [R] _White Bed Head [R] Orange Bed [R] _Orange Bed Head [R] Magenta Bed [R] _Magenta Bed Head [R] Light Blue Bed [R] _Light Blue Bed Head [R] Yellow Bed [R] _Yellow Bed Head [R] Lime Bed [R] _Lime Bed Head [R] Pink Bed [R] _Pink Bed Head [R] Gray Bed [R] _Gray Bed Head [R] Light Gray Bed [R] _Light Gray Bed Head [R] Cyan Bed [R] _Cyan Bed Head [R] Purple Bed [R] _Purple Bed Head [R] Blue Bed [R] _Blue Bed Head [R] Brown Bed [R] _Brown Bed Head [R] Green Bed [R] _Green Bed Head [R] Red Bed [R] _Red Bed Head [R] Black Bed [R] _Black Bed Head [R] Apple Block Moonstone Ore Moonstone Chest [R] Block of Moonstone Magma Useless Soil Marked Sandstone Red Sandstone Smooth Red Sandstone Engraved Red Sandstone Marked Red Sandstone Green Stone Green Bricks Dark Green Bricks Sandstone Bricks Engraved Diorite Diorite Bricks Engraved Andesite Andesite Bricks Engraved Granite Granite Bricks Ice Bricks Placeholder Packed Ice Placeholder Blue Ice Plum Leaves [TC] Cedar Leaves [TC] Palm Leaves [TC] Palm Log [TB] Palm Wood Planks Palm Sapling Pine Door [O,R] _Pine Door Top [O,R] Plum Door [O,R] _Plum Door Top [O,R] Cedar Door [O,R] _Cedar Door Top [O,R] Aspen Door [O,R] _Aspen Door Top [O,R] Jungle Door [O,R] _Jungle Door Top [O,R] Palm Door [O,R] _Palm Door Top [O,R] Pine Trapdoor [O,R] Plum Trapdoor [O,R] Cedar Trapdoor [O,R] Aspen Trapdoor [O,R] Jungle Trapdoor [O,R] Palm Trapdoor [O,R] Red Sand Red Sandstone Bricks Rocky Dirt Autumn Maple Leaves [TC] Fallen Maple Leaves [H,R] Maple Slab [H,R] Pine Slab [H,R] Plum Slab [H,R] Cedar Slab [H,R] Aspen Slab [H,R] Jungle Slab [H,R] Palm Slab [H,R] Dirt Slab [H,R] Grass Slab [H,R] Messy Stone Slab [H,R] Stone Slab [H,R] Smooth Stone Slab [H,R] Engraved Stone Slab [H,R] Stone Bricks Slab [H,R] Mossy Stone Slab [H,R] Mossy Stone Bricks Slab [H,R] Andesite Slab [H,R] Smooth Andesite Slab [H,R] Engraved Andesite Slab [H,R] Andesite Bricks Slab [H,R] Diorite Slab [H,R] Smooth Diorite Slab [H,R] Engraved Diorite Slab [H,R] Diorite Bricks Slab [H,R] Granite Slab [H,R] Smooth Granite Slab [H,R] Engraved Granite Slab [H,R] Granite Bricks Slab [H,R] Sandstone Slab [H,R] Smooth Sandstone Slab [H,R] Engraved Sandstone Slab [H,R] Marked Sandstone Slab [H,R] Sandstone Bricks Slab [H,R] Red Sandstone Slab [H,R] Smooth Red Sandstone Slab [H,R] Engraved Red Sandstone Slab [H,R] Marked Red Sandstone Slab [H,R] Red Sandstone Bricks Slab [H,R] Bricks Slab [H,R] Ice Bricks Slab [H,R] Plum Block Coconut Block Pear Log [TB] Pear Wood Planks Pear Leaves [TC] Pear Door [O,R] _Pear Door Top [O,R] Pear Trapdoor [O,R] Pear Sapling Pear Slab [H,R] Pear Block Compressed Messy Stone Extra Compressed Messy Stone Super Compressed Messy Stone Hyper Compressed Messy Stone Ultra Compressed Messy Stone Mega Compressed Messy Stone Board [R] Net Cobweb Brown Mushroom Block Red Mushroom Block Mushroom Stem Fireball Block Iceball Block Watermelon Seeds [G] Attached Watermelon Stem [R] Pumpkin Seeds [G] Attached Pumpkin Stem [R] Pumpkin Carved Pumpkin [R] Jack o'Lantern [R] Melon Seeds [G] Attached Melon Stem [R] Melon Iron Watermelon Patterned Black Glass Patterned Blue Glass Patterned Brown Glass Patterned Cyan Glass Patterned Gray Glass Patterned Light Gray Glass Patterned Green Glass Patterned Light Blue Glass Patterned Lime Glass Patterned Magenta Glass Patterned Orange Glass Patterned Pink Glass Patterned Purple Glass Patterned Red Glass Patterned White Glass Patterned Yellow Glass Potion Table [R] Pine Ladder [R] Plum Ladder [R] Cedar Ladder [R] Aspen Ladder [R] Jungle Ladder [R] Palm Ladder [R] Pear Ladder [R] Black Carpet Blue Carpet Brown Carpet Cyan Carpet Gray Carpet Light Gray Carpet Green Carpet Light Blue Carpet Lime Carpet Magenta Carpet Orange Carpet Pink Carpet Purple Carpet Red Carpet White Carpet Yellow Carpet Bookshelf [B,R] Empty Bookshelf [B,R] Mailbox [R] Rice [FG] Rice_stage1 Rice_stage2 Rice_stage3 Rice_stage4 Rice_stage5 Cranberries Cranberries_stage1 Cranberries_stage2 Red Mushroom Brown Mushroom Cotton Seeds Cotton_stage1 Cotton_stage2 Cotton_stage3 Tribe Protector Tall Grass [TP] Faction Protector Barkless Palm Log [TB] Barkless Pear Log [TB] Mystery Block Rocket Super Rocket Yellow Concrete Slab [H,R] White Concrete Slab [H,R] Red Concrete Slab [H,R] Purple Concrete Slab [H,R] Pink Concrete Slab [H,R] Orange Concrete Slab [H,R] Magenta Concrete Slab [H,R] Lime Concrete Slab [H,R] Light Gray Concrete Slab [H,R] Light Blue Concrete Slab [H,R] Green Concrete Slab [H,R] Gray Concrete Slab [H,R] Cyan Concrete Slab [H,R] Brown Concrete Slab [H,R] Blue Concrete Slab [H,R] Black Concrete Slab [H,R] Grenade Cherry Log [TB] Barkless Cherry Log [TB] Cherry Wood Planks Cherry Leaves [TC] Fallen Cherry Leaves [H,R] Cherry Door [O,R] _Cherry Door Top [O,R] Cherry Trapdoor [O,R] Cherry Sapling Cherry Slab [H,R] Cherry Ladder [R] Cherry Block Bouncy Bomb Block Obby Rocket Wood Spikes Stone Spikes Iron Spikes Gold Spikes Diamond Spikes Kill Spikes Corn Block Corn Seeds [FG,G] Corn Seeds_stage1 Corn Plant_stage1 Corn Plant_stage2 Corn Plant_stage3 Corn Plant_stage4 Corn Plant_stage5 Corn Plant [FG] Loot Chest [R] Melting Ice [BK] Yellow Paintball Explosive White Paintball Explosive Red Paintball Explosive Purple Paintball Explosive Pink Paintball Explosive Orange Paintball Explosive Magenta Paintball Explosive Lime Paintball Explosive Light Gray Paintball Explosive Light Blue Paintball Explosive Green Paintball Explosive Gray Paintball Explosive Cyan Paintball Explosive Brown Paintball Explosive Blue Paintball Explosive Black Paintball Explosive Yellow Quick Paintball Explosive White Quick Paintball Explosive Red Quick Paintball Explosive Purple Quick Paintball Explosive Pink Quick Paintball Explosive Orange Quick Paintball Explosive Magenta Quick Paintball Explosive Lime Quick Paintball Explosive Light Gray Quick Paintball Explosive Light Blue Quick Paintball Explosive Green Quick Paintball Explosive Gray Quick Paintball Explosive Cyan Quick Paintball Explosive Brown Quick Paintball Explosive Blue Quick Paintball Explosive Black Quick Paintball Explosive Yellow Seeking Paintball Explosive White Seeking Paintball Explosive Red Seeking Paintball Explosive Purple Seeking Paintball Explosive Pink Seeking Paintball Explosive Orange Seeking Paintball Explosive Magenta Seeking Paintball Explosive Lime Seeking Paintball Explosive Light Gray Seeking Paintball Explosive Light Blue Seeking Paintball Explosive Green Seeking Paintball Explosive Gray Seeking Paintball Explosive Cyan Seeking Paintball Explosive Brown Seeking Paintball Explosive Blue Seeking Paintball Explosive Black Seeking Paintball Explosive Yellow Sticky Paintball Explosive White Sticky Paintball Explosive Red Sticky Paintball Explosive Purple Sticky Paintball Explosive Pink Sticky Paintball Explosive Orange Sticky Paintball Explosive Magenta Sticky Paintball Explosive Lime Sticky Paintball Explosive Light Gray Sticky Paintball Explosive Light Blue Sticky Paintball Explosive Green Sticky Paintball Explosive Gray Sticky Paintball Explosive Cyan Sticky Paintball Explosive Brown Sticky Paintball Explosive Blue Sticky Paintball Explosive Black Sticky Paintball Explosive White Strongbed [R] _White Strongbed Head [R] Orange Strongbed [R] _Orange Strongbed Head [R] Magenta Strongbed [R] _Magenta Strongbed Head [R] Light Blue Strongbed [R] _Light Blue Strongbed Head [R] Yellow Strongbed [R] _Yellow Strongbed Head [R] Lime Strongbed [R] _Lime Strongbed Head [R] Pink Strongbed [R] _Pink Strongbed Head [R] Gray Strongbed [R] _Gray Strongbed Head [R] Light Gray Strongbed [R] _Light Gray Strongbed Head [R] Cyan Strongbed [R] _Cyan Strongbed Head [R] Purple Strongbed [R] _Purple Strongbed Head [R] Blue Strongbed [R] _Blue Strongbed Head [R] Brown Strongbed [R] _Brown Strongbed Head [R] Green Strongbed [R] _Green Strongbed Head [R] Red Strongbed [R] _Red Strongbed Head [R] Black Strongbed [R] _Black Strongbed Head [R] Timed Spike Bomb Block [FL] Lava Fat Brown Mushroom Fat Red Mushroom Chili Pepper Block Chili Pepper Seeds [LV] Chili Pepper Plant_stage1 [LV] Chili Pepper Plant_stage2 [LV] Chili Pepper Plant_stage3 [LV] Chili Pepper Plant_stage4 [LV] Chili Pepper Plant [FG,LV] Chili Pepper Plant_stage5 [LV] Code Block Toxin Ball Block Spawn Block (Yellow) [R] Spawn Block (White) [R] Spawn Block (Red) [R] Spawn Block (Purple) [R] Spawn Block (Pink) [R] Spawn Block (Orange) [R] Spawn Block (Magenta) [R] Spawn Block (Lime) [R] Spawn Block (Light Gray) [R] Spawn Block (Light Blue) [R] Spawn Block (Green) [R] Spawn Block (Gray) [R] Spawn Block (Cyan) [R] Spawn Block (Brown) [R] Spawn Block (Blue) [R] Spawn Block (Black) [R] Checkpoint Block [R] Custom Lobby Block [R] Generator Spawn Block (Red) Generator Spawn Block (Blue) Generator Spawn Block (Lime) Generator Spawn Block (Yellow) Generator Spawn Block (Cyan) Generator Spawn Block (White) Generator Spawn Block (Pink) Generator Spawn Block (Gray) Trader Shop Spawn Block [R] Wizard Shop Spawn Block [R] Generator Spawn Block (Diamond) Generator Spawn Block (Moonstone) Generator Spawn Block (Ore) Goal Block (Red) Goal Block (Blue) Finish Block Drop Location Block Obby Death Block Obby Absorb Block Obby Absorb Death Block Bone Block Pig Spawner Block Cow Spawner Block Sheep Spawner Block Cave Golem Spawner Block Draugr Zombie Spawner Block Draugr Skeleton Spawner Block Empty Spawner Block Frost Golem Spawner Block Frost Zombie Spawner Block Frost Skeleton Spawner Block Snowy Messy Stone Snowy Stone Slab [H,R] Draugr Knight Spawner Block Packed Snow Carved Messy Stone Spectral Grass Spectral Log [TB] Barkless Spectral Log [TB] Spectral Wood Planks Spectral Leaves [TC] Spectral Door [O,R] _Spectral Door Top [O,R] Spectral Trapdoor [O,R] Spectral Sapling Spectral Slab [H,R] Spectral Ladder [R] Wood Enchanting Table [R] Stone Enchanting Table [R] Iron Enchanting Table [R] Gold Enchanting Table [R] Diamond Enchanting Table [R] Pine Grass Block Pine Grass Slab [H,R] Pine Grass Pine Fern Fallen Pine Cone Pine Cone Block Wolf Spawner Block Bear Spawner Block Deer Spawner Block Stag Spawner Block Bone Antlers [R] Gold Antlers [R] Gold Watermelon Stag Spawner Block Salvaging Table [R] Chalk Yellow Chalk White Chalk Red Chalk Purple Chalk Pink Chalk Orange Chalk Magenta Chalk Lime Chalk Light Gray Chalk Light Blue Chalk Green Chalk Gray Chalk Cyan Chalk Brown Chalk Blue Chalk Black Chalk Yellow Chalk Bricks White Chalk Bricks Red Chalk Bricks Purple Chalk Bricks Pink Chalk Bricks Orange Chalk Bricks Magenta Chalk Bricks Lime Chalk Bricks Light Gray Chalk Bricks Light Blue Chalk Bricks Green Chalk Bricks Gray Chalk Bricks Cyan Chalk Bricks Brown Chalk Bricks Blue Chalk Bricks Black Chalk Bricks Yellow Chalk Slab [H,R] White Chalk Slab [H,R] Red Chalk Slab [H,R] Purple Chalk Slab [H,R] Pink Chalk Slab [H,R] Orange Chalk Slab [H,R] Magenta Chalk Slab [H,R] Lime Chalk Slab [H,R] Light Gray Chalk Slab [H,R] Light Blue Chalk Slab [H,R] Green Chalk Slab [H,R] Gray Chalk Slab [H,R] Cyan Chalk Slab [H,R] Brown Chalk Slab [H,R] Blue Chalk Slab [H,R] Black Chalk Slab [H,R] Yellow Chalk Bricks Slab [H,R] White Chalk Bricks Slab [H,R] Red Chalk Bricks Slab [H,R] Purple Chalk Bricks Slab [H,R] Pink Chalk Bricks Slab [H,R] Orange Chalk Bricks Slab [H,R] Magenta Chalk Bricks Slab [H,R] Lime Chalk Bricks Slab [H,R] Light Gray Chalk Bricks Slab [H,R] Light Blue Chalk Bricks Slab [H,R] Green Chalk Bricks Slab [H,R] Gray Chalk Bricks Slab [H,R] Cyan Chalk Bricks Slab [H,R] Brown Chalk Bricks Slab [H,R] Blue Chalk Bricks Slab [H,R] Black Chalk Bricks Slab [H,R] Leaf Bed [R] _Leaf Bed Head [R] Jungle Grass Block Jungle Grass Slab [H,R] Jungle Tall Grass [TP] Catnip Mango Log [TB] Barkless Mango Log [TB] Mango Wood Planks Mango Leaves [TC] Mango Door [O,R] _Mango Door Top [O,R] Mango Trapdoor [O,R] Mango Sapling Mango Slab [H,R] Mango Ladder [R] Mango Block Banana Block Banana Seeds [G] Attached Banana Stem [R] Dangling Rope Dangling Vine Gorilla Spawner Block Wildcat Spawner Block Fruity Maple Leaves Pine Cone Leaves Fruity Plum Leaves Fruity Palm Leaves Fruity Pear Leaves Fruity Cherry Leaves Fruity Mango Leaves Draugr Huntress Spawner Block Magma Golem Spawner Block Black Portal Blue Portal Brown Portal Cyan Portal Gray Portal Green Portal Grey Portal Light Blue Portal Light Gray Portal Lime Portal Magenta Portal Orange Portal Pink Portal Purple Portal Red Portal White Portal Yellow Portal Leather Block Horse Spawner Block Tomato Plant [FG,TP] Tomato Plant_stage1 Carrot Plant [FG] Carrot Plant_stage1 Potato Plant [FG] Potato Plant_stage1 Strawberry Bush Strawberry Bush_stage1 Strawberry Bush_stage2 Sugar Cane Plant [FG,TP] Sugar Cane Plant_stage1 Lettuce Plant [FG] Lettuce Plant_stage1 Coffee Plant [FG] Coffee Plant_stage1 Cauliflower Plant [FG] Cauliflower Plant_stage1 Parsnip Plant [FG] Parsnip Plant_stage1 Blueberry Bush Blueberry Bush_stage1 Blueberry Bush_stage2 Red Cabbage Plant [FG] Red Cabbage Plant_stage1 Beetroot Plant [FG] Beetroot Plant_stage1 Autumn Aspen Leaves [TC] Autumn Fern Iron Chest [R] Crate Carrot Block Carrot Seeds Potato Block Potato Seeds Beetroot Block Beetroot Seeds White Banner [H,R] _White Banner Flag [H,R] Orange Banner [H,R] _Orange Banner Flag [H,R] Magenta Banner [H,R] _Magenta Banner Flag [H,R] Light Blue Banner [H,R] _Light Blue Banner Flag [H,R] Yellow Banner [H,R] _Yellow Banner Flag [H,R] Lime Banner [H,R] _Lime Banner Flag [H,R] Pink Banner [H,R] _Pink Banner Flag [H,R] Gray Banner [H,R] _Gray Banner Flag [H,R] Light Gray Banner [H,R] _Light Gray Banner Flag [H,R] Cyan Banner [H,R] _Cyan Banner Flag [H,R] Purple Banner [H,R] _Purple Banner Flag [H,R] Blue Banner [H,R] _Blue Banner Flag [H,R] Brown Banner [H,R] _Brown Banner Flag [H,R] Green Banner [H,R] _Green Banner Flag [H,R] Red Banner [H,R] _Red Banner Flag [H,R] Black Banner [H,R] _Black Banner Flag [H,R] Draugr Banner [H,R] _Draugr Banner Flag [H,R] Spirit Golem Spawner Block Spirit Wolf Spawner Block Spirit Bear Spawner Block Spirit Stag Spawner Block Spirit Gorilla Spawner Block Fertilised Soil _Grant Wool Top Left [R] _Grant Wool Top Right [R] Grant Wool [R] _Grant Wool Bottom Right [R] _Stampede Top Left [R] _Stampede Top Right [R] Stampede [R] _Stampede Bottom Right [R] _Unforgotten Pig Top Left [R] _Unforgotten Pig Top Right [R] Unforgotten Pig [R] _Unforgotten Pig Bottom Right [R] _Sunbathed Gallope Top Left [R] _Sunbathed Gallope Top Right [R] Sunbathed Gallope [R] _Sunbathed Gallope Bottom Right [R] _Dreaming Canine Top Left [R] _Dreaming Canine Top Right [R] Dreaming Canine [R] _Dreaming Canine Bottom Right [R] _A Doe Through The Green Top Left [R] _A Doe Through The Green Top Right [R] A Doe Through The Green [R] _A Doe Through The Green Bottom Right [R] _Whiskers Top Left [R] _Whiskers Top Right [R] Whiskers [R] _Whiskers Bottom Right [R] Hollow Crate Draugr Warper Spawner Block Radar [R] _Radar Back [R] _Radar Dish [R] Inactive Radar [R] _Inactive Radar Back [R] _Inactive Radar Dish [R] Active Radar [R] _Active Radar Back [R] _Active Radar Dish [R] Lucky Block Ultra Lucky Block Gold Trophy [R] Small Magenta Pod _Small Magenta Pod Mid _Small Magenta Pod Top Small Light Gray Pod _Small Light Gray Pod Mid _Small Light Gray Pod Top Small Red Pod _Small Red Pod Mid _Small Red Pod Top INTERNAL_MESH_Gold Trophy Frost Wraith Spawner Block Draugr Reaver Spawner Block Small White Pod _Small White Pod Mid _Small White Pod Top Small Orange Pod _Small Orange Pod Mid _Small Orange Pod Top Small Light Blue Pod _Small Light Blue Pod Mid _Small Light Blue Pod Top Small Yellow Pod _Small Yellow Pod Mid _Small Yellow Pod Top Small Lime Pod _Small Lime Pod Mid _Small Lime Pod Top Small Pink Pod _Small Pink Pod Mid _Small Pink Pod Top Small Gray Pod _Small Gray Pod Mid _Small Gray Pod Top Small Cyan Pod _Small Cyan Pod Mid _Small Cyan Pod Top Small Purple Pod _Small Purple Pod Mid _Small Purple Pod Top Small Blue Pod _Small Blue Pod Mid _Small Blue Pod Top Small Brown Pod _Small Brown Pod Mid _Small Brown Pod Top Small Green Pod _Small Green Pod Mid _Small Green Pod Top Small Black Pod _Small Black Pod Mid _Small Black Pod Top Skull Banner [H,R] _Skull Banner Flag [H,R] Rainbow Banner [H,R] _Rainbow Banner Flag [H,R] Duo Blocchino Statue Bebek Bebek Bebek Statue Bobino Musculino Statue Bobzilla Statue Brra Brra Pachim Statue Capitano Explovissimo Statue Cappuccino Ninjino Statue Chimpanzano Bananano Statue Il Wizardini Del Porko Statue Lucchia Blocchi Statue Monsieur Bedwar Statue Twirlina Cappucina Statue Weapon Lucky Block Boiling Pot Chopping Board Frying Pan Hob Boiling Hob Frying Kitchen Worktop Slicing Board Wood Trophy [R] INTERNAL_MESH_Wood Trophy Stone Trophy [R] INTERNAL_MESH_Stone Trophy Iron Trophy [R] INTERNAL_MESH_Iron Trophy Diamond Trophy [R] INTERNAL_MESH_Diamond Trophy Moonstone Trophy [R] INTERNAL_MESH_Moonstone Trophy Black Wave Blue Wave Brown Wave Cyan Wave Green Wave Grey Wave Light Blue Wave Light Grey Wave Lime Wave Magenta Wave Orange Wave Pink Wave Purple Wave Red Wave White Wave Yellow Wave White Directional Arrow [R] Orange Directional Arrow [R] Magenta Directional Arrow [R] Light Blue Directional Arrow [R] Yellow Directional Arrow [R] Lime Directional Arrow [R] Pink Directional Arrow [R] Grey Directional Arrow [R] Light Grey Directional Arrow [R] Cyan Directional Arrow [R] Purple Directional Arrow [R] Blue Directional Arrow [R] Brown Directional Arrow [R] Green Directional Arrow [R] Red Directional Arrow [R] Black Directional Arrow [R] Bin Vending Machine [R] _Vending Machine Top [R] Job Application Statue John Beef Statue 67 Statue Coloured Wheel UFO Torch [H,R] Yellow Torch [H,R] White Torch [H,R] Red Torch [H,R] Purple Torch [H,R] Pink Torch [H,R] Orange Torch [H,R] Magenta Torch [H,R] Lime Torch [H,R] Light Gray Torch [H,R] Light Blue Torch [H,R] Green Torch [H,R] Gray Torch [H,R] Cyan Torch [H,R] Brown Torch [H,R] Blue Torch [H,R] Black Torch [H,R] Yellow Neon White Neon Red Neon Purple Neon Pink Neon Orange Neon Magenta Neon Lime Neon Light Gray Neon Light Blue Neon Green Neon Gray Neon Cyan Neon Brown Neon Blue Neon Black Neon Landing Pad Weak Jump Pad Jump Pad Strong Jump Pad Super Jump Pad Invisible Yellow Light Invisible White Light Invisible Red Light Invisible Purple Light Invisible Pink Light Invisible Orange Light Invisible Magenta Light Invisible Lime Light Invisible Light Gray Light Invisible Light Blue Light Invisible Green Light Invisible Gray Light Invisible Cyan Light Invisible Brown Light Invisible Blue Light Invisible Black Light Invisible Sky Light Gun Lucky Block Ghost Chest Ghost Lucky Block Ghost Mystery Block Football # Callbacks Players can use World Code in custom worlds get functions they've written to run when game events happen. These special functions are called callbacks. The world code can be viewed by pressing F8 by default. Initially the world code will have this comment, which can be removed: ```text tick onClose onPlayerJoin onPlayerLeave onPlayerJump onRespawnRequest playerCommand onPlayerChat onPlayerChangeBlock onPlayerDropItem onPlayerPickedUpItem onPlayerSelectInventorySlot onBlockStand onPlayerAttemptCraft onPlayerCraft onPlayerAttemptOpenChest onPlayerOpenedChest onPlayerMoveItemOutOfInventory onPlayerMoveInvenItem onPlayerMoveItemIntoIdxs onPlayerSwapInvenSlots onPlayerMoveInvenItemWithAmt onPlayerAttemptAltAction onPlayerAltAction onPlayerClick onPlayerClickUp onClientOptionUpdated onMobSettingUpdated onInventoryUpdated onChestUpdated onWorldChangeBlock onCreateBloxdMeshEntity onEntityCollision onPlayerAttemptSpawnMob onWorldAttemptSpawnMob onPlayerSpawnMob onWorldSpawnMob onWorldAttemptDespawnMob onMobDespawned onPlayerAttack onPlayerDamagingOtherPlayer onPlayerDamagingMob onMobDamagingPlayer onMobDamagingOtherMob onAttemptKillPlayer onPlayerKilledOtherPlayer onMobKilledPlayer onPlayerKilledMob onMobKilledOtherMob onPlayerPotionEffect onPlayerDamagingMeshEntity onPlayerBreakMeshEntity onPlayerUsedThrowable onPlayerThrowableHitTerrain onTouchscreenActionButton onTaskClaimed onChunkLoaded onPlayerRequestChunk onItemDropCreated onPlayerStartChargingItem onPlayerFinishChargingItem onPlayerFinishQTE onPlayerBoughtShopItem doPeriodicSave To use a callback, just assign a function to it in the world code! tick = () => {} or function tick() {} ``` You can use `api.setCallbackValueFallback("callbackName", defaultValue)` to set a default value to be returned by your callback code if it throws an error. ## doPeriodicSave Called every so often. You should save custom db values/s3 objects here. Persisted items ARE saved on graceful shutdown (e.g. uncaught error, update, etc), but this helps prevent large data-loss on non-graceful shutdowns. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| ## onAttemptKillPlayer Called when a player is about to be killed Return "preventDeath" to prevent the player from being killed ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | killedPlayer | `PlayerId` | The id of the player being killed | | attackingLifeform | `LifeformId` | The optional id of the lifeform attacking the player | ### Returns: `void \| "preventDeath"` ## onBlockStand Called when a player stands on a block ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player that stood on the block | | x | `number` | The x coordinate of the block that was stood on | | y | `number` | The y coordinate of the block that was stood on | | z | `number` | The z coordinate of the block that was stood on | | blockName | `BlockName` | The name of the block that was stood on | ## onChestUpdated Called when a chest is updated by a player x, y, z, will be null if isMoonstoneChest is true ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | initiatorEId | `PlayerId` | The id of the player who updated the chest | | isMoonstoneChest | `boolean` | Whether the chest is a moonstone chest | | x | `number \| null` | The x coordinate of the chest | | y | `number \| null` | The y coordinate of the chest | | z | `number \| null` | The z coordinate of the chest | ## onChunkLoaded Called when a chunk is first loaded API Methods that modify the chunk like setBlock cannot be used here to make persisted changes, and will introduce client-server desync most cases, but might have some creative uses if you know what you're doing. For most use cases, consider using another callback e.g. tick. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | chunkId | `string` | The id of the chunk being loaded | | chunk | `LoadedChunk` | The chunk being loaded, which can be modified by this callback * For world code callbacks this value will always be null. | | wasPersistedChunk | `boolean` | Whether the chunk was persisted | ## onClientOptionUpdated Called when a client option is updated ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player whose option was updated | | option | `ClientOption` | The option that was updated | | value | `any` | The new value of the option, always null for custom code | ## onClose Called when the lobby is shutting down ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | serverIsShuttingDown | `boolean` | Whether the server is shutting down | ## onCreateBloxdMeshEntity Called when a mesh entity is created ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | eId | `EntityId` | The id of the mesh entity | | type | `string` | The type of mesh entity | | initiatorId | `EntityId \| null` | The id of the entity that created the mesh entity, if any | ## onEntityCollision Called when a entity collides with another entity ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | eId | `EntityId` | The id of the entity | | otherEId | `EntityId` | The id of the other entity | ## onInventoryUpdated Called when a player's inventory is updated ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player whose inventory was updated | ## onItemDropCreated Called when an item drop is created ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | itemEId | `EntityId` | The id of the item drop | | itemName | `string` | The name of the item dropped | | itemAmount | `number` | The amount dropped | | x | `number` | The x coordinate of the item drop | | y | `number` | The y coordinate of the item drop | | z | `number` | The z coordinate of the item drop | ## onMobDamagingOtherMob Called when a mob is damaging another mob Return "preventDamage" to prevent damage Return number to change damage dealt to that amount ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | attackingMob | `MobId` | the id of the mob attacking | | damagedMob | `MobId` | the id of the mob being damaged | | damageDealt | `number` | the amount of damage dealt | | withItem | `string` | the item used to attack | ### Returns: `number \| void \| "preventDamage"` ## onMobDamagingPlayer Called when a mob is damaging a player Return "preventDamage" to prevent damage Return number to change damage dealt to that amount ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | attackingMob | `MobId` | the id of the mob damaging the player | | damagedPlayer | `PlayerId` | the id of the player being damaged | | damageDealt | `number` | the amount of damage dealt | | withItem | `string` | the item used to attack | ### Returns: `number \| void \| "preventDamage"` ## onMobDespawned Called when a mob is despawned ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | mobId | `MobId` | The id of the mob despawned | ## onMobKilledOtherMob Called when a mob kills another mob Return "preventDrop" to prevent the mob from dropping items ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | attackingMob | `MobId` | The id of the mob attacking | | killedMob | `MobId` | The id of the mob killed | | damageDealt | `number` | The amount of damage dealt | | withItem | `string` | The item used to attack | ### Returns: `void \| "preventDrop"` ## onMobKilledPlayer Called when a mob kills a player Return "keepInventory" to not drop the player's inventory ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | attackingMob | `any` | The id of the mob attacking | | killedPlayer | `any` | The id of the player killed | | damageDealt | `any` | The amount of damage dealt | | withItem | `any` | The item used to attack | ### Returns: `void \| "keepInventory"` ## onMobSettingUpdated Called when a mob setting is updated ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | mobId | `MobId` | The id of the mob whose setting was updated | | setting | `MobSetting` | The setting that was updated | | value | `any` | The new value of the setting | ## onPlayerAltAction Called when player completes an alt action (right click on pc). The co-ordinates will be undefined if there is no targeted block (and block will be "Air") ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player completing the alt action | | x | `number` | The x coordinate of the targeted block | | y | `number` | The y coordinate of the targeted block | | z | `number` | The z coordinate of the targeted block | | block | `BlockName` | The name of the targeted block | | targetEId | `EntityId \| null` | The id of the targeted entity | ## onPlayerAttack Called when a player attacks another player ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `string` | The id of the player attacking | ## onPlayerAttemptAltAction Called when player alt actions (right click on pc). The co-ordinates will be undefined if there is no targeted block (and block will be "Air") Some actions can be prevented by returning "preventAction", but this may not work as well for certain actions which the game client predicts to succeed - test it to see if it works for your use case, feel free to report any broken ones. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player attempting the alt action | | x | `number` | The x coordinate of the targeted block | | y | `number` | The y coordinate of the targeted block | | z | `number` | The z coordinate of the targeted block | | block | `BlockName` | The name of the targeted block | | targetEId | `EntityId \| null` | The id of the targeted entity | ### Returns: `void \| "preventAction"` ## onPlayerAttemptCraft Called when a player attempts to craft an item Return "preventCraft" to prevent a craft from happening ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player that is attempting to craft the item | | itemName | `string` | The name of the item that is being crafted | | craftingIdx | `number` | The index of the used recipe in the item's recipe list | | craftTimes | `number` | The number of times the craft recipe is used at once (e.g. shift held while crafting) | ### Returns: `void \| "preventCraft"` ## onPlayerAttemptOpenChest Called when a player attempts to open a chest Return "preventOpen" to prevent the player from opening the chest ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player that is attempting to open the chest | | x | `number` | The x coordinate of the chest that the player is attempting to open | | y | `number` | The y coordinate of the chest that the player is attempting to open | | z | `number` | The z coordinate of the chest that the player is attempting to open | | isMoonstoneChest | `boolean` | Whether the chest is a moonstone chest | | isIronChest | `boolean` | Whether the chest is an iron chest | ### Returns: `void \| "preventOpen"` ## onPlayerAttemptSpawnMob Called when a player attempts to spawn a mob, e.g. using a spawn orb. Return "preventSpawn" to prevent the mob from spawning. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player | | mobType | `MobType` | The type of mob | | x | `number` | The potential x coordinate of the mob | | y | `number` | The potential y coordinate of the mob | | z | `number` | The potential z coordinate of the mob | ### Returns: `void \| "preventSpawn"` ## onPlayerBoughtShopItem Called after a player successfully buys a shop item ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player that bought the item | | categoryKey | `ShopCategoryKey` | The shop category key | | itemKey | `ShopItemKey` | The shop item key | | item | `BoughtShopItem` | The resolved shop item (with per-player overrides applied, internal properties stripped) | | userInput | `string` | The user input provided, if the item has a userInput config | ## onPlayerBreakMeshEntity Called when a player breaks a mesh entity ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player breaking the mesh entity | | entityId | `EntityId` | The id of the mesh entity being broken | ## onPlayerChangeBlock Called when a player changes a block Return "preventChange" to prevent the change. If player places block, fromBlock will be Air (and toBlock the block). If a player breaks a block, toBlock will be Air. Return "preventDrop" to prevent a block item from dropping. Return an array to set the dropped item position. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player that changed the block | | x | `number` | The x coordinate of the block that was changed | | y | `number` | The y coordinate of the block that was changed | | z | `number` | The z coordinate of the block that was changed | | fromBlock | `BlockName` | The old block that was replaced | | toBlock | `BlockName` | The new block that was placed | | droppedItem | `BlockName \| null` | The item that was dropped | | fromBlockInfo | `MultiBlockInfo` | The info of the old block that was replaced | | toBlockInfo | `MultiBlockInfo` | The info of the new block that was placed | ### Returns: `void \| [number, number, number] \| "preventChange" \| "preventDrop"` ## onPlayerChat Called when a player sends a chat message Return false or null to prevent the broadcast of the message. Return a string or CustomTextStyling to add a prefix to message. Return for most flexibility: an object where keys are playerIds - the value for a playerId being false means that player won't receive the message. Otherwise playerId values should be an object with (optional) keys prefixContent and chatContent to modify the prefix and the chat. CustomTextStyling[] prefixContent is expected, e.g. [["prefix"]] or [[{ str: "prefix" }]]. World code is not permitted to specify chatContent, it will be ignored. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player that sent the message | | chatMessage | `string` | The message that the player sent | | channelName | `string` | The name of the channel that the message was sent in | ### Returns: `boolean \| void \| ChatTags \| OnPlayerChatObjectResponse` ## onPlayerClick Called when a player clicks Don't have important functionality depending on wasAltClick, as it'll always be false for touchscreen players. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player clicking | | wasAltClick | `boolean` | Whether the click was an alt click (e.g. right click | | x | `number` | | | y | `number` | | | z | `number` | | | block | `BlockName` | | | targetEId | `EntityId \| null` | | ## onPlayerClickUp Called when a player releases a click (mouse-up on desktop, touch-end on mobile). Fires for both primary and secondary click releases. Keep in mind wasAltClick will always be false for touchscreen players. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player releasing click | | wasAltClick | `boolean` | Whether the released click was an alt click (e.g. right click | | x | `number` | | | y | `number` | | | z | `number` | | | block | `BlockName` | | | targetEId | `EntityId \| null` | | ## onPlayerCraft Called when a player crafts an item ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player that crafted the item | | itemName | `string` | The name of the item that was crafted | | craftingIdx | `number` | The index of the used recipe in the item's recipe list | | recipe | `RecipesForItem[number]` | The recipe that was used to craft the item | | craftTimes | `number` | The number of times the craft recipe is used at once (e.g. shift held while crafting) | ## onPlayerDamagingMeshEntity Called when a player is damaging a mesh entity ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player damaging the mesh entity | | damagedId | `EntityId` | The id of the mesh entity being damaged | | damageDealt | `number` | The amount of damage dealt | | withItem | `string` | The item used to attack | ## onPlayerDamagingMob Called when a player is damaging a mob Return "preventDamage" to prevent damage Return number to change damage dealt to that amount ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player damaging the mob | | mobId | `MobId` | The id of the mob being damaged | | damageDealt | `number` | The amount of damage dealt | | withItem | `string` | The item used to attack | | damagerDbId | `PlayerDbId` | The database id of the player attacking | ### Returns: `number \| void \| "preventDamage"` ## onPlayerDamagingOtherPlayer Called when a player is damaging another player Return "preventDamage" to prevent damage Return number to change damage dealt to that amount Sometimes the damager will have left the game (e.g. spikes placer); in this case, attackingPlayer will be the damagedPlayer, but we pass damagerDbId for use cases where it's important. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | attackingPlayer | `PlayerId` | The id of the player attacking | | damagedPlayer | `PlayerId` | The id of the player being damaged | | damageDealt | `number` | The amount of damage dealt | | withItem | `string` | The item used to attack | | bodyPartHit | `LifeformBodyPart` | The body part hit | | damagerDbId | `PlayerDbId` | The database id of the player attacking | ### Returns: `number \| void \| "preventDamage"` ## onPlayerDropItem Called when a player drops an item Return "preventDrop" to prevent the player from dropping the item at all. Return "allowButNoDroppedItemCreated" to allow discarding items without dropping them. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player that dropped the item | | x | `number` | The x coordinate of the item that was dropped | | y | `number` | The y coordinate of the item that was dropped | | z | `number` | The z coordinate of the item that was dropped | | itemName | `ItemName` | The name of the item that was dropped | | itemAmount | `number` | The amount of the item that was dropped | | fromIdx | `number` | The index of the item that was dropped from the player's inventory | ### Returns: `void \| "preventDrop" \| "allowButNoDroppedItemCreated"` ## onPlayerFinishChargingItem Called when a player finishes charging an item ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player charging the item | | used | `boolean` | Whether the item was used | | itemName | `string` | The name of the charged item | | duration | `number` | The duration of the charge | ## onPlayerFinishQTE ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | qteId | `QTERequestId` | | | result | `boolean` | | ## onPlayerJoin Called when a player joins the lobby ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `string` | The id of the player that joined | | fromGameReset | `boolean` | Whether this call is from a game reset (used by SessionBasedGame) | ## onPlayerJump Called when a player jumps ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `string` | The id of the player that jumped | ## onPlayerKilledMob Called when a player kills a mob Return "preventDrop" to prevent the mob from dropping items ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player killed | | mobId | `MobId` | The id of the mob that killed the player | | damageDealt | `number` | The amount of damage dealt | | withItem | `string` | The item used to attack | ### Returns: `void \| "preventDrop"` ## onPlayerKilledOtherPlayer Called when a player kills another player Return "keepInventory" to not drop the player's inventory ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | attackingPlayer | `string` | The id of the player attacking | | killedPlayer | `string` | The id of the player killed | | damageDealt | `number` | The amount of damage dealt | | withItem | `string` | The item used to attack | ### Returns: `void \| "keepInventory"` ## onPlayerLeave Called when a player leaves the lobby ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `string` | The id of the player that left | | serverIsShuttingDown | `boolean` | Whether the server is shutting down | ## onPlayerMoveInvenItem Called for all types of inventory item movement. Certain methods of moving item can result in splitting a stack into multiple slots. (e.g. shift-click). toStartIdx and toEndIdx provide the min and max idxs moved into. Return "preventChange" to prevent item movement. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player moving the item | | fromIdx | `number` | The index that the item is being moved from | | toStartIdx | `number` | The start index that the item is being moved into | | toEndIdx | `number` | The end index that the item is being moved into | | amt | `number` | The amount of the item being moved | ### Returns: `void \| "preventChange"` ## onPlayerMoveInvenItemWithAmt Return "preventChange" to prevent the movement ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player moving the item | | i | `number` | The index of the first slot | | j | `number` | The index of the second slot | | amt | `number` | The amount of the item being moved | ### Returns: `void \| "preventChange"` ## onPlayerMoveItemIntoIdxs Called when a player moves an item into an index within a range of inventory slots Return "preventChange" to prevent the movement ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player moving the item | | start | `number` | The start index of the range | | end | `number` | The end index of the range | | moveIdx | `number` | The index of the item being moved | | itemAmount | `number` | The amount of the item being moved | ### Returns: `void \| "preventChange"` ## onPlayerMoveItemOutOfInventory Called when a player moves an item out of their inventory Return "preventChange" to prevent the movement ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player moving the item | | itemName | `string` | The name of the item being moved | | itemAmount | `number` | The amount of the item being moved | | fromIdx | `number` | The index which the item is being moved from | | movementType | `string` | The type of movement that occurred | ### Returns: `void \| "preventChange"` ## onPlayerOpenedChest Called when a player opens a chest ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player that opened the chest | | x | `number` | The x coordinate of the chest that was opened | | y | `number` | The y coordinate of the chest that was opened | | z | `number` | The z coordinate of the chest that was opened | | isMoonstoneChest | `boolean` | Whether the chest is a moonstone chest | | isIronChest | `boolean` | Whether the chest is an iron chest | ## onPlayerPickedUpItem Called when a player picks up an item ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player that picked up the item | | itemName | `string` | The name of the item that was picked up | | itemAmount | `number` | The amount of the item that was picked up | ## onPlayerPotionEffect Called when a player is affected by a new potion effect ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | initiatorId | `string` | The id of the player who initiated the potion effect | | targetId | `string` | The id of the player who has started being affected | | effectName | `"Damage" \| "Speed" \| "Damage Reduction" \| "Invisible" \| "Jump Boost" \| "Knockback" \| "Poisoned" \| "Slowness" \| "Weakness" \| "Cleansed" \| "Instant Damage" \| "Health Regen" \| "Instant Health" \| "Haste" \| "Shield" \| "Double Jump" \| "Heat Resistance" \| "Thief" \| "X-Ray Vision" \| "Mining Yield" \| "Brain Rot" \| "Aura" \| "Wall Climbing" \| "Air Walk" \| "Pickpocketer" \| "Lifesteal" \| "Bounciness" \| "Blindness" \| "Poopy"` | The name of the potion effect | ### Returns: `void \| "preventEffect"` ## onPlayerRequestChunk Called when a player requests a chunk ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player requesting the chunk | | chunkX | `number` | The x coordinate of the chunk being requested | | chunkY | `number` | The y coordinate of the chunk being requested | | chunkZ | `number` | The z coordinate of the chunk being requested | | chunkId | `string` | The id of the chunk being requested | ## onPlayerSelectInventorySlot Called when a player selects a different inventory slot. This will be called eventually when you have already set the slot using api.setSelectedInventorySlotI so be careful not to cause an infinite loop doing this. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player that selected the inventory slot | | slotIndex | `number` | The index of the inventory slot that was selected | ## onPlayerSpawnMob Called when a mob is spawned by a player ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player who spawned the mob | | mobId | `MobId` | The id of the mob | | mobType | `MobType` | The type of mob | | x | `number` | The x coordinate of the mob | | y | `number` | The y coordinate of the mob | | z | `number` | The z coordinate of the mob | | mobHerdId | `MobHerdId` | The herd id of the mob | | playSoundOnSpawn | `boolean` | Whether to play a sound on spawn | ## onPlayerStartChargingItem Called when a player starts charging an item ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player charging the item | | itemName | `string` | The name of the item being charged | ### Returns: `void \| "preventCharge"` ## onPlayerSwapInvenSlots Return "preventChange" to prevent the swap ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player swapping the inventory slots | | i | `number` | The index of the first slot | | j | `number` | The index of the second slot | ### Returns: `void \| "preventChange"` ## onPlayerThrowableHitTerrain Called when a player's thrown projectile hits the terrain ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player that threw the throwable item | | throwableName | `ThrowableItem` | The name of the throwable item | | thrownEntityId | `EntityId` | The id of the entity which hit the terrain | ## onPlayerUsedThrowable Called when a player uses a throwable item ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player using the throwable item | | throwableName | `ThrowableItem` | The name of the throwable item | | thrownEntityId | `EntityId` | The id of the projectile created by the player | ## onRespawnRequest Called when a player requests to respawn. Optionally return the respawn location. Defaults to [0, 0, 0]. Return true to handle yourself (good for async, but be careful that the player isn't at the place they died, as they could pick up their old items or hit the player they were fighting). ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `string` | The id of the player that requested to respawn | ### Returns: `true \| void \| number[]` ## onTaskClaimed Called when a player claims a task ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `string` | The id of the player claiming the task | | taskId | `any` | The id of the task being claimed | | isPromoTask | `any` | Whether the task is a promo task | | claimedRewards | `any` | The rewards claimed by the player | ### Returns: `any` ## onTouchscreenActionButton Set client option `touchscreenActionButton` to take effect Called when a player presses the touchscreen action button Called for both touchDown and touchUp ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player pressing the touchscreen action button | | touchDown | `boolean` | Whether the touchscreen action button was pressed or released | ## onWorldAttemptDespawnMob Called when a mob is despawned by the world. Return "preventDespawn" to prevent the mob from despawning. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | mobId | `MobId` | The id of the mob despawned | ### Returns: `void \| "preventDespawn"` ## onWorldAttemptSpawnMob Called when the world attempts to spawn a mob. Return "preventSpawn" to prevent the mob from spawning. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | mobType | `MobType` | The type of mob | | x | `number` | The potential x coordinate of the mob | | y | `number` | The potential y coordinate of the mob | | z | `number` | The potential z coordinate of the mob | ### Returns: `void \| "preventSpawn"` ## onWorldChangeBlock Called when a block is changed in the world initiatorDbId is null if updated by game code e.g. when a sapling grows Return "preventChange" to prevent change Return "preventDrop" to prevent a block item from dropping ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | x | `number` | The x coordinate of the block | | y | `number` | The y coordinate of the block | | z | `number` | The z coordinate of the block | | fromBlock | `BlockName` | The old block that was replaced | | toBlock | `BlockName` | The new block that was placed | | initiatorDbId | `string \| null` | The id of the player who updated the block | | extraInfo | `WorldBlockChangedInfo` | Extra info about the block change | ### Returns: `void \| "preventChange" \| "preventDrop"` ## onWorldSpawnMob Called when a mob is spawned by the world ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | mobId | `MobId` | The id of the mob | | mobType | `MobType` | The type of mob | | x | `number` | The x coordinate of the mob | | y | `number` | The y coordinate of the mob | | z | `number` | The z coordinate of the mob | | mobHerdId | `MobHerdId` | The herd id of the mob | | playSoundOnSpawn | `boolean` | Whether to play a sound on spawn | ## playerCommand Called when a player sends a command ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `string` | The id of the player that sent the command | | command | `string` | The command that the player sent | ### Returns: `boolean` ## tick Called every tick, 20 times per second ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | ms | `number` | The fixed timestep, can be used as "milliseconds since last tick" | # Callbacks Players can use World Code in custom worlds get functions they've written to run when game events happen. These special functions are called callbacks. The world code can be viewed by pressing F8 by default. Initially the world code will have this comment, which can be removed: ```text tick onClose onPlayerJoin onPlayerLeave onPlayerJump onRespawnRequest playerCommand onPlayerChat onPlayerChangeBlock onPlayerDropItem onPlayerPickedUpItem onPlayerSelectInventorySlot onBlockStand onPlayerAttemptCraft onPlayerCraft onPlayerAttemptOpenChest onPlayerOpenedChest onPlayerMoveItemOutOfInventory onPlayerMoveInvenItem onPlayerMoveItemIntoIdxs onPlayerSwapInvenSlots onPlayerMoveInvenItemWithAmt onPlayerAttemptAltAction onPlayerAltAction onPlayerClick onPlayerClickUp onClientOptionUpdated onMobSettingUpdated onInventoryUpdated onChestUpdated onWorldChangeBlock onCreateBloxdMeshEntity onEntityCollision onPlayerAttemptSpawnMob onWorldAttemptSpawnMob onPlayerSpawnMob onWorldSpawnMob onWorldAttemptDespawnMob onMobDespawned onPlayerAttack onPlayerDamagingOtherPlayer onPlayerDamagingMob onMobDamagingPlayer onMobDamagingOtherMob onAttemptKillPlayer onPlayerKilledOtherPlayer onMobKilledPlayer onPlayerKilledMob onMobKilledOtherMob onPlayerPotionEffect onPlayerDamagingMeshEntity onPlayerBreakMeshEntity onPlayerUsedThrowable onPlayerThrowableHitTerrain onTouchscreenActionButton onTaskClaimed onChunkLoaded onPlayerRequestChunk onItemDropCreated onPlayerStartChargingItem onPlayerFinishChargingItem onPlayerFinishQTE onPlayerBoughtShopItem doPeriodicSave To use a callback, just assign a function to it in the world code! tick = () => {} or function tick() {} ``` You can use `api.setCallbackValueFallback("callbackName", defaultValue)` to set a default value to be returned by your callback code if it throws an error. ## doPeriodicSave Called every so often. You should save custom db values/s3 objects here. Persisted items ARE saved on graceful shutdown (e.g. uncaught error, update, etc), but this helps prevent large data-loss on non-graceful shutdowns. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| ## onAttemptKillPlayer Called when a player is about to be killed Return "preventDeath" to prevent the player from being killed ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | killedPlayer | `PlayerId` | The id of the player being killed | | attackingLifeform | `LifeformId` | The optional id of the lifeform attacking the player | ### Returns: `void \| "preventDeath"` ## onBlockStand Called when a player stands on a block ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player that stood on the block | | x | `number` | The x coordinate of the block that was stood on | | y | `number` | The y coordinate of the block that was stood on | | z | `number` | The z coordinate of the block that was stood on | | blockName | `BlockName` | The name of the block that was stood on | ## onChestUpdated Called when a chest is updated by a player x, y, z, will be null if isMoonstoneChest is true ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | initiatorEId | `PlayerId` | The id of the player who updated the chest | | isMoonstoneChest | `boolean` | Whether the chest is a moonstone chest | | x | `number \| null` | The x coordinate of the chest | | y | `number \| null` | The y coordinate of the chest | | z | `number \| null` | The z coordinate of the chest | ## onChunkLoaded Called when a chunk is first loaded API Methods that modify the chunk like setBlock cannot be used here to make persisted changes, and will introduce client-server desync most cases, but might have some creative uses if you know what you're doing. For most use cases, consider using another callback e.g. tick. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | chunkId | `string` | The id of the chunk being loaded | | chunk | `LoadedChunk` | The chunk being loaded, which can be modified by this callback * For world code callbacks this value will always be null. | | wasPersistedChunk | `boolean` | Whether the chunk was persisted | ## onClientOptionUpdated Called when a client option is updated ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player whose option was updated | | option | `ClientOption` | The option that was updated | | value | `any` | The new value of the option, always null for custom code | ## onClose Called when the lobby is shutting down ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | serverIsShuttingDown | `boolean` | Whether the server is shutting down | ## onCreateBloxdMeshEntity Called when a mesh entity is created ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | eId | `EntityId` | The id of the mesh entity | | type | `string` | The type of mesh entity | | initiatorId | `EntityId \| null` | The id of the entity that created the mesh entity, if any | ## onEntityCollision Called when a entity collides with another entity ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | eId | `EntityId` | The id of the entity | | otherEId | `EntityId` | The id of the other entity | ## onInventoryUpdated Called when a player's inventory is updated ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player whose inventory was updated | ## onItemDropCreated Called when an item drop is created ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | itemEId | `EntityId` | The id of the item drop | | itemName | `string` | The name of the item dropped | | itemAmount | `number` | The amount dropped | | x | `number` | The x coordinate of the item drop | | y | `number` | The y coordinate of the item drop | | z | `number` | The z coordinate of the item drop | ## onMobDamagingOtherMob Called when a mob is damaging another mob Return "preventDamage" to prevent damage Return number to change damage dealt to that amount ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | attackingMob | `MobId` | the id of the mob attacking | | damagedMob | `MobId` | the id of the mob being damaged | | damageDealt | `number` | the amount of damage dealt | | withItem | `string` | the item used to attack | ### Returns: `number \| void \| "preventDamage"` ## onMobDamagingPlayer Called when a mob is damaging a player Return "preventDamage" to prevent damage Return number to change damage dealt to that amount ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | attackingMob | `MobId` | the id of the mob damaging the player | | damagedPlayer | `PlayerId` | the id of the player being damaged | | damageDealt | `number` | the amount of damage dealt | | withItem | `string` | the item used to attack | ### Returns: `number \| void \| "preventDamage"` ## onMobDespawned Called when a mob is despawned ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | mobId | `MobId` | The id of the mob despawned | ## onMobKilledOtherMob Called when a mob kills another mob Return "preventDrop" to prevent the mob from dropping items ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | attackingMob | `MobId` | The id of the mob attacking | | killedMob | `MobId` | The id of the mob killed | | damageDealt | `number` | The amount of damage dealt | | withItem | `string` | The item used to attack | ### Returns: `void \| "preventDrop"` ## onMobKilledPlayer Called when a mob kills a player Return "keepInventory" to not drop the player's inventory ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | attackingMob | `any` | The id of the mob attacking | | killedPlayer | `any` | The id of the player killed | | damageDealt | `any` | The amount of damage dealt | | withItem | `any` | The item used to attack | ### Returns: `void \| "keepInventory"` ## onMobSettingUpdated Called when a mob setting is updated ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | mobId | `MobId` | The id of the mob whose setting was updated | | setting | `MobSetting` | The setting that was updated | | value | `any` | The new value of the setting | ## onPlayerAltAction Called when player completes an alt action (right click on pc). The co-ordinates will be undefined if there is no targeted block (and block will be "Air") ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player completing the alt action | | x | `number` | The x coordinate of the targeted block | | y | `number` | The y coordinate of the targeted block | | z | `number` | The z coordinate of the targeted block | | block | `BlockName` | The name of the targeted block | | targetEId | `EntityId \| null` | The id of the targeted entity | ## onPlayerAttack Called when a player attacks another player ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `string` | The id of the player attacking | ## onPlayerAttemptAltAction Called when player alt actions (right click on pc). The co-ordinates will be undefined if there is no targeted block (and block will be "Air") Some actions can be prevented by returning "preventAction", but this may not work as well for certain actions which the game client predicts to succeed - test it to see if it works for your use case, feel free to report any broken ones. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player attempting the alt action | | x | `number` | The x coordinate of the targeted block | | y | `number` | The y coordinate of the targeted block | | z | `number` | The z coordinate of the targeted block | | block | `BlockName` | The name of the targeted block | | targetEId | `EntityId \| null` | The id of the targeted entity | ### Returns: `void \| "preventAction"` ## onPlayerAttemptCraft Called when a player attempts to craft an item Return "preventCraft" to prevent a craft from happening ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player that is attempting to craft the item | | itemName | `string` | The name of the item that is being crafted | | craftingIdx | `number` | The index of the used recipe in the item's recipe list | | craftTimes | `number` | The number of times the craft recipe is used at once (e.g. shift held while crafting) | ### Returns: `void \| "preventCraft"` ## onPlayerAttemptOpenChest Called when a player attempts to open a chest Return "preventOpen" to prevent the player from opening the chest ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player that is attempting to open the chest | | x | `number` | The x coordinate of the chest that the player is attempting to open | | y | `number` | The y coordinate of the chest that the player is attempting to open | | z | `number` | The z coordinate of the chest that the player is attempting to open | | isMoonstoneChest | `boolean` | Whether the chest is a moonstone chest | | isIronChest | `boolean` | Whether the chest is an iron chest | ### Returns: `void \| "preventOpen"` ## onPlayerAttemptSpawnMob Called when a player attempts to spawn a mob, e.g. using a spawn orb. Return "preventSpawn" to prevent the mob from spawning. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player | | mobType | `MobType` | The type of mob | | x | `number` | The potential x coordinate of the mob | | y | `number` | The potential y coordinate of the mob | | z | `number` | The potential z coordinate of the mob | ### Returns: `void \| "preventSpawn"` ## onPlayerBoughtShopItem Called after a player successfully buys a shop item ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player that bought the item | | categoryKey | `ShopCategoryKey` | The shop category key | | itemKey | `ShopItemKey` | The shop item key | | item | `BoughtShopItem` | The resolved shop item (with per-player overrides applied, internal properties stripped) | | userInput | `string` | The user input provided, if the item has a userInput config | ## onPlayerBreakMeshEntity Called when a player breaks a mesh entity ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player breaking the mesh entity | | entityId | `EntityId` | The id of the mesh entity being broken | ## onPlayerChangeBlock Called when a player changes a block Return "preventChange" to prevent the change. If player places block, fromBlock will be Air (and toBlock the block). If a player breaks a block, toBlock will be Air. Return "preventDrop" to prevent a block item from dropping. Return an array to set the dropped item position. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player that changed the block | | x | `number` | The x coordinate of the block that was changed | | y | `number` | The y coordinate of the block that was changed | | z | `number` | The z coordinate of the block that was changed | | fromBlock | `BlockName` | The old block that was replaced | | toBlock | `BlockName` | The new block that was placed | | droppedItem | `BlockName \| null` | The item that was dropped | | fromBlockInfo | `MultiBlockInfo` | The info of the old block that was replaced | | toBlockInfo | `MultiBlockInfo` | The info of the new block that was placed | ### Returns: `void \| [number, number, number] \| "preventChange" \| "preventDrop"` ## onPlayerChat Called when a player sends a chat message Return false or null to prevent the broadcast of the message. Return a string or CustomTextStyling to add a prefix to message. Return for most flexibility: an object where keys are playerIds - the value for a playerId being false means that player won't receive the message. Otherwise playerId values should be an object with (optional) keys prefixContent and chatContent to modify the prefix and the chat. CustomTextStyling[] prefixContent is expected, e.g. [["prefix"]] or [[{ str: "prefix" }]]. World code is not permitted to specify chatContent, it will be ignored. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player that sent the message | | chatMessage | `string` | The message that the player sent | | channelName | `string` | The name of the channel that the message was sent in | ### Returns: `boolean \| void \| ChatTags \| OnPlayerChatObjectResponse` ## onPlayerClick Called when a player clicks Don't have important functionality depending on wasAltClick, as it'll always be false for touchscreen players. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player clicking | | wasAltClick | `boolean` | Whether the click was an alt click (e.g. right click | | x | `number` | | | y | `number` | | | z | `number` | | | block | `BlockName` | | | targetEId | `EntityId \| null` | | ## onPlayerClickUp Called when a player releases a click (mouse-up on desktop, touch-end on mobile). Fires for both primary and secondary click releases. Keep in mind wasAltClick will always be false for touchscreen players. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player releasing click | | wasAltClick | `boolean` | Whether the released click was an alt click (e.g. right click | | x | `number` | | | y | `number` | | | z | `number` | | | block | `BlockName` | | | targetEId | `EntityId \| null` | | ## onPlayerCraft Called when a player crafts an item ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player that crafted the item | | itemName | `string` | The name of the item that was crafted | | craftingIdx | `number` | The index of the used recipe in the item's recipe list | | recipe | `RecipesForItem[number]` | The recipe that was used to craft the item | | craftTimes | `number` | The number of times the craft recipe is used at once (e.g. shift held while crafting) | ## onPlayerDamagingMeshEntity Called when a player is damaging a mesh entity ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player damaging the mesh entity | | damagedId | `EntityId` | The id of the mesh entity being damaged | | damageDealt | `number` | The amount of damage dealt | | withItem | `string` | The item used to attack | ## onPlayerDamagingMob Called when a player is damaging a mob Return "preventDamage" to prevent damage Return number to change damage dealt to that amount ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player damaging the mob | | mobId | `MobId` | The id of the mob being damaged | | damageDealt | `number` | The amount of damage dealt | | withItem | `string` | The item used to attack | | damagerDbId | `PlayerDbId` | The database id of the player attacking | ### Returns: `number \| void \| "preventDamage"` ## onPlayerDamagingOtherPlayer Called when a player is damaging another player Return "preventDamage" to prevent damage Return number to change damage dealt to that amount Sometimes the damager will have left the game (e.g. spikes placer); in this case, attackingPlayer will be the damagedPlayer, but we pass damagerDbId for use cases where it's important. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | attackingPlayer | `PlayerId` | The id of the player attacking | | damagedPlayer | `PlayerId` | The id of the player being damaged | | damageDealt | `number` | The amount of damage dealt | | withItem | `string` | The item used to attack | | bodyPartHit | `LifeformBodyPart` | The body part hit | | damagerDbId | `PlayerDbId` | The database id of the player attacking | ### Returns: `number \| void \| "preventDamage"` ## onPlayerDropItem Called when a player drops an item Return "preventDrop" to prevent the player from dropping the item at all. Return "allowButNoDroppedItemCreated" to allow discarding items without dropping them. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player that dropped the item | | x | `number` | The x coordinate of the item that was dropped | | y | `number` | The y coordinate of the item that was dropped | | z | `number` | The z coordinate of the item that was dropped | | itemName | `ItemName` | The name of the item that was dropped | | itemAmount | `number` | The amount of the item that was dropped | | fromIdx | `number` | The index of the item that was dropped from the player's inventory | ### Returns: `void \| "preventDrop" \| "allowButNoDroppedItemCreated"` ## onPlayerFinishChargingItem Called when a player finishes charging an item ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player charging the item | | used | `boolean` | Whether the item was used | | itemName | `string` | The name of the charged item | | duration | `number` | The duration of the charge | ## onPlayerFinishQTE ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | qteId | `QTERequestId` | | | result | `boolean` | | ## onPlayerJoin Called when a player joins the lobby ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `string` | The id of the player that joined | | fromGameReset | `boolean` | Whether this call is from a game reset (used by SessionBasedGame) | ## onPlayerJump Called when a player jumps ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `string` | The id of the player that jumped | ## onPlayerKilledMob Called when a player kills a mob Return "preventDrop" to prevent the mob from dropping items ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player killed | | mobId | `MobId` | The id of the mob that killed the player | | damageDealt | `number` | The amount of damage dealt | | withItem | `string` | The item used to attack | ### Returns: `void \| "preventDrop"` ## onPlayerKilledOtherPlayer Called when a player kills another player Return "keepInventory" to not drop the player's inventory ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | attackingPlayer | `string` | The id of the player attacking | | killedPlayer | `string` | The id of the player killed | | damageDealt | `number` | The amount of damage dealt | | withItem | `string` | The item used to attack | ### Returns: `void \| "keepInventory"` ## onPlayerLeave Called when a player leaves the lobby ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `string` | The id of the player that left | | serverIsShuttingDown | `boolean` | Whether the server is shutting down | ## onPlayerMoveInvenItem Called for all types of inventory item movement. Certain methods of moving item can result in splitting a stack into multiple slots. (e.g. shift-click). toStartIdx and toEndIdx provide the min and max idxs moved into. Return "preventChange" to prevent item movement. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player moving the item | | fromIdx | `number` | The index that the item is being moved from | | toStartIdx | `number` | The start index that the item is being moved into | | toEndIdx | `number` | The end index that the item is being moved into | | amt | `number` | The amount of the item being moved | ### Returns: `void \| "preventChange"` ## onPlayerMoveInvenItemWithAmt Return "preventChange" to prevent the movement ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player moving the item | | i | `number` | The index of the first slot | | j | `number` | The index of the second slot | | amt | `number` | The amount of the item being moved | ### Returns: `void \| "preventChange"` ## onPlayerMoveItemIntoIdxs Called when a player moves an item into an index within a range of inventory slots Return "preventChange" to prevent the movement ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player moving the item | | start | `number` | The start index of the range | | end | `number` | The end index of the range | | moveIdx | `number` | The index of the item being moved | | itemAmount | `number` | The amount of the item being moved | ### Returns: `void \| "preventChange"` ## onPlayerMoveItemOutOfInventory Called when a player moves an item out of their inventory Return "preventChange" to prevent the movement ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player moving the item | | itemName | `string` | The name of the item being moved | | itemAmount | `number` | The amount of the item being moved | | fromIdx | `number` | The index which the item is being moved from | | movementType | `string` | The type of movement that occurred | ### Returns: `void \| "preventChange"` ## onPlayerOpenedChest Called when a player opens a chest ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player that opened the chest | | x | `number` | The x coordinate of the chest that was opened | | y | `number` | The y coordinate of the chest that was opened | | z | `number` | The z coordinate of the chest that was opened | | isMoonstoneChest | `boolean` | Whether the chest is a moonstone chest | | isIronChest | `boolean` | Whether the chest is an iron chest | ## onPlayerPickedUpItem Called when a player picks up an item ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player that picked up the item | | itemName | `string` | The name of the item that was picked up | | itemAmount | `number` | The amount of the item that was picked up | ## onPlayerPotionEffect Called when a player is affected by a new potion effect ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | initiatorId | `string` | The id of the player who initiated the potion effect | | targetId | `string` | The id of the player who has started being affected | | effectName | `"Damage" \| "Speed" \| "Damage Reduction" \| "Invisible" \| "Jump Boost" \| "Knockback" \| "Poisoned" \| "Slowness" \| "Weakness" \| "Cleansed" \| "Instant Damage" \| "Health Regen" \| "Instant Health" \| "Haste" \| "Shield" \| "Double Jump" \| "Heat Resistance" \| "Thief" \| "X-Ray Vision" \| "Mining Yield" \| "Brain Rot" \| "Aura" \| "Wall Climbing" \| "Air Walk" \| "Pickpocketer" \| "Lifesteal" \| "Bounciness" \| "Blindness" \| "Poopy"` | The name of the potion effect | ### Returns: `void \| "preventEffect"` ## onPlayerRequestChunk Called when a player requests a chunk ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player requesting the chunk | | chunkX | `number` | The x coordinate of the chunk being requested | | chunkY | `number` | The y coordinate of the chunk being requested | | chunkZ | `number` | The z coordinate of the chunk being requested | | chunkId | `string` | The id of the chunk being requested | ## onPlayerSelectInventorySlot Called when a player selects a different inventory slot. This will be called eventually when you have already set the slot using api.setSelectedInventorySlotI so be careful not to cause an infinite loop doing this. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player that selected the inventory slot | | slotIndex | `number` | The index of the inventory slot that was selected | ## onPlayerSpawnMob Called when a mob is spawned by a player ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player who spawned the mob | | mobId | `MobId` | The id of the mob | | mobType | `MobType` | The type of mob | | x | `number` | The x coordinate of the mob | | y | `number` | The y coordinate of the mob | | z | `number` | The z coordinate of the mob | | mobHerdId | `MobHerdId` | The herd id of the mob | | playSoundOnSpawn | `boolean` | Whether to play a sound on spawn | ## onPlayerStartChargingItem Called when a player starts charging an item ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player charging the item | | itemName | `string` | The name of the item being charged | ### Returns: `void \| "preventCharge"` ## onPlayerSwapInvenSlots Return "preventChange" to prevent the swap ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player swapping the inventory slots | | i | `number` | The index of the first slot | | j | `number` | The index of the second slot | ### Returns: `void \| "preventChange"` ## onPlayerThrowableHitTerrain Called when a player's thrown projectile hits the terrain ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player that threw the throwable item | | throwableName | `ThrowableItem` | The name of the throwable item | | thrownEntityId | `EntityId` | The id of the entity which hit the terrain | ## onPlayerUsedThrowable Called when a player uses a throwable item ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player using the throwable item | | throwableName | `ThrowableItem` | The name of the throwable item | | thrownEntityId | `EntityId` | The id of the projectile created by the player | ## onRespawnRequest Called when a player requests to respawn. Optionally return the respawn location. Defaults to [0, 0, 0]. Return true to handle yourself (good for async, but be careful that the player isn't at the place they died, as they could pick up their old items or hit the player they were fighting). ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `string` | The id of the player that requested to respawn | ### Returns: `true \| void \| number[]` ## onTaskClaimed Called when a player claims a task ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `string` | The id of the player claiming the task | | taskId | `any` | The id of the task being claimed | | isPromoTask | `any` | Whether the task is a promo task | | claimedRewards | `any` | The rewards claimed by the player | ### Returns: `any` ## onTouchscreenActionButton Set client option `touchscreenActionButton` to take effect Called when a player presses the touchscreen action button Called for both touchDown and touchUp ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player pressing the touchscreen action button | | touchDown | `boolean` | Whether the touchscreen action button was pressed or released | ## onWorldAttemptDespawnMob Called when a mob is despawned by the world. Return "preventDespawn" to prevent the mob from despawning. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | mobId | `MobId` | The id of the mob despawned | ### Returns: `void \| "preventDespawn"` ## onWorldAttemptSpawnMob Called when the world attempts to spawn a mob. Return "preventSpawn" to prevent the mob from spawning. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | mobType | `MobType` | The type of mob | | x | `number` | The potential x coordinate of the mob | | y | `number` | The potential y coordinate of the mob | | z | `number` | The potential z coordinate of the mob | ### Returns: `void \| "preventSpawn"` ## onWorldChangeBlock Called when a block is changed in the world initiatorDbId is null if updated by game code e.g. when a sapling grows Return "preventChange" to prevent change Return "preventDrop" to prevent a block item from dropping ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | x | `number` | The x coordinate of the block | | y | `number` | The y coordinate of the block | | z | `number` | The z coordinate of the block | | fromBlock | `BlockName` | The old block that was replaced | | toBlock | `BlockName` | The new block that was placed | | initiatorDbId | `string \| null` | The id of the player who updated the block | | extraInfo | `WorldBlockChangedInfo` | Extra info about the block change | ### Returns: `void \| "preventChange" \| "preventDrop"` ## onWorldSpawnMob Called when a mob is spawned by the world ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | mobId | `MobId` | The id of the mob | | mobType | `MobType` | The type of mob | | x | `number` | The x coordinate of the mob | | y | `number` | The y coordinate of the mob | | z | `number` | The z coordinate of the mob | | mobHerdId | `MobHerdId` | The herd id of the mob | | playSoundOnSpawn | `boolean` | Whether to play a sound on spawn | ## playerCommand Called when a player sends a command ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `string` | The id of the player that sent the command | | command | `string` | The command that the player sent | ### Returns: `boolean` ## tick Called every tick, 20 times per second ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | ms | `number` | The fixed timestep, can be used as "milliseconds since last tick" | # Callbacks Players can use World Code in custom worlds get functions they've written to run when game events happen. These special functions are called callbacks. The world code can be viewed by pressing F8 by default. Initially the world code will have this comment, which can be removed: ```text tick onClose onPlayerJoin onPlayerLeave onPlayerJump onRespawnRequest playerCommand onPlayerChat onPlayerChangeBlock onPlayerDropItem onPlayerPickedUpItem onPlayerSelectInventorySlot onBlockStand onPlayerAttemptCraft onPlayerCraft onPlayerAttemptOpenChest onPlayerOpenedChest onPlayerMoveItemOutOfInventory onPlayerMoveInvenItem onPlayerMoveItemIntoIdxs onPlayerSwapInvenSlots onPlayerMoveInvenItemWithAmt onPlayerAttemptAltAction onPlayerAltAction onPlayerClick onPlayerClickUp onClientOptionUpdated onMobSettingUpdated onInventoryUpdated onChestUpdated onWorldChangeBlock onCreateBloxdMeshEntity onEntityCollision onPlayerAttemptSpawnMob onWorldAttemptSpawnMob onPlayerSpawnMob onWorldSpawnMob onWorldAttemptDespawnMob onMobDespawned onPlayerAttack onPlayerDamagingOtherPlayer onPlayerDamagingMob onMobDamagingPlayer onMobDamagingOtherMob onAttemptKillPlayer onPlayerKilledOtherPlayer onMobKilledPlayer onPlayerKilledMob onMobKilledOtherMob onPlayerPotionEffect onPlayerDamagingMeshEntity onPlayerBreakMeshEntity onPlayerUsedThrowable onPlayerThrowableHitTerrain onTouchscreenActionButton onTaskClaimed onChunkLoaded onPlayerRequestChunk onItemDropCreated onPlayerStartChargingItem onPlayerFinishChargingItem onPlayerFinishQTE onPlayerBoughtShopItem doPeriodicSave To use a callback, just assign a function to it in the world code! tick = () => {} or function tick() {} ``` You can use `api.setCallbackValueFallback("callbackName", defaultValue)` to set a default value to be returned by your callback code if it throws an error. ## doPeriodicSave Called every so often. You should save custom db values/s3 objects here. Persisted items ARE saved on graceful shutdown (e.g. uncaught error, update, etc), but this helps prevent large data-loss on non-graceful shutdowns. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| ## onAttemptKillPlayer Called when a player is about to be killed Return "preventDeath" to prevent the player from being killed ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | killedPlayer | `PlayerId` | The id of the player being killed | | attackingLifeform | `LifeformId` | The optional id of the lifeform attacking the player | ### Returns: `void \| "preventDeath"` ## onBlockStand Called when a player stands on a block ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player that stood on the block | | x | `number` | The x coordinate of the block that was stood on | | y | `number` | The y coordinate of the block that was stood on | | z | `number` | The z coordinate of the block that was stood on | | blockName | `BlockName` | The name of the block that was stood on | ## onChestUpdated Called when a chest is updated by a player x, y, z, will be null if isMoonstoneChest is true ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | initiatorEId | `PlayerId` | The id of the player who updated the chest | | isMoonstoneChest | `boolean` | Whether the chest is a moonstone chest | | x | `number \| null` | The x coordinate of the chest | | y | `number \| null` | The y coordinate of the chest | | z | `number \| null` | The z coordinate of the chest | ## onChunkLoaded Called when a chunk is first loaded API Methods that modify the chunk like setBlock cannot be used here to make persisted changes, and will introduce client-server desync most cases, but might have some creative uses if you know what you're doing. For most use cases, consider using another callback e.g. tick. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | chunkId | `string` | The id of the chunk being loaded | | chunk | `LoadedChunk` | The chunk being loaded, which can be modified by this callback * For world code callbacks this value will always be null. | | wasPersistedChunk | `boolean` | Whether the chunk was persisted | ## onClientOptionUpdated Called when a client option is updated ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player whose option was updated | | option | `ClientOption` | The option that was updated | | value | `any` | The new value of the option, always null for custom code | ## onClose Called when the lobby is shutting down ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | serverIsShuttingDown | `boolean` | Whether the server is shutting down | ## onCreateBloxdMeshEntity Called when a mesh entity is created ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | eId | `EntityId` | The id of the mesh entity | | type | `string` | The type of mesh entity | | initiatorId | `EntityId \| null` | The id of the entity that created the mesh entity, if any | ## onEntityCollision Called when a entity collides with another entity ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | eId | `EntityId` | The id of the entity | | otherEId | `EntityId` | The id of the other entity | ## onInventoryUpdated Called when a player's inventory is updated ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player whose inventory was updated | ## onItemDropCreated Called when an item drop is created ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | itemEId | `EntityId` | The id of the item drop | | itemName | `string` | The name of the item dropped | | itemAmount | `number` | The amount dropped | | x | `number` | The x coordinate of the item drop | | y | `number` | The y coordinate of the item drop | | z | `number` | The z coordinate of the item drop | ## onMobDamagingOtherMob Called when a mob is damaging another mob Return "preventDamage" to prevent damage Return number to change damage dealt to that amount ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | attackingMob | `MobId` | the id of the mob attacking | | damagedMob | `MobId` | the id of the mob being damaged | | damageDealt | `number` | the amount of damage dealt | | withItem | `string` | the item used to attack | ### Returns: `number \| void \| "preventDamage"` ## onMobDamagingPlayer Called when a mob is damaging a player Return "preventDamage" to prevent damage Return number to change damage dealt to that amount ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | attackingMob | `MobId` | the id of the mob damaging the player | | damagedPlayer | `PlayerId` | the id of the player being damaged | | damageDealt | `number` | the amount of damage dealt | | withItem | `string` | the item used to attack | ### Returns: `number \| void \| "preventDamage"` ## onMobDespawned Called when a mob is despawned ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | mobId | `MobId` | The id of the mob despawned | ## onMobKilledOtherMob Called when a mob kills another mob Return "preventDrop" to prevent the mob from dropping items ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | attackingMob | `MobId` | The id of the mob attacking | | killedMob | `MobId` | The id of the mob killed | | damageDealt | `number` | The amount of damage dealt | | withItem | `string` | The item used to attack | ### Returns: `void \| "preventDrop"` ## onMobKilledPlayer Called when a mob kills a player Return "keepInventory" to not drop the player's inventory ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | attackingMob | `any` | The id of the mob attacking | | killedPlayer | `any` | The id of the player killed | | damageDealt | `any` | The amount of damage dealt | | withItem | `any` | The item used to attack | ### Returns: `void \| "keepInventory"` ## onMobSettingUpdated Called when a mob setting is updated ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | mobId | `MobId` | The id of the mob whose setting was updated | | setting | `MobSetting` | The setting that was updated | | value | `any` | The new value of the setting | ## onPlayerAltAction Called when player completes an alt action (right click on pc). The co-ordinates will be undefined if there is no targeted block (and block will be "Air") ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player completing the alt action | | x | `number` | The x coordinate of the targeted block | | y | `number` | The y coordinate of the targeted block | | z | `number` | The z coordinate of the targeted block | | block | `BlockName` | The name of the targeted block | | targetEId | `EntityId \| null` | The id of the targeted entity | ## onPlayerAttack Called when a player attacks another player ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `string` | The id of the player attacking | ## onPlayerAttemptAltAction Called when player alt actions (right click on pc). The co-ordinates will be undefined if there is no targeted block (and block will be "Air") Some actions can be prevented by returning "preventAction", but this may not work as well for certain actions which the game client predicts to succeed - test it to see if it works for your use case, feel free to report any broken ones. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player attempting the alt action | | x | `number` | The x coordinate of the targeted block | | y | `number` | The y coordinate of the targeted block | | z | `number` | The z coordinate of the targeted block | | block | `BlockName` | The name of the targeted block | | targetEId | `EntityId \| null` | The id of the targeted entity | ### Returns: `void \| "preventAction"` ## onPlayerAttemptCraft Called when a player attempts to craft an item Return "preventCraft" to prevent a craft from happening ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player that is attempting to craft the item | | itemName | `string` | The name of the item that is being crafted | | craftingIdx | `number` | The index of the used recipe in the item's recipe list | | craftTimes | `number` | The number of times the craft recipe is used at once (e.g. shift held while crafting) | ### Returns: `void \| "preventCraft"` ## onPlayerAttemptOpenChest Called when a player attempts to open a chest Return "preventOpen" to prevent the player from opening the chest ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player that is attempting to open the chest | | x | `number` | The x coordinate of the chest that the player is attempting to open | | y | `number` | The y coordinate of the chest that the player is attempting to open | | z | `number` | The z coordinate of the chest that the player is attempting to open | | isMoonstoneChest | `boolean` | Whether the chest is a moonstone chest | | isIronChest | `boolean` | Whether the chest is an iron chest | ### Returns: `void \| "preventOpen"` ## onPlayerAttemptSpawnMob Called when a player attempts to spawn a mob, e.g. using a spawn orb. Return "preventSpawn" to prevent the mob from spawning. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player | | mobType | `MobType` | The type of mob | | x | `number` | The potential x coordinate of the mob | | y | `number` | The potential y coordinate of the mob | | z | `number` | The potential z coordinate of the mob | ### Returns: `void \| "preventSpawn"` ## onPlayerBoughtShopItem Called after a player successfully buys a shop item ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player that bought the item | | categoryKey | `ShopCategoryKey` | The shop category key | | itemKey | `ShopItemKey` | The shop item key | | item | `BoughtShopItem` | The resolved shop item (with per-player overrides applied, internal properties stripped) | | userInput | `string` | The user input provided, if the item has a userInput config | ## onPlayerBreakMeshEntity Called when a player breaks a mesh entity ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player breaking the mesh entity | | entityId | `EntityId` | The id of the mesh entity being broken | ## onPlayerChangeBlock Called when a player changes a block Return "preventChange" to prevent the change. If player places block, fromBlock will be Air (and toBlock the block). If a player breaks a block, toBlock will be Air. Return "preventDrop" to prevent a block item from dropping. Return an array to set the dropped item position. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player that changed the block | | x | `number` | The x coordinate of the block that was changed | | y | `number` | The y coordinate of the block that was changed | | z | `number` | The z coordinate of the block that was changed | | fromBlock | `BlockName` | The old block that was replaced | | toBlock | `BlockName` | The new block that was placed | | droppedItem | `BlockName \| null` | The item that was dropped | | fromBlockInfo | `MultiBlockInfo` | The info of the old block that was replaced | | toBlockInfo | `MultiBlockInfo` | The info of the new block that was placed | ### Returns: `void \| [number, number, number] \| "preventChange" \| "preventDrop"` ## onPlayerChat Called when a player sends a chat message Return false or null to prevent the broadcast of the message. Return a string or CustomTextStyling to add a prefix to message. Return for most flexibility: an object where keys are playerIds - the value for a playerId being false means that player won't receive the message. Otherwise playerId values should be an object with (optional) keys prefixContent and chatContent to modify the prefix and the chat. CustomTextStyling[] prefixContent is expected, e.g. [["prefix"]] or [[{ str: "prefix" }]]. World code is not permitted to specify chatContent, it will be ignored. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player that sent the message | | chatMessage | `string` | The message that the player sent | | channelName | `string` | The name of the channel that the message was sent in | ### Returns: `boolean \| void \| ChatTags \| OnPlayerChatObjectResponse` ## onPlayerClick Called when a player clicks Don't have important functionality depending on wasAltClick, as it'll always be false for touchscreen players. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player clicking | | wasAltClick | `boolean` | Whether the click was an alt click (e.g. right click | | x | `number` | | | y | `number` | | | z | `number` | | | block | `BlockName` | | | targetEId | `EntityId \| null` | | ## onPlayerClickUp Called when a player releases a click (mouse-up on desktop, touch-end on mobile). Fires for both primary and secondary click releases. Keep in mind wasAltClick will always be false for touchscreen players. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player releasing click | | wasAltClick | `boolean` | Whether the released click was an alt click (e.g. right click | | x | `number` | | | y | `number` | | | z | `number` | | | block | `BlockName` | | | targetEId | `EntityId \| null` | | ## onPlayerCraft Called when a player crafts an item ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player that crafted the item | | itemName | `string` | The name of the item that was crafted | | craftingIdx | `number` | The index of the used recipe in the item's recipe list | | recipe | `RecipesForItem[number]` | The recipe that was used to craft the item | | craftTimes | `number` | The number of times the craft recipe is used at once (e.g. shift held while crafting) | ## onPlayerDamagingMeshEntity Called when a player is damaging a mesh entity ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player damaging the mesh entity | | damagedId | `EntityId` | The id of the mesh entity being damaged | | damageDealt | `number` | The amount of damage dealt | | withItem | `string` | The item used to attack | ## onPlayerDamagingMob Called when a player is damaging a mob Return "preventDamage" to prevent damage Return number to change damage dealt to that amount ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player damaging the mob | | mobId | `MobId` | The id of the mob being damaged | | damageDealt | `number` | The amount of damage dealt | | withItem | `string` | The item used to attack | | damagerDbId | `PlayerDbId` | The database id of the player attacking | ### Returns: `number \| void \| "preventDamage"` ## onPlayerDamagingOtherPlayer Called when a player is damaging another player Return "preventDamage" to prevent damage Return number to change damage dealt to that amount Sometimes the damager will have left the game (e.g. spikes placer); in this case, attackingPlayer will be the damagedPlayer, but we pass damagerDbId for use cases where it's important. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | attackingPlayer | `PlayerId` | The id of the player attacking | | damagedPlayer | `PlayerId` | The id of the player being damaged | | damageDealt | `number` | The amount of damage dealt | | withItem | `string` | The item used to attack | | bodyPartHit | `LifeformBodyPart` | The body part hit | | damagerDbId | `PlayerDbId` | The database id of the player attacking | ### Returns: `number \| void \| "preventDamage"` ## onPlayerDropItem Called when a player drops an item Return "preventDrop" to prevent the player from dropping the item at all. Return "allowButNoDroppedItemCreated" to allow discarding items without dropping them. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player that dropped the item | | x | `number` | The x coordinate of the item that was dropped | | y | `number` | The y coordinate of the item that was dropped | | z | `number` | The z coordinate of the item that was dropped | | itemName | `ItemName` | The name of the item that was dropped | | itemAmount | `number` | The amount of the item that was dropped | | fromIdx | `number` | The index of the item that was dropped from the player's inventory | ### Returns: `void \| "preventDrop" \| "allowButNoDroppedItemCreated"` ## onPlayerFinishChargingItem Called when a player finishes charging an item ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player charging the item | | used | `boolean` | Whether the item was used | | itemName | `string` | The name of the charged item | | duration | `number` | The duration of the charge | ## onPlayerFinishQTE ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | | | qteId | `QTERequestId` | | | result | `boolean` | | ## onPlayerJoin Called when a player joins the lobby ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `string` | The id of the player that joined | | fromGameReset | `boolean` | Whether this call is from a game reset (used by SessionBasedGame) | ## onPlayerJump Called when a player jumps ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `string` | The id of the player that jumped | ## onPlayerKilledMob Called when a player kills a mob Return "preventDrop" to prevent the mob from dropping items ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player killed | | mobId | `MobId` | The id of the mob that killed the player | | damageDealt | `number` | The amount of damage dealt | | withItem | `string` | The item used to attack | ### Returns: `void \| "preventDrop"` ## onPlayerKilledOtherPlayer Called when a player kills another player Return "keepInventory" to not drop the player's inventory ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | attackingPlayer | `string` | The id of the player attacking | | killedPlayer | `string` | The id of the player killed | | damageDealt | `number` | The amount of damage dealt | | withItem | `string` | The item used to attack | ### Returns: `void \| "keepInventory"` ## onPlayerLeave Called when a player leaves the lobby ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `string` | The id of the player that left | | serverIsShuttingDown | `boolean` | Whether the server is shutting down | ## onPlayerMoveInvenItem Called for all types of inventory item movement. Certain methods of moving item can result in splitting a stack into multiple slots. (e.g. shift-click). toStartIdx and toEndIdx provide the min and max idxs moved into. Return "preventChange" to prevent item movement. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player moving the item | | fromIdx | `number` | The index that the item is being moved from | | toStartIdx | `number` | The start index that the item is being moved into | | toEndIdx | `number` | The end index that the item is being moved into | | amt | `number` | The amount of the item being moved | ### Returns: `void \| "preventChange"` ## onPlayerMoveInvenItemWithAmt Return "preventChange" to prevent the movement ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player moving the item | | i | `number` | The index of the first slot | | j | `number` | The index of the second slot | | amt | `number` | The amount of the item being moved | ### Returns: `void \| "preventChange"` ## onPlayerMoveItemIntoIdxs Called when a player moves an item into an index within a range of inventory slots Return "preventChange" to prevent the movement ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player moving the item | | start | `number` | The start index of the range | | end | `number` | The end index of the range | | moveIdx | `number` | The index of the item being moved | | itemAmount | `number` | The amount of the item being moved | ### Returns: `void \| "preventChange"` ## onPlayerMoveItemOutOfInventory Called when a player moves an item out of their inventory Return "preventChange" to prevent the movement ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player moving the item | | itemName | `string` | The name of the item being moved | | itemAmount | `number` | The amount of the item being moved | | fromIdx | `number` | The index which the item is being moved from | | movementType | `string` | The type of movement that occurred | ### Returns: `void \| "preventChange"` ## onPlayerOpenedChest Called when a player opens a chest ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player that opened the chest | | x | `number` | The x coordinate of the chest that was opened | | y | `number` | The y coordinate of the chest that was opened | | z | `number` | The z coordinate of the chest that was opened | | isMoonstoneChest | `boolean` | Whether the chest is a moonstone chest | | isIronChest | `boolean` | Whether the chest is an iron chest | ## onPlayerPickedUpItem Called when a player picks up an item ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player that picked up the item | | itemName | `string` | The name of the item that was picked up | | itemAmount | `number` | The amount of the item that was picked up | ## onPlayerPotionEffect Called when a player is affected by a new potion effect ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | initiatorId | `string` | The id of the player who initiated the potion effect | | targetId | `string` | The id of the player who has started being affected | | effectName | `"Damage" \| "Speed" \| "Damage Reduction" \| "Invisible" \| "Jump Boost" \| "Knockback" \| "Poisoned" \| "Slowness" \| "Weakness" \| "Cleansed" \| "Instant Damage" \| "Health Regen" \| "Instant Health" \| "Haste" \| "Shield" \| "Double Jump" \| "Heat Resistance" \| "Thief" \| "X-Ray Vision" \| "Mining Yield" \| "Brain Rot" \| "Aura" \| "Wall Climbing" \| "Air Walk" \| "Pickpocketer" \| "Lifesteal" \| "Bounciness" \| "Blindness" \| "Poopy"` | The name of the potion effect | ### Returns: `void \| "preventEffect"` ## onPlayerRequestChunk Called when a player requests a chunk ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player requesting the chunk | | chunkX | `number` | The x coordinate of the chunk being requested | | chunkY | `number` | The y coordinate of the chunk being requested | | chunkZ | `number` | The z coordinate of the chunk being requested | | chunkId | `string` | The id of the chunk being requested | ## onPlayerSelectInventorySlot Called when a player selects a different inventory slot. This will be called eventually when you have already set the slot using api.setSelectedInventorySlotI so be careful not to cause an infinite loop doing this. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player that selected the inventory slot | | slotIndex | `number` | The index of the inventory slot that was selected | ## onPlayerSpawnMob Called when a mob is spawned by a player ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player who spawned the mob | | mobId | `MobId` | The id of the mob | | mobType | `MobType` | The type of mob | | x | `number` | The x coordinate of the mob | | y | `number` | The y coordinate of the mob | | z | `number` | The z coordinate of the mob | | mobHerdId | `MobHerdId` | The herd id of the mob | | playSoundOnSpawn | `boolean` | Whether to play a sound on spawn | ## onPlayerStartChargingItem Called when a player starts charging an item ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player charging the item | | itemName | `string` | The name of the item being charged | ### Returns: `void \| "preventCharge"` ## onPlayerSwapInvenSlots Return "preventChange" to prevent the swap ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player swapping the inventory slots | | i | `number` | The index of the first slot | | j | `number` | The index of the second slot | ### Returns: `void \| "preventChange"` ## onPlayerThrowableHitTerrain Called when a player's thrown projectile hits the terrain ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player that threw the throwable item | | throwableName | `ThrowableItem` | The name of the throwable item | | thrownEntityId | `EntityId` | The id of the entity which hit the terrain | ## onPlayerUsedThrowable Called when a player uses a throwable item ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player using the throwable item | | throwableName | `ThrowableItem` | The name of the throwable item | | thrownEntityId | `EntityId` | The id of the projectile created by the player | ## onRespawnRequest Called when a player requests to respawn. Optionally return the respawn location. Defaults to [0, 0, 0]. Return true to handle yourself (good for async, but be careful that the player isn't at the place they died, as they could pick up their old items or hit the player they were fighting). ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `string` | The id of the player that requested to respawn | ### Returns: `true \| void \| number[]` ## onTaskClaimed Called when a player claims a task ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `string` | The id of the player claiming the task | | taskId | `any` | The id of the task being claimed | | isPromoTask | `any` | Whether the task is a promo task | | claimedRewards | `any` | The rewards claimed by the player | ### Returns: `any` ## onTouchscreenActionButton Set client option `touchscreenActionButton` to take effect Called when a player presses the touchscreen action button Called for both touchDown and touchUp ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `PlayerId` | The id of the player pressing the touchscreen action button | | touchDown | `boolean` | Whether the touchscreen action button was pressed or released | ## onWorldAttemptDespawnMob Called when a mob is despawned by the world. Return "preventDespawn" to prevent the mob from despawning. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | mobId | `MobId` | The id of the mob despawned | ### Returns: `void \| "preventDespawn"` ## onWorldAttemptSpawnMob Called when the world attempts to spawn a mob. Return "preventSpawn" to prevent the mob from spawning. ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | mobType | `MobType` | The type of mob | | x | `number` | The potential x coordinate of the mob | | y | `number` | The potential y coordinate of the mob | | z | `number` | The potential z coordinate of the mob | ### Returns: `void \| "preventSpawn"` ## onWorldChangeBlock Called when a block is changed in the world initiatorDbId is null if updated by game code e.g. when a sapling grows Return "preventChange" to prevent change Return "preventDrop" to prevent a block item from dropping ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | x | `number` | The x coordinate of the block | | y | `number` | The y coordinate of the block | | z | `number` | The z coordinate of the block | | fromBlock | `BlockName` | The old block that was replaced | | toBlock | `BlockName` | The new block that was placed | | initiatorDbId | `string \| null` | The id of the player who updated the block | | extraInfo | `WorldBlockChangedInfo` | Extra info about the block change | ### Returns: `void \| "preventChange" \| "preventDrop"` ## onWorldSpawnMob Called when a mob is spawned by the world ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | mobId | `MobId` | The id of the mob | | mobType | `MobType` | The type of mob | | x | `number` | The x coordinate of the mob | | y | `number` | The y coordinate of the mob | | z | `number` | The z coordinate of the mob | | mobHerdId | `MobHerdId` | The herd id of the mob | | playSoundOnSpawn | `boolean` | Whether to play a sound on spawn | ## playerCommand Called when a player sends a command ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | playerId | `string` | The id of the player that sent the command | | command | `string` | The command that the player sent | ### Returns: `boolean` ## tick Called every tick, 20 times per second ### Parameters: | Parameter | Type | Description | |-----------|------|-------------| | ms | `number` | The fixed timestep, can be used as "milliseconds since last tick" | # Client Options A player's "Client Options" impact what they are capable of doing in the world. For example you can give them a double jump by setting the player's `airJumpCount` to `1`. Alternatively their health bar can be increased by setting their `maxHealth` to `200`. These API methods allow you to modify the client options: ```js /** * Modify a client option at runtime and send to the client if it changed * * @param {PlayerId} playerId * @param {PassedOption} option - The name of the option * @param {ClientOptions[PassedOption]} value - The new value of the option * @returns {void} */ setClientOption(playerId, option, value) /** * Returns the current value of a client option * * @param {PlayerId} playerId * @param {PassedOption} option * @returns {ClientOptions[PassedOption]} */ getClientOption(playerId, option) /** * Modify client options at runtime * * @param {PlayerId} playerId * @param {Partial} optionsObj - An object which contains key value pairs of new settings. E.g {canChange: true, speedMultiplier: false} * @returns {void} */ setClientOptions(playerId, optionsObj) /** * Sets a client option to its default value. This will be the value stored in your game's defaultClientOptions, otherwise Bloxd's default. * * @param {PlayerId} playerId * @param {ClientOption} option * @returns {void} */ setClientOptionToDefault(playerId, option) ``` Here is the full list of available client options: ## airAccScale **Type:** `number` **Default:** `1` Amount of acceleration to apply to airborne players. Only change if absolutely necessary i.e. Rocket Obby uses 0.25. Players are used to the default bloxd movement behaviour and speed, and may be put off from your game if different muscle memory is required. We suggest applying speed or slowness effects instead, using api.applyEffect. ## airFrictionScale **Type:** `number` **Default:** `1` Amount of friction to apply to airborne players. Only change if absolutely necessary i.e. Rocket Obby uses 0. Players are used to the default bloxd movement behaviour and speed, and may be put off from your game if different muscle memory is required. We suggest applying speed or slowness effects instead, using api.applyEffect. ## airJumpCount **Type:** `number` **Default:** `0` Amount of air jumps the player has ## airMomentumConservation **Type:** `boolean` **Default:** `false` Whether to allow the player to strafe and conserve momentum while airborne. Only change if absolutely necessary i.e. only Rocket Obby uses true. Players are used to the default bloxd movement behaviour and speed, and may be put off from your game if different muscle memory is required. We suggest applying speed or slowness effects instead, using api.applyEffect. ## arrowPotionEffectDuration **Type:** `number` **Default:** `6000` Duration of arrow potion effects ## auraPerLevel **Type:** `number` **Default:** `100` How much Aura XP is required per level. ## autoRespawn **Type:** `boolean` **Default:** `false` If true, player will respawn automatically after secsToRespawn seconds ## bounciness **Type:** `number` **Default:** `0` How much the player bounces off of solid blocks. A value of 1 is equivalent to every block acting as a mushroom. ## bunnyhopMaxMultiplier **Type:** `number` **Default:** `1.3` Maximum multiplier for jump height when bunnyhopping ## cameraRoll **Type:** `number` **Default:** `0` Roll angle of the camera in radians. Useful for disorientation effects, death effects, etc. ## cameraRollTransitionMs **Type:** `number` **Default:** `0` Duration in ms to animate/transition to the camera roll angle (when you change cameraRoll). 0 = instant. Useful for smooth camera roll transitions. ## cameraTint **Type:** `[number, number, number, number]` **Default:** `null` RGBA array [r, g, b, a] for camera screen tint effect. Values fall between 0 and 1. ## canAltAction **Type:** `boolean` **Default:** `true` Whether the player can use the alt action key (right click on PC) ## canChange **Type:** `boolean` **Default:** `true` Whether the player can change blocks ## canClimbWalls **Type:** `boolean` **Default:** `false` Whether the player can climb walls ## canCraft **Type:** `boolean` **Default:** `true` Whether to allow the player to craft items useFullInventory must be true for this to work ## canCrouch **Type:** `boolean` **Default:** `true` Whether the player can crouch ## canCustomiseChar **Type:** `boolean` **Default:** `true` Whether the player can customise their character ## canPickBlocks **Type:** `boolean` **Default:** `true` Whether the player can pick blocks (middle mouse click on PC), ignored if creative is false ## canPickUpItems **Type:** `boolean` **Default:** `true` Whether to allow the player to pick up items ## canSeeNametagsThroughWalls **Type:** `boolean` **Default:** `true` Whether the player can see name tags through walls ## cantBreakError **Type:** `string | CustomTextStyling` **Default:** `null` Error message for when the player fails to break a block ## cantBuildError **Type:** `string | CustomTextStyling` **Default:** `null` Error message for when the player fails to place a block ## cantChangeError **Type:** `string | CustomTextStyling` **Default:** `"You cannot modify this block"` Error message for when the player fails to change a block ## canUseZoomKey **Type:** `boolean` **Default:** `true` Whether the player can use the zoom key ## chatChannels **Type:** ` { channelName: string; elementContent: string | CustomTextStyling; elementBgColor: string; }[] ` **Default:** `null` Allows player to select a channel that is passed as argument to onPlayerChat. See engineGameplayTypes.ts for expected format ## compassTarget **Type:** `string | number | number[]` **Default:** `[0, 0, 0]` The target the compass will point towards ## creative **Type:** `boolean` **Default:** `false` Whether the player is in creative mode ## crosshairText **Type:** `string | CustomTextStyling` **Default:** `""` Text to display by the crosshair ## crouchingSpeed **Type:** `number` **Default:** `2` Speed multiplier for the player when crouching. Players are used to the default bloxd movement behaviour and speed, and may be put off from your game if different muscle memory is required. We suggest applying speed or slowness effects instead, using api.applyEffect. ## crouchMobDetectionRadiusMultiplier **Type:** `number` **Default:** `2` Mult for the radius within which mobs can detect the player when crouching. If a player's mult is 2, then mobs will think they are twice as far away. ## dealingDamageDefaultMultiplier **Type:** `number` **Default:** `1` Mult for when the player hits neither a leg or a head. Only applies to guns ## dealingDamageHeadMultiplier **Type:** `number` **Default:** `1.75` Damage multiplier for when the player hits a head. Only applies to guns ## dealingDamageLegMultiplier **Type:** `number` **Default:** `1` Damage multiplier for when the player hits a leg. Only applies to guns ## dealingDamageMultiplier **Type:** `number` **Default:** `1` Damage multiplier for all types of damage ## defaultBlock **Type:** `string` **Default:** `"Block of Gold"` The default block the player can change blocks to, used if canChange is true but useInventory is false ## droppedItemScale **Type:** `number` **Default:** `1` Scale factor to use for dropped item meshes ## effectDamageDuration **Type:** `number` **Default:** `8000` Duration of the +damage effect from plum ## effectDamageReductionDuration **Type:** `number` **Default:** `13000` Duration of +damage reduction effect from pear ## effectHealthRegenDuration **Type:** `number` **Default:** `5000` Duration of +health regen effect from cherry ## effectSpeedDuration **Type:** `number` **Default:** `8000` Duration of +speed effect from cracked coconut ## fallDamage **Type:** `boolean` **Default:** `false` Whether to deal damage to the player when they fall ## flySpeedMultiplier **Type:** `number` **Default:** `1.5` Multiplier for the flying speed in creative mode ## fogChunkDistanceOverride **Type:** `number` **Default:** `null` Fog distance which overrides graphic settings. Uses graphic settings if null. ## fogColourOverride **Type:** `string` **Default:** `null` RGB string for fog colour override. e.g. #ffffff ## forcedCameraDirection **Type:** `[number, number, number]` **Default:** `null` Force the camera to look in a specific direction [x, y, z]. Set to null to allow free camera movement. ## forcedCameraDirectionTransitionMs **Type:** `number` **Default:** `0` Duration in ms to animate/transition to the forced camera direction (when you change forcedCameraDirection). 0 = instant. Useful for smooth camera movements. ## groundFrictionScale **Type:** `number` **Default:** `1` Amount of friction to apply to grounded players. Only change if absolutely necessary i.e. Rocket Obby uses 3. Players are used to the default bloxd movement behaviour and speed, and may be put off from your game if different muscle memory is required. We suggest applying speed or slowness effects instead, using api.applyEffect. ## healthRegenAmount **Type:** `number` **Default:** `0.05` Fraction of max health that regens each regen tick ## healthRegenInterval **Type:** `number` **Default:** `4000` How often health regen is ticked ## healthRegenStartAfter **Type:** `number` **Default:** `5000` How long after a player receives damage to start regen again ## heldLightColourOverride **Type:** `string` **Default:** `null` Held item light colour override - hex colour string e.g. #ffffff. Applied regardless of any held item. ## hideCoordinates **Type:** `boolean` **Default:** `false` When true, hides world and chunk coordinates regardless of the player's setting. ## horizontalKnockbackMultiplier **Type:** `number` **Default:** `1` Multiplier for horizontal knockback when dealing damage ## initialHealth **Type:** `number` **Default:** `100` Health upon joining or respawning. Can be null for the player to not have health ## initialShield **Type:** `number` **Default:** `0` Shield upon joining or respawning ## inventoryItemsMoveable **Type:** `boolean` **Default:** `true` Whether the player can move items in their inventory, only applicable if useInventory is true ## invincible **Type:** `boolean` **Default:** `false` Whether the player is invincible ## jumpAmount **Type:** `number` **Default:** `8` Amount of jump power the player has ## killstreakDuration **Type:** `number` **Default:** `200000000` Duration before a killstreak expires. (defaults to never expiring) ## lightingOverride **Type:** `boolean` **Default:** `null` When null, just use the player's graphics setting. When set, forces lighting on (true) or off (false). ## lobbyLeaderboardInfo **Type:** `LobbyLeaderboardInfo` **Default:** ```ts { name: { displayName: "Name", sortPriority: 0, }, } ``` Columns of the lobby leaderboard ## maxAuraLevel **Type:** `number` **Default:** `0` The maximum Aura Level attainable - Set to 0 to disable Aura XP ## maxHealth **Type:** `number` **Default:** `100` Maximum health the player can have ## maxPlayerZoom **Type:** `number` **Default:** `15` Maximum camera zoom level for the player ## maxShield **Type:** `number` **Default:** `100` Maximum shield the player can have ## middleTextLower **Type:** `string | CustomTextStyling` **Default:** `""` Small text to display in the middle of the screen ## middleTextUpper **Type:** `string | CustomTextStyling` **Default:** `""` Large text to display in the middle of the screen ## minChunkAddDist **Type:** `[number, number]` **Default:** `[2, 2]` Minimum size of region around player where chunks are loaded. Format [horizontalMinChunkRadius, verticalMinChunkRadius]. Each value should be between 2 and 4. We recommend leaving this at the default of [2, 2] unless you have a specific reason to change it. (e.g. you need players to see the bottom of a dropper) This is because higher values can be laggier on low-end devices. ## movementBasedFovScale **Type:** `number` **Default:** `1` Amount that player camera is affected by movement based fov ## music **Type:** `Song` **Default:** `null` The music track to play in the background ## musicVolumeLevel **Type:** `number` **Default:** `0.6` Volume level for the music ## numClosestPlayersVisible **Type:** `number` **Default:** `null` If set, clients will only be able to see the closest x players (good for client perf in games with many players) ## playerZoom **Type:** `number` **Default:** `0` Default camera zoom level for the player ## potionEffectDuration **Type:** `number` **Default:** `12000` Duration of potion effects ## proximityFadeDistance **Type:** `number` **Default:** `0.625` Distance in blocks over which we reduce the opacity of entities as they approach the camera. ## proximityFadeMinOpacity **Type:** `number` **Default:** `0.5` Minimum opacity multiplier reachable when fading entities based on camera proximity. The player's own model is always able to fade to 0, and entities being ridden stay fully opaque (as if this value was 1). ## receivingDamageMultiplier **Type:** `number` **Default:** `1` Damage multiplier for all types of incoming damage ## respawnButtonText **Type:** `string` **Default:** `"general:respawn"` Text to show on respawn button. (E.g. "Spectate") ## RightInfoText **Type:** `string | CustomTextStyling` **Default:** `""` Text to display in the right info box ## runningSpeed **Type:** `number` **Default:** `7` Running speed for the player. STRONGLY recommend using `speedMultiplier` unless you have a specific use case for this, runningSpeed doesn't make UX sense on mobile. (Walking speed is ignored for mobile players, mobile player speed is determined by joystick input and the max of runningSpeed & walkingSpeed). Players are used to the default bloxd movement behaviour and speed, and may be put off from your game if different muscle memory is required. We suggest applying speed or slowness effects instead, using api.applyEffect. The only use case for walkingSpeed/runningSpeed over speedMultiplier or speed effects is to disable running or to inverse walking/running (so you run by default and e.g. hold shift to go slower). ## secsToRespawn **Type:** `number` **Default:** `5` After dying the player can respawn after this many seconds ## showBasicMovementControls **Type:** `boolean` **Default:** `true` Whether to show basic movement controls ## showKillfeed **Type:** `boolean` **Default:** `true` Whether to show the killfeed ## showPlayersInUnloadedChunks **Type:** `boolean` **Default:** `false` Whether to show the player in unloaded chunks ## showProgressBar **Type:** `boolean` **Default:** `false` Whether to show the progress bar ## skyBox **Type:** `string | EarthSkyBox` **Default:** `"default"` Not recommended to use anything other than "default" as client FPS can drop while loading the skybox ## skyLightColourOverride **Type:** `string` **Default:** `null` Sky light colour override - hex string e.g. #ffffff. ## speedMultiplier **Type:** `number` **Default:** `1` Speed multiplier for the player. Players are used to the default bloxd movement behaviour and speed, and may be put off from your game if different muscle memory is required. We suggest applying speed or slowness effects instead, using api.applyEffect. ## splashPotionEffectDuration **Type:** `number` **Default:** `8000` Duration of splash potion effects ## stompDamageMultiplier **Type:** `number` **Default:** `0` Mult for the damage done by "stomping" on a lifeform, i.e.: falling on them wearing Spiked Boots. ## stompDamageRadius **Type:** `number` **Default:** `0` Radius around the player that will be affected by the stomp damage. ## strictFluidBuckets **Type:** `boolean` **Default:** `true` Whether a player can place fluid when canChange is false ## touchscreenActionButton **Type:** `string | CustomTextStyling` **Default:** `null` The contents of the action button. Supports custom text styling. onTouchscreenActionButton will be called when button pressed. ## ttbMultiplier **Type:** `number` **Default:** `1` Multiplier for the time to break any block ## useFullInventory **Type:** `boolean` **Default:** `true` For now just enables the UI of the full inventory ## useInventory **Type:** `boolean` **Default:** `true` Whether to allow the player to use the inventory Disabling this will also disable the hotbar ## usePlayAgainButton **Type:** `boolean` **Default:** `false` When player is dead, also show a play again button to matchmake player into a new lobby. Mostly useful for sessionBased games ## verticalKnockbackMultiplier **Type:** `number` **Default:** `1` Multiplier for vertical knockback when dealing damage ## walkingSpeed **Type:** `number` **Default:** `4` Walking speed for the player. STRONGLY recommend using `speedMultiplier` unless you have a specific use case for this, walkingSpeed doesn't make UX sense on mobile. (Walking speed ignored for mobile players, mobile player speed is determined by joystick input and the max of runningSpeed & walkingSpeed). Players are used to the default bloxd movement behaviour and speed, and may be put off from your game if different muscle memory is required. We suggest applying speed or slowness effects instead, using api.applyEffect. The only use case for walkingSpeed/runningSpeed over speedMultiplier or speed effects is to disable running or to inverse walking/running (so you run by default and e.g. hold shift to go slower). ## zoomOutDistance **Type:** `number` **Default:** `3` Distance to zoom the camera out to # Client Options A player's "Client Options" impact what they are capable of doing in the world. For example you can give them a double jump by setting the player's `airJumpCount` to `1`. Alternatively their health bar can be increased by setting their `maxHealth` to `200`. These API methods allow you to modify the client options: ```js /** * Modify a client option at runtime and send to the client if it changed * * @param {PlayerId} playerId * @param {PassedOption} option - The name of the option * @param {ClientOptions[PassedOption]} value - The new value of the option * @returns {void} */ setClientOption(playerId, option, value) /** * Returns the current value of a client option * * @param {PlayerId} playerId * @param {PassedOption} option * @returns {ClientOptions[PassedOption]} */ getClientOption(playerId, option) /** * Modify client options at runtime * * @param {PlayerId} playerId * @param {Partial} optionsObj - An object which contains key value pairs of new settings. E.g {canChange: true, speedMultiplier: false} * @returns {void} */ setClientOptions(playerId, optionsObj) /** * Sets a client option to its default value. This will be the value stored in your game's defaultClientOptions, otherwise Bloxd's default. * * @param {PlayerId} playerId * @param {ClientOption} option * @returns {void} */ setClientOptionToDefault(playerId, option) ``` Here is the full list of available client options: ## airAccScale **Type:** `number` **Default:** `1` Amount of acceleration to apply to airborne players. Only change if absolutely necessary i.e. Rocket Obby uses 0.25. Players are used to the default bloxd movement behaviour and speed, and may be put off from your game if different muscle memory is required. We suggest applying speed or slowness effects instead, using api.applyEffect. ## airFrictionScale **Type:** `number` **Default:** `1` Amount of friction to apply to airborne players. Only change if absolutely necessary i.e. Rocket Obby uses 0. Players are used to the default bloxd movement behaviour and speed, and may be put off from your game if different muscle memory is required. We suggest applying speed or slowness effects instead, using api.applyEffect. ## airJumpCount **Type:** `number` **Default:** `0` Amount of air jumps the player has ## airMomentumConservation **Type:** `boolean` **Default:** `false` Whether to allow the player to strafe and conserve momentum while airborne. Only change if absolutely necessary i.e. only Rocket Obby uses true. Players are used to the default bloxd movement behaviour and speed, and may be put off from your game if different muscle memory is required. We suggest applying speed or slowness effects instead, using api.applyEffect. ## arrowPotionEffectDuration **Type:** `number` **Default:** `6000` Duration of arrow potion effects ## auraPerLevel **Type:** `number` **Default:** `100` How much Aura XP is required per level. ## autoRespawn **Type:** `boolean` **Default:** `false` If true, player will respawn automatically after secsToRespawn seconds ## bounciness **Type:** `number` **Default:** `0` How much the player bounces off of solid blocks. A value of 1 is equivalent to every block acting as a mushroom. ## bunnyhopMaxMultiplier **Type:** `number` **Default:** `1.3` Maximum multiplier for jump height when bunnyhopping ## cameraRoll **Type:** `number` **Default:** `0` Roll angle of the camera in radians. Useful for disorientation effects, death effects, etc. ## cameraRollTransitionMs **Type:** `number` **Default:** `0` Duration in ms to animate/transition to the camera roll angle (when you change cameraRoll). 0 = instant. Useful for smooth camera roll transitions. ## cameraTint **Type:** `[number, number, number, number]` **Default:** `null` RGBA array [r, g, b, a] for camera screen tint effect. Values fall between 0 and 1. ## canAltAction **Type:** `boolean` **Default:** `true` Whether the player can use the alt action key (right click on PC) ## canChange **Type:** `boolean` **Default:** `true` Whether the player can change blocks ## canClimbWalls **Type:** `boolean` **Default:** `false` Whether the player can climb walls ## canCraft **Type:** `boolean` **Default:** `true` Whether to allow the player to craft items useFullInventory must be true for this to work ## canCrouch **Type:** `boolean` **Default:** `true` Whether the player can crouch ## canCustomiseChar **Type:** `boolean` **Default:** `true` Whether the player can customise their character ## canPickBlocks **Type:** `boolean` **Default:** `true` Whether the player can pick blocks (middle mouse click on PC), ignored if creative is false ## canPickUpItems **Type:** `boolean` **Default:** `true` Whether to allow the player to pick up items ## canSeeNametagsThroughWalls **Type:** `boolean` **Default:** `true` Whether the player can see name tags through walls ## cantBreakError **Type:** `string | CustomTextStyling` **Default:** `null` Error message for when the player fails to break a block ## cantBuildError **Type:** `string | CustomTextStyling` **Default:** `null` Error message for when the player fails to place a block ## cantChangeError **Type:** `string | CustomTextStyling` **Default:** `"You cannot modify this block"` Error message for when the player fails to change a block ## canUseZoomKey **Type:** `boolean` **Default:** `true` Whether the player can use the zoom key ## chatChannels **Type:** ` { channelName: string; elementContent: string | CustomTextStyling; elementBgColor: string; }[] ` **Default:** `null` Allows player to select a channel that is passed as argument to onPlayerChat. See engineGameplayTypes.ts for expected format ## compassTarget **Type:** `string | number | number[]` **Default:** `[0, 0, 0]` The target the compass will point towards ## creative **Type:** `boolean` **Default:** `false` Whether the player is in creative mode ## crosshairText **Type:** `string | CustomTextStyling` **Default:** `""` Text to display by the crosshair ## crouchingSpeed **Type:** `number` **Default:** `2` Speed multiplier for the player when crouching. Players are used to the default bloxd movement behaviour and speed, and may be put off from your game if different muscle memory is required. We suggest applying speed or slowness effects instead, using api.applyEffect. ## crouchMobDetectionRadiusMultiplier **Type:** `number` **Default:** `2` Mult for the radius within which mobs can detect the player when crouching. If a player's mult is 2, then mobs will think they are twice as far away. ## dealingDamageDefaultMultiplier **Type:** `number` **Default:** `1` Mult for when the player hits neither a leg or a head. Only applies to guns ## dealingDamageHeadMultiplier **Type:** `number` **Default:** `1.75` Damage multiplier for when the player hits a head. Only applies to guns ## dealingDamageLegMultiplier **Type:** `number` **Default:** `1` Damage multiplier for when the player hits a leg. Only applies to guns ## dealingDamageMultiplier **Type:** `number` **Default:** `1` Damage multiplier for all types of damage ## defaultBlock **Type:** `string` **Default:** `"Block of Gold"` The default block the player can change blocks to, used if canChange is true but useInventory is false ## droppedItemScale **Type:** `number` **Default:** `1` Scale factor to use for dropped item meshes ## effectDamageDuration **Type:** `number` **Default:** `8000` Duration of the +damage effect from plum ## effectDamageReductionDuration **Type:** `number` **Default:** `13000` Duration of +damage reduction effect from pear ## effectHealthRegenDuration **Type:** `number` **Default:** `5000` Duration of +health regen effect from cherry ## effectSpeedDuration **Type:** `number` **Default:** `8000` Duration of +speed effect from cracked coconut ## fallDamage **Type:** `boolean` **Default:** `false` Whether to deal damage to the player when they fall ## flySpeedMultiplier **Type:** `number` **Default:** `1.5` Multiplier for the flying speed in creative mode ## fogChunkDistanceOverride **Type:** `number` **Default:** `null` Fog distance which overrides graphic settings. Uses graphic settings if null. ## fogColourOverride **Type:** `string` **Default:** `null` RGB string for fog colour override. e.g. #ffffff ## forcedCameraDirection **Type:** `[number, number, number]` **Default:** `null` Force the camera to look in a specific direction [x, y, z]. Set to null to allow free camera movement. ## forcedCameraDirectionTransitionMs **Type:** `number` **Default:** `0` Duration in ms to animate/transition to the forced camera direction (when you change forcedCameraDirection). 0 = instant. Useful for smooth camera movements. ## groundFrictionScale **Type:** `number` **Default:** `1` Amount of friction to apply to grounded players. Only change if absolutely necessary i.e. Rocket Obby uses 3. Players are used to the default bloxd movement behaviour and speed, and may be put off from your game if different muscle memory is required. We suggest applying speed or slowness effects instead, using api.applyEffect. ## healthRegenAmount **Type:** `number` **Default:** `0.05` Fraction of max health that regens each regen tick ## healthRegenInterval **Type:** `number` **Default:** `4000` How often health regen is ticked ## healthRegenStartAfter **Type:** `number` **Default:** `5000` How long after a player receives damage to start regen again ## heldLightColourOverride **Type:** `string` **Default:** `null` Held item light colour override - hex colour string e.g. #ffffff. Applied regardless of any held item. ## hideCoordinates **Type:** `boolean` **Default:** `false` When true, hides world and chunk coordinates regardless of the player's setting. ## horizontalKnockbackMultiplier **Type:** `number` **Default:** `1` Multiplier for horizontal knockback when dealing damage ## initialHealth **Type:** `number` **Default:** `100` Health upon joining or respawning. Can be null for the player to not have health ## initialShield **Type:** `number` **Default:** `0` Shield upon joining or respawning ## inventoryItemsMoveable **Type:** `boolean` **Default:** `true` Whether the player can move items in their inventory, only applicable if useInventory is true ## invincible **Type:** `boolean` **Default:** `false` Whether the player is invincible ## jumpAmount **Type:** `number` **Default:** `8` Amount of jump power the player has ## killstreakDuration **Type:** `number` **Default:** `200000000` Duration before a killstreak expires. (defaults to never expiring) ## lightingOverride **Type:** `boolean` **Default:** `null` When null, just use the player's graphics setting. When set, forces lighting on (true) or off (false). ## lobbyLeaderboardInfo **Type:** `LobbyLeaderboardInfo` **Default:** ```ts { name: { displayName: "Name", sortPriority: 0, }, } ``` Columns of the lobby leaderboard ## maxAuraLevel **Type:** `number` **Default:** `0` The maximum Aura Level attainable - Set to 0 to disable Aura XP ## maxHealth **Type:** `number` **Default:** `100` Maximum health the player can have ## maxPlayerZoom **Type:** `number` **Default:** `15` Maximum camera zoom level for the player ## maxShield **Type:** `number` **Default:** `100` Maximum shield the player can have ## middleTextLower **Type:** `string | CustomTextStyling` **Default:** `""` Small text to display in the middle of the screen ## middleTextUpper **Type:** `string | CustomTextStyling` **Default:** `""` Large text to display in the middle of the screen ## minChunkAddDist **Type:** `[number, number]` **Default:** `[2, 2]` Minimum size of region around player where chunks are loaded. Format [horizontalMinChunkRadius, verticalMinChunkRadius]. Each value should be between 2 and 4. We recommend leaving this at the default of [2, 2] unless you have a specific reason to change it. (e.g. you need players to see the bottom of a dropper) This is because higher values can be laggier on low-end devices. ## movementBasedFovScale **Type:** `number` **Default:** `1` Amount that player camera is affected by movement based fov ## music **Type:** `Song` **Default:** `null` The music track to play in the background ## musicVolumeLevel **Type:** `number` **Default:** `0.6` Volume level for the music ## numClosestPlayersVisible **Type:** `number` **Default:** `null` If set, clients will only be able to see the closest x players (good for client perf in games with many players) ## playerZoom **Type:** `number` **Default:** `0` Default camera zoom level for the player ## potionEffectDuration **Type:** `number` **Default:** `12000` Duration of potion effects ## proximityFadeDistance **Type:** `number` **Default:** `0.625` Distance in blocks over which we reduce the opacity of entities as they approach the camera. ## proximityFadeMinOpacity **Type:** `number` **Default:** `0.5` Minimum opacity multiplier reachable when fading entities based on camera proximity. The player's own model is always able to fade to 0, and entities being ridden stay fully opaque (as if this value was 1). ## receivingDamageMultiplier **Type:** `number` **Default:** `1` Damage multiplier for all types of incoming damage ## respawnButtonText **Type:** `string` **Default:** `"general:respawn"` Text to show on respawn button. (E.g. "Spectate") ## RightInfoText **Type:** `string | CustomTextStyling` **Default:** `""` Text to display in the right info box ## runningSpeed **Type:** `number` **Default:** `7` Running speed for the player. STRONGLY recommend using `speedMultiplier` unless you have a specific use case for this, runningSpeed doesn't make UX sense on mobile. (Walking speed is ignored for mobile players, mobile player speed is determined by joystick input and the max of runningSpeed & walkingSpeed). Players are used to the default bloxd movement behaviour and speed, and may be put off from your game if different muscle memory is required. We suggest applying speed or slowness effects instead, using api.applyEffect. The only use case for walkingSpeed/runningSpeed over speedMultiplier or speed effects is to disable running or to inverse walking/running (so you run by default and e.g. hold shift to go slower). ## secsToRespawn **Type:** `number` **Default:** `5` After dying the player can respawn after this many seconds ## showBasicMovementControls **Type:** `boolean` **Default:** `true` Whether to show basic movement controls ## showKillfeed **Type:** `boolean` **Default:** `true` Whether to show the killfeed ## showPlayersInUnloadedChunks **Type:** `boolean` **Default:** `false` Whether to show the player in unloaded chunks ## showProgressBar **Type:** `boolean` **Default:** `false` Whether to show the progress bar ## skyBox **Type:** `string | EarthSkyBox` **Default:** `"default"` Not recommended to use anything other than "default" as client FPS can drop while loading the skybox ## skyLightColourOverride **Type:** `string` **Default:** `null` Sky light colour override - hex string e.g. #ffffff. ## speedMultiplier **Type:** `number` **Default:** `1` Speed multiplier for the player. Players are used to the default bloxd movement behaviour and speed, and may be put off from your game if different muscle memory is required. We suggest applying speed or slowness effects instead, using api.applyEffect. ## splashPotionEffectDuration **Type:** `number` **Default:** `8000` Duration of splash potion effects ## stompDamageMultiplier **Type:** `number` **Default:** `0` Mult for the damage done by "stomping" on a lifeform, i.e.: falling on them wearing Spiked Boots. ## stompDamageRadius **Type:** `number` **Default:** `0` Radius around the player that will be affected by the stomp damage. ## strictFluidBuckets **Type:** `boolean` **Default:** `true` Whether a player can place fluid when canChange is false ## touchscreenActionButton **Type:** `string | CustomTextStyling` **Default:** `null` The contents of the action button. Supports custom text styling. onTouchscreenActionButton will be called when button pressed. ## ttbMultiplier **Type:** `number` **Default:** `1` Multiplier for the time to break any block ## useFullInventory **Type:** `boolean` **Default:** `true` For now just enables the UI of the full inventory ## useInventory **Type:** `boolean` **Default:** `true` Whether to allow the player to use the inventory Disabling this will also disable the hotbar ## usePlayAgainButton **Type:** `boolean` **Default:** `false` When player is dead, also show a play again button to matchmake player into a new lobby. Mostly useful for sessionBased games ## verticalKnockbackMultiplier **Type:** `number` **Default:** `1` Multiplier for vertical knockback when dealing damage ## walkingSpeed **Type:** `number` **Default:** `4` Walking speed for the player. STRONGLY recommend using `speedMultiplier` unless you have a specific use case for this, walkingSpeed doesn't make UX sense on mobile. (Walking speed ignored for mobile players, mobile player speed is determined by joystick input and the max of runningSpeed & walkingSpeed). Players are used to the default bloxd movement behaviour and speed, and may be put off from your game if different muscle memory is required. We suggest applying speed or slowness effects instead, using api.applyEffect. The only use case for walkingSpeed/runningSpeed over speedMultiplier or speed effects is to disable running or to inverse walking/running (so you run by default and e.g. hold shift to go slower). ## zoomOutDistance **Type:** `number` **Default:** `3` Distance to zoom the camera out to # Client Options A player's "Client Options" impact what they are capable of doing in the world. For example you can give them a double jump by setting the player's `airJumpCount` to `1`. Alternatively their health bar can be increased by setting their `maxHealth` to `200`. These API methods allow you to modify the client options: ```js /** * Modify a client option at runtime and send to the client if it changed * * @param {PlayerId} playerId * @param {PassedOption} option - The name of the option * @param {ClientOptions[PassedOption]} value - The new value of the option * @returns {void} */ setClientOption(playerId, option, value) /** * Returns the current value of a client option * * @param {PlayerId} playerId * @param {PassedOption} option * @returns {ClientOptions[PassedOption]} */ getClientOption(playerId, option) /** * Modify client options at runtime * * @param {PlayerId} playerId * @param {Partial} optionsObj - An object which contains key value pairs of new settings. E.g {canChange: true, speedMultiplier: false} * @returns {void} */ setClientOptions(playerId, optionsObj) /** * Sets a client option to its default value. This will be the value stored in your game's defaultClientOptions, otherwise Bloxd's default. * * @param {PlayerId} playerId * @param {ClientOption} option * @returns {void} */ setClientOptionToDefault(playerId, option) ``` Here is the full list of available client options: ## airAccScale **Type:** `number` **Default:** `1` Amount of acceleration to apply to airborne players. Only change if absolutely necessary i.e. Rocket Obby uses 0.25. Players are used to the default bloxd movement behaviour and speed, and may be put off from your game if different muscle memory is required. We suggest applying speed or slowness effects instead, using api.applyEffect. ## airFrictionScale **Type:** `number` **Default:** `1` Amount of friction to apply to airborne players. Only change if absolutely necessary i.e. Rocket Obby uses 0. Players are used to the default bloxd movement behaviour and speed, and may be put off from your game if different muscle memory is required. We suggest applying speed or slowness effects instead, using api.applyEffect. ## airJumpCount **Type:** `number` **Default:** `0` Amount of air jumps the player has ## airMomentumConservation **Type:** `boolean` **Default:** `false` Whether to allow the player to strafe and conserve momentum while airborne. Only change if absolutely necessary i.e. only Rocket Obby uses true. Players are used to the default bloxd movement behaviour and speed, and may be put off from your game if different muscle memory is required. We suggest applying speed or slowness effects instead, using api.applyEffect. ## arrowPotionEffectDuration **Type:** `number` **Default:** `6000` Duration of arrow potion effects ## auraPerLevel **Type:** `number` **Default:** `100` How much Aura XP is required per level. ## autoRespawn **Type:** `boolean` **Default:** `false` If true, player will respawn automatically after secsToRespawn seconds ## bounciness **Type:** `number` **Default:** `0` How much the player bounces off of solid blocks. A value of 1 is equivalent to every block acting as a mushroom. ## bunnyhopMaxMultiplier **Type:** `number` **Default:** `1.3` Maximum multiplier for jump height when bunnyhopping ## cameraRoll **Type:** `number` **Default:** `0` Roll angle of the camera in radians. Useful for disorientation effects, death effects, etc. ## cameraRollTransitionMs **Type:** `number` **Default:** `0` Duration in ms to animate/transition to the camera roll angle (when you change cameraRoll). 0 = instant. Useful for smooth camera roll transitions. ## cameraTint **Type:** `[number, number, number, number]` **Default:** `null` RGBA array [r, g, b, a] for camera screen tint effect. Values fall between 0 and 1. ## canAltAction **Type:** `boolean` **Default:** `true` Whether the player can use the alt action key (right click on PC) ## canChange **Type:** `boolean` **Default:** `true` Whether the player can change blocks ## canClimbWalls **Type:** `boolean` **Default:** `false` Whether the player can climb walls ## canCraft **Type:** `boolean` **Default:** `true` Whether to allow the player to craft items useFullInventory must be true for this to work ## canCrouch **Type:** `boolean` **Default:** `true` Whether the player can crouch ## canCustomiseChar **Type:** `boolean` **Default:** `true` Whether the player can customise their character ## canPickBlocks **Type:** `boolean` **Default:** `true` Whether the player can pick blocks (middle mouse click on PC), ignored if creative is false ## canPickUpItems **Type:** `boolean` **Default:** `true` Whether to allow the player to pick up items ## canSeeNametagsThroughWalls **Type:** `boolean` **Default:** `true` Whether the player can see name tags through walls ## cantBreakError **Type:** `string | CustomTextStyling` **Default:** `null` Error message for when the player fails to break a block ## cantBuildError **Type:** `string | CustomTextStyling` **Default:** `null` Error message for when the player fails to place a block ## cantChangeError **Type:** `string | CustomTextStyling` **Default:** `"You cannot modify this block"` Error message for when the player fails to change a block ## canUseZoomKey **Type:** `boolean` **Default:** `true` Whether the player can use the zoom key ## chatChannels **Type:** ` { channelName: string; elementContent: string | CustomTextStyling; elementBgColor: string; }[] ` **Default:** `null` Allows player to select a channel that is passed as argument to onPlayerChat. See engineGameplayTypes.ts for expected format ## compassTarget **Type:** `string | number | number[]` **Default:** `[0, 0, 0]` The target the compass will point towards ## creative **Type:** `boolean` **Default:** `false` Whether the player is in creative mode ## crosshairText **Type:** `string | CustomTextStyling` **Default:** `""` Text to display by the crosshair ## crouchingSpeed **Type:** `number` **Default:** `2` Speed multiplier for the player when crouching. Players are used to the default bloxd movement behaviour and speed, and may be put off from your game if different muscle memory is required. We suggest applying speed or slowness effects instead, using api.applyEffect. ## crouchMobDetectionRadiusMultiplier **Type:** `number` **Default:** `2` Mult for the radius within which mobs can detect the player when crouching. If a player's mult is 2, then mobs will think they are twice as far away. ## dealingDamageDefaultMultiplier **Type:** `number` **Default:** `1` Mult for when the player hits neither a leg or a head. Only applies to guns ## dealingDamageHeadMultiplier **Type:** `number` **Default:** `1.75` Damage multiplier for when the player hits a head. Only applies to guns ## dealingDamageLegMultiplier **Type:** `number` **Default:** `1` Damage multiplier for when the player hits a leg. Only applies to guns ## dealingDamageMultiplier **Type:** `number` **Default:** `1` Damage multiplier for all types of damage ## defaultBlock **Type:** `string` **Default:** `"Block of Gold"` The default block the player can change blocks to, used if canChange is true but useInventory is false ## droppedItemScale **Type:** `number` **Default:** `1` Scale factor to use for dropped item meshes ## effectDamageDuration **Type:** `number` **Default:** `8000` Duration of the +damage effect from plum ## effectDamageReductionDuration **Type:** `number` **Default:** `13000` Duration of +damage reduction effect from pear ## effectHealthRegenDuration **Type:** `number` **Default:** `5000` Duration of +health regen effect from cherry ## effectSpeedDuration **Type:** `number` **Default:** `8000` Duration of +speed effect from cracked coconut ## fallDamage **Type:** `boolean` **Default:** `false` Whether to deal damage to the player when they fall ## flySpeedMultiplier **Type:** `number` **Default:** `1.5` Multiplier for the flying speed in creative mode ## fogChunkDistanceOverride **Type:** `number` **Default:** `null` Fog distance which overrides graphic settings. Uses graphic settings if null. ## fogColourOverride **Type:** `string` **Default:** `null` RGB string for fog colour override. e.g. #ffffff ## forcedCameraDirection **Type:** `[number, number, number]` **Default:** `null` Force the camera to look in a specific direction [x, y, z]. Set to null to allow free camera movement. ## forcedCameraDirectionTransitionMs **Type:** `number` **Default:** `0` Duration in ms to animate/transition to the forced camera direction (when you change forcedCameraDirection). 0 = instant. Useful for smooth camera movements. ## groundFrictionScale **Type:** `number` **Default:** `1` Amount of friction to apply to grounded players. Only change if absolutely necessary i.e. Rocket Obby uses 3. Players are used to the default bloxd movement behaviour and speed, and may be put off from your game if different muscle memory is required. We suggest applying speed or slowness effects instead, using api.applyEffect. ## healthRegenAmount **Type:** `number` **Default:** `0.05` Fraction of max health that regens each regen tick ## healthRegenInterval **Type:** `number` **Default:** `4000` How often health regen is ticked ## healthRegenStartAfter **Type:** `number` **Default:** `5000` How long after a player receives damage to start regen again ## heldLightColourOverride **Type:** `string` **Default:** `null` Held item light colour override - hex colour string e.g. #ffffff. Applied regardless of any held item. ## hideCoordinates **Type:** `boolean` **Default:** `false` When true, hides world and chunk coordinates regardless of the player's setting. ## horizontalKnockbackMultiplier **Type:** `number` **Default:** `1` Multiplier for horizontal knockback when dealing damage ## initialHealth **Type:** `number` **Default:** `100` Health upon joining or respawning. Can be null for the player to not have health ## initialShield **Type:** `number` **Default:** `0` Shield upon joining or respawning ## inventoryItemsMoveable **Type:** `boolean` **Default:** `true` Whether the player can move items in their inventory, only applicable if useInventory is true ## invincible **Type:** `boolean` **Default:** `false` Whether the player is invincible ## jumpAmount **Type:** `number` **Default:** `8` Amount of jump power the player has ## killstreakDuration **Type:** `number` **Default:** `200000000` Duration before a killstreak expires. (defaults to never expiring) ## lightingOverride **Type:** `boolean` **Default:** `null` When null, just use the player's graphics setting. When set, forces lighting on (true) or off (false). ## lobbyLeaderboardInfo **Type:** `LobbyLeaderboardInfo` **Default:** ```ts { name: { displayName: "Name", sortPriority: 0, }, } ``` Columns of the lobby leaderboard ## maxAuraLevel **Type:** `number` **Default:** `0` The maximum Aura Level attainable - Set to 0 to disable Aura XP ## maxHealth **Type:** `number` **Default:** `100` Maximum health the player can have ## maxPlayerZoom **Type:** `number` **Default:** `15` Maximum camera zoom level for the player ## maxShield **Type:** `number` **Default:** `100` Maximum shield the player can have ## middleTextLower **Type:** `string | CustomTextStyling` **Default:** `""` Small text to display in the middle of the screen ## middleTextUpper **Type:** `string | CustomTextStyling` **Default:** `""` Large text to display in the middle of the screen ## minChunkAddDist **Type:** `[number, number]` **Default:** `[2, 2]` Minimum size of region around player where chunks are loaded. Format [horizontalMinChunkRadius, verticalMinChunkRadius]. Each value should be between 2 and 4. We recommend leaving this at the default of [2, 2] unless you have a specific reason to change it. (e.g. you need players to see the bottom of a dropper) This is because higher values can be laggier on low-end devices. ## movementBasedFovScale **Type:** `number` **Default:** `1` Amount that player camera is affected by movement based fov ## music **Type:** `Song` **Default:** `null` The music track to play in the background ## musicVolumeLevel **Type:** `number` **Default:** `0.6` Volume level for the music ## numClosestPlayersVisible **Type:** `number` **Default:** `null` If set, clients will only be able to see the closest x players (good for client perf in games with many players) ## playerZoom **Type:** `number` **Default:** `0` Default camera zoom level for the player ## potionEffectDuration **Type:** `number` **Default:** `12000` Duration of potion effects ## proximityFadeDistance **Type:** `number` **Default:** `0.625` Distance in blocks over which we reduce the opacity of entities as they approach the camera. ## proximityFadeMinOpacity **Type:** `number` **Default:** `0.5` Minimum opacity multiplier reachable when fading entities based on camera proximity. The player's own model is always able to fade to 0, and entities being ridden stay fully opaque (as if this value was 1). ## receivingDamageMultiplier **Type:** `number` **Default:** `1` Damage multiplier for all types of incoming damage ## respawnButtonText **Type:** `string` **Default:** `"general:respawn"` Text to show on respawn button. (E.g. "Spectate") ## RightInfoText **Type:** `string | CustomTextStyling` **Default:** `""` Text to display in the right info box ## runningSpeed **Type:** `number` **Default:** `7` Running speed for the player. STRONGLY recommend using `speedMultiplier` unless you have a specific use case for this, runningSpeed doesn't make UX sense on mobile. (Walking speed is ignored for mobile players, mobile player speed is determined by joystick input and the max of runningSpeed & walkingSpeed). Players are used to the default bloxd movement behaviour and speed, and may be put off from your game if different muscle memory is required. We suggest applying speed or slowness effects instead, using api.applyEffect. The only use case for walkingSpeed/runningSpeed over speedMultiplier or speed effects is to disable running or to inverse walking/running (so you run by default and e.g. hold shift to go slower). ## secsToRespawn **Type:** `number` **Default:** `5` After dying the player can respawn after this many seconds ## showBasicMovementControls **Type:** `boolean` **Default:** `true` Whether to show basic movement controls ## showKillfeed **Type:** `boolean` **Default:** `true` Whether to show the killfeed ## showPlayersInUnloadedChunks **Type:** `boolean` **Default:** `false` Whether to show the player in unloaded chunks ## showProgressBar **Type:** `boolean` **Default:** `false` Whether to show the progress bar ## skyBox **Type:** `string | EarthSkyBox` **Default:** `"default"` Not recommended to use anything other than "default" as client FPS can drop while loading the skybox ## skyLightColourOverride **Type:** `string` **Default:** `null` Sky light colour override - hex string e.g. #ffffff. ## speedMultiplier **Type:** `number` **Default:** `1` Speed multiplier for the player. Players are used to the default bloxd movement behaviour and speed, and may be put off from your game if different muscle memory is required. We suggest applying speed or slowness effects instead, using api.applyEffect. ## splashPotionEffectDuration **Type:** `number` **Default:** `8000` Duration of splash potion effects ## stompDamageMultiplier **Type:** `number` **Default:** `0` Mult for the damage done by "stomping" on a lifeform, i.e.: falling on them wearing Spiked Boots. ## stompDamageRadius **Type:** `number` **Default:** `0` Radius around the player that will be affected by the stomp damage. ## strictFluidBuckets **Type:** `boolean` **Default:** `true` Whether a player can place fluid when canChange is false ## touchscreenActionButton **Type:** `string | CustomTextStyling` **Default:** `null` The contents of the action button. Supports custom text styling. onTouchscreenActionButton will be called when button pressed. ## ttbMultiplier **Type:** `number` **Default:** `1` Multiplier for the time to break any block ## useFullInventory **Type:** `boolean` **Default:** `true` For now just enables the UI of the full inventory ## useInventory **Type:** `boolean` **Default:** `true` Whether to allow the player to use the inventory Disabling this will also disable the hotbar ## usePlayAgainButton **Type:** `boolean` **Default:** `false` When player is dead, also show a play again button to matchmake player into a new lobby. Mostly useful for sessionBased games ## verticalKnockbackMultiplier **Type:** `number` **Default:** `1` Multiplier for vertical knockback when dealing damage ## walkingSpeed **Type:** `number` **Default:** `4` Walking speed for the player. STRONGLY recommend using `speedMultiplier` unless you have a specific use case for this, walkingSpeed doesn't make UX sense on mobile. (Walking speed ignored for mobile players, mobile player speed is determined by joystick input and the max of runningSpeed & walkingSpeed). Players are used to the default bloxd movement behaviour and speed, and may be put off from your game if different muscle memory is required. We suggest applying speed or slowness effects instead, using api.applyEffect. The only use case for walkingSpeed/runningSpeed over speedMultiplier or speed effects is to disable running or to inverse walking/running (so you run by default and e.g. hold shift to go slower). ## zoomOutDistance **Type:** `number` **Default:** `3` Distance to zoom the camera out to # Entity Settings An "Entity Setting" impacts how a player sees or interacts with another player or entity. E.g. Player 1 could have an otherEntitySetting for entity 2 as opacity set to 0.5. This means player 1 sees entity 2 as partly see-through. Player1 is the relevant player, player2 is the targeted player. These API methods allow you to modify entity settings: ```js /** * Set every player's other-entity setting to a specific value for a particular player. * includeNewJoiners=true means that new players joining the game will also have this other player setting applied. * * @param {PlayerId} targetedPlayerId * @param {Setting} settingName * @param {OtherEntitySettings[Setting]} settingValue * @param {boolean} [includeNewJoiners] * @returns {void} */ setTargetedPlayerSettingForEveryone(targetedPlayerId, settingName, settingValue, includeNewJoiners) /** * Set a player's other-entity setting for every lifeform in the game. * includeNewJoiners=true means that the player will have the setting applied to new joiners. * * @param {PlayerId} playerId * @param {Setting} settingName * @param {OtherEntitySettings[Setting]} settingValue * @param {boolean} [includeNewJoiners] * @returns {void} */ setEveryoneSettingForPlayer(playerId, settingName, settingValue, includeNewJoiners) /** * Set a player's other-entity setting for a specific entity. * * @param {PlayerId} relevantPlayerId * @param {EntityId} targetedEntityId * @param {Setting} settingName * @param {OtherEntitySettings[Setting]} settingValue * @returns {void} */ setOtherEntitySetting(relevantPlayerId, targetedEntityId, settingName, settingValue) /** * Set many of a player's other-entity settings for a specific entity. * * @param {PlayerId} relevantPlayerId * @param {EntityId} targetedEntityId * @param {Partial} settingsObject * @returns {void} */ setOtherEntitySettings(relevantPlayerId, targetedEntityId, settingsObject) /** * Get the value of a player's other-entity setting for a specific entity. * * @param {PlayerId} relevantPlayerId * @param {EntityId} targetedEntityId * @param {Setting} settingName * @returns {OtherEntitySettings[Setting]} */ getOtherEntitySetting(relevantPlayerId, targetedEntityId, settingName) ``` Here is the full list of available entity settings: ## canAttack **Type:** `boolean` **Default:** `false` Whether the entity can attack other entities, ignored if the targeted entity is invincible ## canSee **Type:** `boolean` **Default:** `true` Whether the entity can be seen by the relevant player ## colorInLobbyLeaderboard **Type:** `string` **Default:** `""` The colour of the player in the lobby leaderboard. ## hasPriorityNametag **Type:** `boolean` **Default:** `false` Whether the player has a priority name tag ## killfeedColour **Type:** `string` **Default:** `""` The colour of kills in the killfeed. Defaults to blue for themselves and red for everyone else. ## lobbyLeaderboardValues **Type:** `LobbyLeaderboardValues` **Default:** `{}` The values of the leaderboard. ## meshScaling **Type:** `EntityMeshScalingMap` **Default:** `{}` Scaling of mesh nodes, see api.scalePlayerMeshNodes ## nameColour **Type:** `"default" | "yellow" | "lime" | "green" | "aqua" | "cyan" | "blue" | "purple" | "pink" | "red" | "orange"` **Default:** `"default"` The colour of the entity's name. ## nameTagInfo **Type:** `NameTagInfo` **Default:** `null` The name tag info of the player: { backgroundColor?: string content?: StyledText[] subtitle?: StyledText[] subtitleBackgroundColor?: string } ## opacity **Type:** `number` **Default:** `1` Opacity of the entity Fractional values will use dithering 0 opacity will hide the entity but not its name tag ## overlayColour **Type:** `string` **Default:** `null` Applies a colour tint to the entity when set, like the red tint when an entity gets hurt. ## showDamageAmounts **Type:** `boolean` **Default:** `true` Whether you can see damage amounts when shooting the entity ## zIndex **Type:** `0 | 1` **Default:** `0` Rendering order of the entity, higher zIndex renders on top of lower ones. # Entity Settings An "Entity Setting" impacts how a player sees or interacts with another player or entity. E.g. Player 1 could have an otherEntitySetting for entity 2 as opacity set to 0.5. This means player 1 sees entity 2 as partly see-through. Player1 is the relevant player, player2 is the targeted player. These API methods allow you to modify entity settings: ```js /** * Set every player's other-entity setting to a specific value for a particular player. * includeNewJoiners=true means that new players joining the game will also have this other player setting applied. * * @param {PlayerId} targetedPlayerId * @param {Setting} settingName * @param {OtherEntitySettings[Setting]} settingValue * @param {boolean} [includeNewJoiners] * @returns {void} */ setTargetedPlayerSettingForEveryone(targetedPlayerId, settingName, settingValue, includeNewJoiners) /** * Set a player's other-entity setting for every lifeform in the game. * includeNewJoiners=true means that the player will have the setting applied to new joiners. * * @param {PlayerId} playerId * @param {Setting} settingName * @param {OtherEntitySettings[Setting]} settingValue * @param {boolean} [includeNewJoiners] * @returns {void} */ setEveryoneSettingForPlayer(playerId, settingName, settingValue, includeNewJoiners) /** * Set a player's other-entity setting for a specific entity. * * @param {PlayerId} relevantPlayerId * @param {EntityId} targetedEntityId * @param {Setting} settingName * @param {OtherEntitySettings[Setting]} settingValue * @returns {void} */ setOtherEntitySetting(relevantPlayerId, targetedEntityId, settingName, settingValue) /** * Set many of a player's other-entity settings for a specific entity. * * @param {PlayerId} relevantPlayerId * @param {EntityId} targetedEntityId * @param {Partial} settingsObject * @returns {void} */ setOtherEntitySettings(relevantPlayerId, targetedEntityId, settingsObject) /** * Get the value of a player's other-entity setting for a specific entity. * * @param {PlayerId} relevantPlayerId * @param {EntityId} targetedEntityId * @param {Setting} settingName * @returns {OtherEntitySettings[Setting]} */ getOtherEntitySetting(relevantPlayerId, targetedEntityId, settingName) ``` Here is the full list of available entity settings: ## canAttack **Type:** `boolean` **Default:** `false` Whether the entity can attack other entities, ignored if the targeted entity is invincible ## canSee **Type:** `boolean` **Default:** `true` Whether the entity can be seen by the relevant player ## colorInLobbyLeaderboard **Type:** `string` **Default:** `""` The colour of the player in the lobby leaderboard. ## hasPriorityNametag **Type:** `boolean` **Default:** `false` Whether the player has a priority name tag ## killfeedColour **Type:** `string` **Default:** `""` The colour of kills in the killfeed. Defaults to blue for themselves and red for everyone else. ## lobbyLeaderboardValues **Type:** `LobbyLeaderboardValues` **Default:** `{}` The values of the leaderboard. ## meshScaling **Type:** `EntityMeshScalingMap` **Default:** `{}` Scaling of mesh nodes, see api.scalePlayerMeshNodes ## nameColour **Type:** `"default" | "yellow" | "lime" | "green" | "aqua" | "cyan" | "blue" | "purple" | "pink" | "red" | "orange"` **Default:** `"default"` The colour of the entity's name. ## nameTagInfo **Type:** `NameTagInfo` **Default:** `null` The name tag info of the player: { backgroundColor?: string content?: StyledText[] subtitle?: StyledText[] subtitleBackgroundColor?: string } ## opacity **Type:** `number` **Default:** `1` Opacity of the entity Fractional values will use dithering 0 opacity will hide the entity but not its name tag ## overlayColour **Type:** `string` **Default:** `null` Applies a colour tint to the entity when set, like the red tint when an entity gets hurt. ## showDamageAmounts **Type:** `boolean` **Default:** `true` Whether you can see damage amounts when shooting the entity ## zIndex **Type:** `0 | 1` **Default:** `0` Rendering order of the entity, higher zIndex renders on top of lower ones. # Entity Settings An "Entity Setting" impacts how a player sees or interacts with another player or entity. E.g. Player 1 could have an otherEntitySetting for entity 2 as opacity set to 0.5. This means player 1 sees entity 2 as partly see-through. Player1 is the relevant player, player2 is the targeted player. These API methods allow you to modify entity settings: ```js /** * Set every player's other-entity setting to a specific value for a particular player. * includeNewJoiners=true means that new players joining the game will also have this other player setting applied. * * @param {PlayerId} targetedPlayerId * @param {Setting} settingName * @param {OtherEntitySettings[Setting]} settingValue * @param {boolean} [includeNewJoiners] * @returns {void} */ setTargetedPlayerSettingForEveryone(targetedPlayerId, settingName, settingValue, includeNewJoiners) /** * Set a player's other-entity setting for every lifeform in the game. * includeNewJoiners=true means that the player will have the setting applied to new joiners. * * @param {PlayerId} playerId * @param {Setting} settingName * @param {OtherEntitySettings[Setting]} settingValue * @param {boolean} [includeNewJoiners] * @returns {void} */ setEveryoneSettingForPlayer(playerId, settingName, settingValue, includeNewJoiners) /** * Set a player's other-entity setting for a specific entity. * * @param {PlayerId} relevantPlayerId * @param {EntityId} targetedEntityId * @param {Setting} settingName * @param {OtherEntitySettings[Setting]} settingValue * @returns {void} */ setOtherEntitySetting(relevantPlayerId, targetedEntityId, settingName, settingValue) /** * Set many of a player's other-entity settings for a specific entity. * * @param {PlayerId} relevantPlayerId * @param {EntityId} targetedEntityId * @param {Partial} settingsObject * @returns {void} */ setOtherEntitySettings(relevantPlayerId, targetedEntityId, settingsObject) /** * Get the value of a player's other-entity setting for a specific entity. * * @param {PlayerId} relevantPlayerId * @param {EntityId} targetedEntityId * @param {Setting} settingName * @returns {OtherEntitySettings[Setting]} */ getOtherEntitySetting(relevantPlayerId, targetedEntityId, settingName) ``` Here is the full list of available entity settings: ## canAttack **Type:** `boolean` **Default:** `false` Whether the entity can attack other entities, ignored if the targeted entity is invincible ## canSee **Type:** `boolean` **Default:** `true` Whether the entity can be seen by the relevant player ## colorInLobbyLeaderboard **Type:** `string` **Default:** `""` The colour of the player in the lobby leaderboard. ## hasPriorityNametag **Type:** `boolean` **Default:** `false` Whether the player has a priority name tag ## killfeedColour **Type:** `string` **Default:** `""` The colour of kills in the killfeed. Defaults to blue for themselves and red for everyone else. ## lobbyLeaderboardValues **Type:** `LobbyLeaderboardValues` **Default:** `{}` The values of the leaderboard. ## meshScaling **Type:** `EntityMeshScalingMap` **Default:** `{}` Scaling of mesh nodes, see api.scalePlayerMeshNodes ## nameColour **Type:** `"default" | "yellow" | "lime" | "green" | "aqua" | "cyan" | "blue" | "purple" | "pink" | "red" | "orange"` **Default:** `"default"` The colour of the entity's name. ## nameTagInfo **Type:** `NameTagInfo` **Default:** `null` The name tag info of the player: { backgroundColor?: string content?: StyledText[] subtitle?: StyledText[] subtitleBackgroundColor?: string } ## opacity **Type:** `number` **Default:** `1` Opacity of the entity Fractional values will use dithering 0 opacity will hide the entity but not its name tag ## overlayColour **Type:** `string` **Default:** `null` Applies a colour tint to the entity when set, like the red tint when an entity gets hurt. ## showDamageAmounts **Type:** `boolean` **Default:** `true` Whether you can see damage amounts when shooting the entity ## zIndex **Type:** `0 | 1` **Default:** `0` Rendering order of the entity, higher zIndex renders on top of lower ones. # Icons Icons can be used in `CustomTextStyling` arrays with the `StyledIcon` type: ```js api.sendMessage(playerId, [{ icon: "fa-solid fa-heart" }, " You gained a life!"]) api.sendMessage(playerId, [{ icon: "fa-solid fa-star", style: { color: "gold" } }, " Achievement!"]) ``` > **Prefer Bloxd-native icons:** For the best visual consistency with Bloxd's theme, use **item names** (see ITEM_NAMES.txt), **block names** (see BLOCK_NAMES.txt), or **ingame icons** (below) wherever possible. These are designed specifically for Bloxd and will look more cohesive. Only fall back to Font Awesome icons when no Bloxd-native option fits your use case. ## Ingame Icons (89 icons) See the `IngameIconName` type in the Glossary. ``` Damage Damage Reduction Speed VoidJump Fist Frozen Hydrated Invisible Jump Boost Poisoned Slowness Weakness Health Regen Haste Double Jump Heat Resistance Gliding Boating Obsidian Boating Riding Bunny Hop FallDamage Feather Falling Thief X-Ray Vision Mining Yield Brain Rot Rested Damage Rested Haste Rested Speed Rested Farming Yield Rested Aura Blindness Pickpocketer Lifesteal Bounciness Air Walk Wall Climbing Thorns Poopy Draugr Knight Head Draugr Warper Head Magma Golem Head Mystery Fish Damage Enchantment Critical Damage Enchantment Attack Speed Enchantment Protection Enchantment Health Enchantment Health Regen Enchantment Stomp Damage Enchantment Knockback Resist Enchantment Arrow Speed Enchantment Arrow Damage Enchantment Quick Charge Enchantment Break Speed Enchantment Momentum Enchantment Mining Yield Enchantment Farming Yield Enchantment Mining Aura Enchantment Digging Aura Enchantment Lumber Aura Enchantment Farming Aura Enchantment Vertical Knockback Enchantment Horizontal Knockback Enchantment Self Yield Friends Riding Speed Feed Aura Double Poop Mob Slayer Rainbow Wool Pack Leader Max Health Poison Claws Mob Yield Antlers Bonus Health HealthShield Cross Friendship Dotted Friendship Hunger Empty Hunger Pixelated Heart Question Mark Trader Black Trader Blue Trader Piggy ``` --- ## Font Awesome Icons (171 icons) Use with `fa-solid`, `fa-regular`, or `fa-duotone` prefix. Only use these when no Bloxd-native icon fits. ``` fa-solid fa-add fa-solid fa-angle-double-up fa-solid fa-angle-down fa-solid fa-angle-up fa-solid fa-angles-up fa-solid fa-arrow-up fa-solid fa-arrow-up-right-from-square fa-solid fa-arrows fa-solid fa-arrows-h fa-solid fa-arrows-left-right fa-solid fa-arrows-rotate fa-solid fa-arrows-up-down-left-right fa-solid fa-award fa-solid fa-backpack fa-solid fa-bars fa-solid fa-block-question fa-solid fa-bolt fa-solid fa-boot fa-solid fa-caret-up fa-solid fa-cart-shopping fa-solid fa-check fa-solid fa-chess-rook fa-solid fa-circle-info fa-solid fa-circle-plus fa-solid fa-clock-rotate-left fa-solid fa-cog fa-solid fa-coins fa-solid fa-comment-dots fa-solid fa-commenting fa-solid fa-compress fa-solid fa-computer-mouse fa-solid fa-cookie fa-solid fa-copy fa-solid fa-crosshairs fa-solid fa-crown fa-solid fa-cube fa-solid fa-cubes fa-solid fa-cut fa-solid fa-dice fa-solid fa-dizzy fa-solid fa-door-closed fa-solid fa-door-open fa-solid fa-download fa-solid fa-edit fa-solid fa-ellipsis fa-solid fa-ellipsis-h fa-solid fa-exclamation fa-solid fa-expand fa-solid fa-external-link fa-solid fa-eye fa-solid fa-eye-slash fa-solid fa-face-diagonal-mouth fa-solid fa-face-dizzy fa-solid fa-face-raised-eyebrow fa-solid fa-face-smile fa-solid fa-face-worried fa-solid fa-feather-alt fa-solid fa-feather-pointed fa-solid fa-file-alt fa-solid fa-file-clipboard fa-solid fa-file-lines fa-solid fa-file-text fa-solid fa-film fa-solid fa-fire fa-solid fa-fist-raised fa-solid fa-flag fa-solid fa-folder-image fa-solid fa-gauge-high fa-solid fa-gear fa-solid fa-gem fa-solid fa-globe fa-solid fa-hammer fa-solid fa-hand-back-point-up fa-solid fa-hand-fist fa-solid fa-hand-holding-medical fa-solid fa-hand-point-left fa-solid fa-hat-santa fa-solid fa-hat-witch fa-solid fa-heart fa-solid fa-heart-music-camera-bolt fa-solid fa-history fa-solid fa-hourglass-clock fa-solid fa-icons fa-solid fa-image fa-solid fa-info-circle fa-solid fa-joystick fa-solid fa-layer-group fa-solid fa-lightbulb fa-solid fa-list fa-solid fa-list-squares fa-solid fa-location-check fa-solid fa-location-xmark fa-solid fa-lock fa-solid fa-lock-open fa-solid fa-magnifying-glass fa-solid fa-male fa-solid fa-map-marker-check fa-solid fa-map-marker-times fa-solid fa-map-marker-xmark fa-solid fa-minus-square fa-solid fa-mouse fa-solid fa-music fa-solid fa-navicon fa-solid fa-palette fa-solid fa-paste fa-solid fa-pen fa-solid fa-pen-field fa-solid fa-pen-to-square fa-solid fa-person fa-solid fa-person-arrow-down-to-line fa-solid fa-person-arrow-up-from-line fa-solid fa-person-falling-burst fa-solid fa-person-military-pointing fa-solid fa-planet-ringed fa-solid fa-plus fa-solid fa-plus-circle fa-solid fa-power-off fa-solid fa-recycle fa-solid fa-redo-alt fa-solid fa-refresh fa-solid fa-right-from-bracket fa-solid fa-rocket-launch fa-solid fa-rotate-forward fa-solid fa-rotate-right fa-solid fa-scissors fa-solid fa-search fa-solid fa-shield fa-solid fa-shield-alt fa-solid fa-shield-blank fa-solid fa-shield-halved fa-solid fa-shirt fa-solid fa-shopping-cart fa-solid fa-sign-out-alt fa-solid fa-smile fa-solid fa-snowflake fa-solid fa-square-dashed fa-solid fa-square-minus fa-solid fa-star fa-solid fa-store fa-solid fa-swords fa-solid fa-sync fa-solid fa-t-shirt fa-solid fa-tachometer-alt fa-solid fa-tachometer-alt-fast fa-solid fa-terminal fa-solid fa-trash-alt fa-solid fa-trash-can fa-solid fa-trophy fa-solid fa-tshirt fa-solid fa-up-from-bracket fa-solid fa-upload fa-solid fa-user fa-solid fa-user-astronaut fa-solid fa-user-friends fa-solid fa-user-group fa-solid fa-user-group-crown fa-solid fa-user-minus fa-solid fa-user-plus fa-solid fa-user-slash fa-solid fa-user-unlock fa-solid fa-users-crown fa-solid fa-video fa-solid fa-video-camera fa-solid fa-volume fa-solid fa-volume-down fa-solid fa-volume-low fa-solid fa-volume-medium fa-solid fa-volume-slash fa-solid fa-wrench fa-solid fa-x fa-solid fa-zap ``` ## Custom Kit Icons (2 icons) ``` fa-solid fa-kit fa-pants fa-solid fa-kit fa-shoe ``` ## Brand Icons (3 icons) ``` fa-solid fa-brands fa-apple fa-solid fa-brands fa-discord fa-solid fa-brands fa-youtube ``` # Icons Icons can be used in `CustomTextStyling` arrays with the `StyledIcon` type: ```js api.sendMessage(playerId, [{ icon: "fa-solid fa-heart" }, " You gained a life!"]) api.sendMessage(playerId, [{ icon: "fa-solid fa-star", style: { color: "gold" } }, " Achievement!"]) ``` > **Prefer Bloxd-native icons:** For the best visual consistency with Bloxd's theme, use **item names** (see ITEM_NAMES.txt), **block names** (see BLOCK_NAMES.txt), or **ingame icons** (below) wherever possible. These are designed specifically for Bloxd and will look more cohesive. Only fall back to Font Awesome icons when no Bloxd-native option fits your use case. ## Ingame Icons (89 icons) See the `IngameIconName` type in the Glossary. ``` Damage Damage Reduction Speed VoidJump Fist Frozen Hydrated Invisible Jump Boost Poisoned Slowness Weakness Health Regen Haste Double Jump Heat Resistance Gliding Boating Obsidian Boating Riding Bunny Hop FallDamage Feather Falling Thief X-Ray Vision Mining Yield Brain Rot Rested Damage Rested Haste Rested Speed Rested Farming Yield Rested Aura Blindness Pickpocketer Lifesteal Bounciness Air Walk Wall Climbing Thorns Poopy Draugr Knight Head Draugr Warper Head Magma Golem Head Mystery Fish Damage Enchantment Critical Damage Enchantment Attack Speed Enchantment Protection Enchantment Health Enchantment Health Regen Enchantment Stomp Damage Enchantment Knockback Resist Enchantment Arrow Speed Enchantment Arrow Damage Enchantment Quick Charge Enchantment Break Speed Enchantment Momentum Enchantment Mining Yield Enchantment Farming Yield Enchantment Mining Aura Enchantment Digging Aura Enchantment Lumber Aura Enchantment Farming Aura Enchantment Vertical Knockback Enchantment Horizontal Knockback Enchantment Self Yield Friends Riding Speed Feed Aura Double Poop Mob Slayer Rainbow Wool Pack Leader Max Health Poison Claws Mob Yield Antlers Bonus Health HealthShield Cross Friendship Dotted Friendship Hunger Empty Hunger Pixelated Heart Question Mark Trader Black Trader Blue Trader Piggy ``` --- ## Font Awesome Icons (171 icons) Use with `fa-solid`, `fa-regular`, or `fa-duotone` prefix. Only use these when no Bloxd-native icon fits. ``` fa-solid fa-add fa-solid fa-angle-double-up fa-solid fa-angle-down fa-solid fa-angle-up fa-solid fa-angles-up fa-solid fa-arrow-up fa-solid fa-arrow-up-right-from-square fa-solid fa-arrows fa-solid fa-arrows-h fa-solid fa-arrows-left-right fa-solid fa-arrows-rotate fa-solid fa-arrows-up-down-left-right fa-solid fa-award fa-solid fa-backpack fa-solid fa-bars fa-solid fa-block-question fa-solid fa-bolt fa-solid fa-boot fa-solid fa-caret-up fa-solid fa-cart-shopping fa-solid fa-check fa-solid fa-chess-rook fa-solid fa-circle-info fa-solid fa-circle-plus fa-solid fa-clock-rotate-left fa-solid fa-cog fa-solid fa-coins fa-solid fa-comment-dots fa-solid fa-commenting fa-solid fa-compress fa-solid fa-computer-mouse fa-solid fa-cookie fa-solid fa-copy fa-solid fa-crosshairs fa-solid fa-crown fa-solid fa-cube fa-solid fa-cubes fa-solid fa-cut fa-solid fa-dice fa-solid fa-dizzy fa-solid fa-door-closed fa-solid fa-door-open fa-solid fa-download fa-solid fa-edit fa-solid fa-ellipsis fa-solid fa-ellipsis-h fa-solid fa-exclamation fa-solid fa-expand fa-solid fa-external-link fa-solid fa-eye fa-solid fa-eye-slash fa-solid fa-face-diagonal-mouth fa-solid fa-face-dizzy fa-solid fa-face-raised-eyebrow fa-solid fa-face-smile fa-solid fa-face-worried fa-solid fa-feather-alt fa-solid fa-feather-pointed fa-solid fa-file-alt fa-solid fa-file-clipboard fa-solid fa-file-lines fa-solid fa-file-text fa-solid fa-film fa-solid fa-fire fa-solid fa-fist-raised fa-solid fa-flag fa-solid fa-folder-image fa-solid fa-gauge-high fa-solid fa-gear fa-solid fa-gem fa-solid fa-globe fa-solid fa-hammer fa-solid fa-hand-back-point-up fa-solid fa-hand-fist fa-solid fa-hand-holding-medical fa-solid fa-hand-point-left fa-solid fa-hat-santa fa-solid fa-hat-witch fa-solid fa-heart fa-solid fa-heart-music-camera-bolt fa-solid fa-history fa-solid fa-hourglass-clock fa-solid fa-icons fa-solid fa-image fa-solid fa-info-circle fa-solid fa-joystick fa-solid fa-layer-group fa-solid fa-lightbulb fa-solid fa-list fa-solid fa-list-squares fa-solid fa-location-check fa-solid fa-location-xmark fa-solid fa-lock fa-solid fa-lock-open fa-solid fa-magnifying-glass fa-solid fa-male fa-solid fa-map-marker-check fa-solid fa-map-marker-times fa-solid fa-map-marker-xmark fa-solid fa-minus-square fa-solid fa-mouse fa-solid fa-music fa-solid fa-navicon fa-solid fa-palette fa-solid fa-paste fa-solid fa-pen fa-solid fa-pen-field fa-solid fa-pen-to-square fa-solid fa-person fa-solid fa-person-arrow-down-to-line fa-solid fa-person-arrow-up-from-line fa-solid fa-person-falling-burst fa-solid fa-person-military-pointing fa-solid fa-planet-ringed fa-solid fa-plus fa-solid fa-plus-circle fa-solid fa-power-off fa-solid fa-recycle fa-solid fa-redo-alt fa-solid fa-refresh fa-solid fa-right-from-bracket fa-solid fa-rocket-launch fa-solid fa-rotate-forward fa-solid fa-rotate-right fa-solid fa-scissors fa-solid fa-search fa-solid fa-shield fa-solid fa-shield-alt fa-solid fa-shield-blank fa-solid fa-shield-halved fa-solid fa-shirt fa-solid fa-shopping-cart fa-solid fa-sign-out-alt fa-solid fa-smile fa-solid fa-snowflake fa-solid fa-square-dashed fa-solid fa-square-minus fa-solid fa-star fa-solid fa-store fa-solid fa-swords fa-solid fa-sync fa-solid fa-t-shirt fa-solid fa-tachometer-alt fa-solid fa-tachometer-alt-fast fa-solid fa-terminal fa-solid fa-trash-alt fa-solid fa-trash-can fa-solid fa-trophy fa-solid fa-tshirt fa-solid fa-up-from-bracket fa-solid fa-upload fa-solid fa-user fa-solid fa-user-astronaut fa-solid fa-user-friends fa-solid fa-user-group fa-solid fa-user-group-crown fa-solid fa-user-minus fa-solid fa-user-plus fa-solid fa-user-slash fa-solid fa-user-unlock fa-solid fa-users-crown fa-solid fa-video fa-solid fa-video-camera fa-solid fa-volume fa-solid fa-volume-down fa-solid fa-volume-low fa-solid fa-volume-medium fa-solid fa-volume-slash fa-solid fa-wrench fa-solid fa-x fa-solid fa-zap ``` ## Custom Kit Icons (2 icons) ``` fa-solid fa-kit fa-pants fa-solid fa-kit fa-shoe ``` ## Brand Icons (3 icons) ``` fa-solid fa-brands fa-apple fa-solid fa-brands fa-discord fa-solid fa-brands fa-youtube ``` # Icons Icons can be used in `CustomTextStyling` arrays with the `StyledIcon` type: ```js api.sendMessage(playerId, [{ icon: "fa-solid fa-heart" }, " You gained a life!"]) api.sendMessage(playerId, [{ icon: "fa-solid fa-star", style: { color: "gold" } }, " Achievement!"]) ``` > **Prefer Bloxd-native icons:** For the best visual consistency with Bloxd's theme, use **item names** (see ITEM_NAMES.txt), **block names** (see BLOCK_NAMES.txt), or **ingame icons** (below) wherever possible. These are designed specifically for Bloxd and will look more cohesive. Only fall back to Font Awesome icons when no Bloxd-native option fits your use case. ## Ingame Icons (89 icons) See the `IngameIconName` type in the Glossary. ``` Damage Damage Reduction Speed VoidJump Fist Frozen Hydrated Invisible Jump Boost Poisoned Slowness Weakness Health Regen Haste Double Jump Heat Resistance Gliding Boating Obsidian Boating Riding Bunny Hop FallDamage Feather Falling Thief X-Ray Vision Mining Yield Brain Rot Rested Damage Rested Haste Rested Speed Rested Farming Yield Rested Aura Blindness Pickpocketer Lifesteal Bounciness Air Walk Wall Climbing Thorns Poopy Draugr Knight Head Draugr Warper Head Magma Golem Head Mystery Fish Damage Enchantment Critical Damage Enchantment Attack Speed Enchantment Protection Enchantment Health Enchantment Health Regen Enchantment Stomp Damage Enchantment Knockback Resist Enchantment Arrow Speed Enchantment Arrow Damage Enchantment Quick Charge Enchantment Break Speed Enchantment Momentum Enchantment Mining Yield Enchantment Farming Yield Enchantment Mining Aura Enchantment Digging Aura Enchantment Lumber Aura Enchantment Farming Aura Enchantment Vertical Knockback Enchantment Horizontal Knockback Enchantment Self Yield Friends Riding Speed Feed Aura Double Poop Mob Slayer Rainbow Wool Pack Leader Max Health Poison Claws Mob Yield Antlers Bonus Health HealthShield Cross Friendship Dotted Friendship Hunger Empty Hunger Pixelated Heart Question Mark Trader Black Trader Blue Trader Piggy ``` --- ## Font Awesome Icons (171 icons) Use with `fa-solid`, `fa-regular`, or `fa-duotone` prefix. Only use these when no Bloxd-native icon fits. ``` fa-solid fa-add fa-solid fa-angle-double-up fa-solid fa-angle-down fa-solid fa-angle-up fa-solid fa-angles-up fa-solid fa-arrow-up fa-solid fa-arrow-up-right-from-square fa-solid fa-arrows fa-solid fa-arrows-h fa-solid fa-arrows-left-right fa-solid fa-arrows-rotate fa-solid fa-arrows-up-down-left-right fa-solid fa-award fa-solid fa-backpack fa-solid fa-bars fa-solid fa-block-question fa-solid fa-bolt fa-solid fa-boot fa-solid fa-caret-up fa-solid fa-cart-shopping fa-solid fa-check fa-solid fa-chess-rook fa-solid fa-circle-info fa-solid fa-circle-plus fa-solid fa-clock-rotate-left fa-solid fa-cog fa-solid fa-coins fa-solid fa-comment-dots fa-solid fa-commenting fa-solid fa-compress fa-solid fa-computer-mouse fa-solid fa-cookie fa-solid fa-copy fa-solid fa-crosshairs fa-solid fa-crown fa-solid fa-cube fa-solid fa-cubes fa-solid fa-cut fa-solid fa-dice fa-solid fa-dizzy fa-solid fa-door-closed fa-solid fa-door-open fa-solid fa-download fa-solid fa-edit fa-solid fa-ellipsis fa-solid fa-ellipsis-h fa-solid fa-exclamation fa-solid fa-expand fa-solid fa-external-link fa-solid fa-eye fa-solid fa-eye-slash fa-solid fa-face-diagonal-mouth fa-solid fa-face-dizzy fa-solid fa-face-raised-eyebrow fa-solid fa-face-smile fa-solid fa-face-worried fa-solid fa-feather-alt fa-solid fa-feather-pointed fa-solid fa-file-alt fa-solid fa-file-clipboard fa-solid fa-file-lines fa-solid fa-file-text fa-solid fa-film fa-solid fa-fire fa-solid fa-fist-raised fa-solid fa-flag fa-solid fa-folder-image fa-solid fa-gauge-high fa-solid fa-gear fa-solid fa-gem fa-solid fa-globe fa-solid fa-hammer fa-solid fa-hand-back-point-up fa-solid fa-hand-fist fa-solid fa-hand-holding-medical fa-solid fa-hand-point-left fa-solid fa-hat-santa fa-solid fa-hat-witch fa-solid fa-heart fa-solid fa-heart-music-camera-bolt fa-solid fa-history fa-solid fa-hourglass-clock fa-solid fa-icons fa-solid fa-image fa-solid fa-info-circle fa-solid fa-joystick fa-solid fa-layer-group fa-solid fa-lightbulb fa-solid fa-list fa-solid fa-list-squares fa-solid fa-location-check fa-solid fa-location-xmark fa-solid fa-lock fa-solid fa-lock-open fa-solid fa-magnifying-glass fa-solid fa-male fa-solid fa-map-marker-check fa-solid fa-map-marker-times fa-solid fa-map-marker-xmark fa-solid fa-minus-square fa-solid fa-mouse fa-solid fa-music fa-solid fa-navicon fa-solid fa-palette fa-solid fa-paste fa-solid fa-pen fa-solid fa-pen-field fa-solid fa-pen-to-square fa-solid fa-person fa-solid fa-person-arrow-down-to-line fa-solid fa-person-arrow-up-from-line fa-solid fa-person-falling-burst fa-solid fa-person-military-pointing fa-solid fa-planet-ringed fa-solid fa-plus fa-solid fa-plus-circle fa-solid fa-power-off fa-solid fa-recycle fa-solid fa-redo-alt fa-solid fa-refresh fa-solid fa-right-from-bracket fa-solid fa-rocket-launch fa-solid fa-rotate-forward fa-solid fa-rotate-right fa-solid fa-scissors fa-solid fa-search fa-solid fa-shield fa-solid fa-shield-alt fa-solid fa-shield-blank fa-solid fa-shield-halved fa-solid fa-shirt fa-solid fa-shopping-cart fa-solid fa-sign-out-alt fa-solid fa-smile fa-solid fa-snowflake fa-solid fa-square-dashed fa-solid fa-square-minus fa-solid fa-star fa-solid fa-store fa-solid fa-swords fa-solid fa-sync fa-solid fa-t-shirt fa-solid fa-tachometer-alt fa-solid fa-tachometer-alt-fast fa-solid fa-terminal fa-solid fa-trash-alt fa-solid fa-trash-can fa-solid fa-trophy fa-solid fa-tshirt fa-solid fa-up-from-bracket fa-solid fa-upload fa-solid fa-user fa-solid fa-user-astronaut fa-solid fa-user-friends fa-solid fa-user-group fa-solid fa-user-group-crown fa-solid fa-user-minus fa-solid fa-user-plus fa-solid fa-user-slash fa-solid fa-user-unlock fa-solid fa-users-crown fa-solid fa-video fa-solid fa-video-camera fa-solid fa-volume fa-solid fa-volume-down fa-solid fa-volume-low fa-solid fa-volume-medium fa-solid fa-volume-slash fa-solid fa-wrench fa-solid fa-x fa-solid fa-zap ``` ## Custom Kit Icons (2 icons) ``` fa-solid fa-kit fa-pants fa-solid fa-kit fa-shoe ``` ## Brand Icons (3 icons) ``` fa-solid fa-brands fa-apple fa-solid fa-brands fa-discord fa-solid fa-brands fa-youtube ``` Wood Pickaxe Stone Pickaxe Iron Pickaxe Gold Pickaxe Diamond Pickaxe Moonstone Pickaxe Golem Pickaxe Wood Axe Stone Axe Iron Axe Gold Axe Diamond Axe Moonstone Axe Artisan Axe Wood Spade Stone Spade Iron Spade Gold Spade Diamond Spade Wood Sword Stone Sword Iron Sword Gold Sword Diamond Sword Knight Sword Wood Hoe Stone Hoe Iron Hoe Gold Hoe Diamond Hoe Wood Helmet Iron Helmet Gold Helmet Diamond Helmet Wood Chestplate Iron Chestplate Gold Chestplate Diamond Chestplate Fur Chestplate Wood Leggings Iron Leggings Gold Leggings Diamond Leggings Wood Boots Iron Boots Gold Boots Diamond Boots Spiked Boots Wood Gauntlets Iron Gauntlets Gold Gauntlets Diamond Gauntlets White Wood Helmet White Wood Chestplate White Wood Leggings White Wood Boots White Wood Gauntlets Orange Wood Helmet Orange Wood Chestplate Orange Wood Leggings Orange Wood Boots Orange Wood Gauntlets Magenta Wood Helmet Magenta Wood Chestplate Magenta Wood Leggings Magenta Wood Boots Magenta Wood Gauntlets Light Blue Wood Helmet Light Blue Wood Chestplate Light Blue Wood Leggings Light Blue Wood Boots Light Blue Wood Gauntlets Yellow Wood Helmet Yellow Wood Chestplate Yellow Wood Leggings Yellow Wood Boots Yellow Wood Gauntlets Lime Wood Helmet Lime Wood Chestplate Lime Wood Leggings Lime Wood Boots Lime Wood Gauntlets Pink Wood Helmet Pink Wood Chestplate Pink Wood Leggings Pink Wood Boots Pink Wood Gauntlets Gray Wood Helmet Gray Wood Chestplate Gray Wood Leggings Gray Wood Boots Gray Wood Gauntlets Light Gray Wood Helmet Light Gray Wood Chestplate Light Gray Wood Leggings Light Gray Wood Boots Light Gray Wood Gauntlets Cyan Wood Helmet Cyan Wood Chestplate Cyan Wood Leggings Cyan Wood Boots Cyan Wood Gauntlets Purple Wood Helmet Purple Wood Chestplate Purple Wood Leggings Purple Wood Boots Purple Wood Gauntlets Blue Wood Helmet Blue Wood Chestplate Blue Wood Leggings Blue Wood Boots Blue Wood Gauntlets Brown Wood Helmet Brown Wood Chestplate Brown Wood Leggings Brown Wood Boots Brown Wood Gauntlets Green Wood Helmet Green Wood Chestplate Green Wood Leggings Green Wood Boots Green Wood Gauntlets Red Wood Helmet Red Wood Chestplate Red Wood Leggings Red Wood Boots Red Wood Gauntlets Black Wood Helmet Black Wood Chestplate Black Wood Leggings Black Wood Boots Black Wood Gauntlets Shears Artisan Shears Stick Coal Raw Iron Iron Bar Iron Fragment Raw Gold Gold Bar Gold Fragment Diamond Diamond Fragment Moonstone Moonstone Fragment Bowl Partially Full Bowl of Cranberries Half Full Bowl of Cranberries Nearly Full Bowl of Cranberries Bowl of Cranberries Mushroom Soup Cotton Bucket Water Bucket Lava Bucket Boat INTERNAL_MESH_Boat Obsidian Boat INTERNAL_MESH_Obsidian Boat Wood Hang Glider INTERNAL_MESH_Wood Hang Glider Iron Hang Glider INTERNAL_MESH_Iron Hang Glider Gold Hang Glider INTERNAL_MESH_Gold Hang Glider Diamond Hang Glider INTERNAL_MESH_Diamond Hang Glider INTERNAL_MESH_Kart Snowball Snowball Launcher Pebble Reinforced Pebble Ball Reinforced Ball Moonstone Orb Fireball Bouncy Bomb RPG Obby RPG Super RPG Grenade Launcher Iceball 67 Base Projectile 67 Boosted Projectile Capitano Grenade Scatter Pellet Wood Bow Wood Bow|meta|charging2 Wood Bow|meta|charging3 Wood Bow|meta|charging4 Stone Bow Stone Bow|meta|charging2 Stone Bow|meta|charging3 Stone Bow|meta|charging4 Iron Bow Iron Bow|meta|charging2 Iron Bow|meta|charging3 Iron Bow|meta|charging4 Gold Bow Gold Bow|meta|charging2 Gold Bow|meta|charging3 Gold Bow|meta|charging4 Diamond Bow Diamond Bow|meta|charging2 Diamond Bow|meta|charging3 Diamond Bow|meta|charging4 Wood Crossbow Wood Crossbow|meta|charging2 Wood Crossbow|meta|charging3 Wood Crossbow|meta|charging4 Stone Crossbow Stone Crossbow|meta|charging2 Stone Crossbow|meta|charging3 Stone Crossbow|meta|charging4 Iron Crossbow Iron Crossbow|meta|charging2 Iron Crossbow|meta|charging3 Iron Crossbow|meta|charging4 Gold Crossbow Gold Crossbow|meta|charging2 Gold Crossbow|meta|charging3 Gold Crossbow|meta|charging4 Diamond Crossbow Diamond Crossbow|meta|charging2 Diamond Crossbow|meta|charging3 Diamond Crossbow|meta|charging4 Wood Crossbow Charged Stone Crossbow Charged Iron Crossbow Charged Gold Crossbow Charged Diamond Crossbow Charged Arrow Compass Compass|meta|dir2 Compass|meta|dir3 Compass|meta|dir4 Compass|meta|dir5 Compass|meta|dir6 Compass|meta|dir7 Compass|meta|dir8 Compass|meta|dir9 Compass|meta|dir10 Compass|meta|dir11 Compass|meta|dir12 Bread Bowl of Rice Apple Plum Coconut Cracked Coconut Pear Cherry Banana Watermelon Slice Gold Watermelon Slice Melon Slice Gold Melon Slice Pumpkin Pie Corn Cornbread Chili Pepper Mango Carrot Raw Potato Baked Potato Beetroot Raw Porkchop Cooked Porkchop Raw Beef Steak Raw Mutton Cooked Mutton Raw Venison Cooked Venison Rotten Flesh Rotten Brain Bone Bone Meal Leather Saddle Spirit Saddle Fur Golem Eye Knight Heart Name Tag Book Empty Bottle Water Bottle Slowness Potion Slowness Potion II Splash Slowness Potion Splash Slowness Potion II Arrow of Slowness Poison Potion Poison Potion II Splash Poison Potion Splash Poison Potion II Arrow of Poison Weakness Potion Weakness Potion II Splash Weakness Potion Splash Weakness Potion II Arrow of Weakness Instant Damage Potion Instant Damage Potion II Splash Instant Damage Potion Splash Instant Damage Potion II Arrow of Instant Damage Milk Potion Splash Milk Potion Arrow of Milk Speed Potion Speed Potion II Splash Speed Potion Splash Speed Potion II Arrow of Speed Defense Potion Defense Potion II Splash Defense Potion Splash Defense Potion II Arrow of Defense Strength Potion Strength Potion II Splash Strength Potion Splash Strength Potion II Arrow of Strength Invisibility Potion Splash Invisibility Potion Arrow of Invisibility Jump Potion Jump Potion II Splash Jump Potion Splash Jump Potion II Arrow of Jumping Knockback Potion Splash Knockback Potion Splash Knockback Potion II Arrow of Knockback Regeneration Potion Regeneration Potion II Splash Regeneration Potion Splash Regeneration Potion II Arrow of Regeneration Instant Healing Potion Instant Healing Potion II Splash Instant Healing Potion Splash Instant Healing Potion II Arrow of Instant Healing Haste Potion Haste Potion II Splash Haste Potion Splash Haste Potion II Arrow of Haste Shield Potion Shield Potion II Splash Shield Potion Splash Shield Potion II Arrow of Shield Double Jump Potion Splash Double Jump Potion Arrow of Double Jump Heat Resistance Potion Splash Heat Resistance Potion Arrow of Heat Resistance X-Ray Vision Potion Splash X-Ray Vision Potion Arrow of X-Ray Vision Mining Yield Potion Mining Yield Potion II Splash Mining Yield Potion Splash Mining Yield Potion II Arrow of Mining Yield Brain Rot Potion Splash Brain Rot Potion Arrow of Brain Rot Chaos Potion Ammo AK-47 AK-47|RequiresAmmo M16 M16|RequiresAmmo MP40 MP40|RequiresAmmo TAR-21 TAR-21|RequiresAmmo M1911 M1911|RequiresAmmo One Shot Pistol One Shot Pistol|RequiresAmmo Double Barrel Double Barrel|RequiresAmmo AWP AWP|RequiresAmmo Deagle Deagle|RequiresAmmo Striker-12 Striker-12|RequiresAmmo VSR VSR|RequiresAmmo Minigun Minigun|RequiresAmmo FMR FMR|RequiresAmmo Gold Coin Updraft Snowdash Floor Creator Moonstone Remote Explosive Moonstone Remote Ice Bridge Yellow Balloon White Balloon Red Balloon Purple Balloon Pink Balloon Orange Balloon Magenta Balloon Lime Balloon Light Gray Balloon Light Blue Balloon Green Balloon Gray Balloon Cyan Balloon Brown Balloon Blue Balloon Black Balloon INTERNAL_MESH_Yellow Balloon INTERNAL_MESH_White Balloon INTERNAL_MESH_Red Balloon INTERNAL_MESH_Purple Balloon INTERNAL_MESH_Pink Balloon INTERNAL_MESH_Orange Balloon INTERNAL_MESH_Magenta Balloon INTERNAL_MESH_Lime Balloon INTERNAL_MESH_Light Gray Balloon INTERNAL_MESH_Light Blue Balloon INTERNAL_MESH_Green Balloon INTERNAL_MESH_Gray Balloon INTERNAL_MESH_Cyan Balloon INTERNAL_MESH_Brown Balloon INTERNAL_MESH_Blue Balloon INTERNAL_MESH_Black Balloon Yellow Popup Tower White Popup Tower Red Popup Tower Purple Popup Tower Pink Popup Tower Orange Popup Tower Magenta Popup Tower Lime Popup Tower Light Gray Popup Tower Light Blue Popup Tower Green Popup Tower Gray Popup Tower Cyan Popup Tower Brown Popup Tower Blue Popup Tower Black Popup Tower Yellow Paintball Gun White Paintball Gun Red Paintball Gun Purple Paintball Gun Pink Paintball Gun Orange Paintball Gun Magenta Paintball Gun Lime Paintball Gun Light Gray Paintball Gun Light Blue Paintball Gun Green Paintball Gun Gray Paintball Gun Cyan Paintball Gun Brown Paintball Gun Blue Paintball Gun Black Paintball Gun Yellow Paintball White Paintball Red Paintball Purple Paintball Pink Paintball Orange Paintball Magenta Paintball Lime Paintball Light Gray Paintball Light Blue Paintball Green Paintball Gray Paintball Cyan Paintball Brown Paintball Blue Paintball Black Paintball Yellow Heavy Paintball Gun White Heavy Paintball Gun Red Heavy Paintball Gun Purple Heavy Paintball Gun Pink Heavy Paintball Gun Orange Heavy Paintball Gun Magenta Heavy Paintball Gun Lime Heavy Paintball Gun Light Gray Heavy Paintball Gun Light Blue Heavy Paintball Gun Green Heavy Paintball Gun Gray Heavy Paintball Gun Cyan Heavy Paintball Gun Brown Heavy Paintball Gun Blue Heavy Paintball Gun Black Heavy Paintball Gun Yellow Paintball Explosive Item White Paintball Explosive Item Red Paintball Explosive Item Purple Paintball Explosive Item Pink Paintball Explosive Item Orange Paintball Explosive Item Magenta Paintball Explosive Item Lime Paintball Explosive Item Light Gray Paintball Explosive Item Light Blue Paintball Explosive Item Green Paintball Explosive Item Gray Paintball Explosive Item Cyan Paintball Explosive Item Brown Paintball Explosive Item Blue Paintball Explosive Item Black Paintball Explosive Item Yellow Sticky Paintball Explosive Item White Sticky Paintball Explosive Item Red Sticky Paintball Explosive Item Purple Sticky Paintball Explosive Item Pink Sticky Paintball Explosive Item Orange Sticky Paintball Explosive Item Magenta Sticky Paintball Explosive Item Lime Sticky Paintball Explosive Item Light Gray Sticky Paintball Explosive Item Light Blue Sticky Paintball Explosive Item Green Sticky Paintball Explosive Item Gray Sticky Paintball Explosive Item Cyan Sticky Paintball Explosive Item Brown Sticky Paintball Explosive Item Blue Sticky Paintball Explosive Item Black Sticky Paintball Explosive Item Yellow Seeking Paintball Explosive Item White Seeking Paintball Explosive Item Red Seeking Paintball Explosive Item Purple Seeking Paintball Explosive Item Pink Seeking Paintball Explosive Item Orange Seeking Paintball Explosive Item Magenta Seeking Paintball Explosive Item Lime Seeking Paintball Explosive Item Light Gray Seeking Paintball Explosive Item Light Blue Seeking Paintball Explosive Item Green Seeking Paintball Explosive Item Gray Seeking Paintball Explosive Item Cyan Seeking Paintball Explosive Item Brown Seeking Paintball Explosive Item Blue Seeking Paintball Explosive Item Black Seeking Paintball Explosive Item Yellow Quick Paintball Explosive Item White Quick Paintball Explosive Item Red Quick Paintball Explosive Item Purple Quick Paintball Explosive Item Pink Quick Paintball Explosive Item Orange Quick Paintball Explosive Item Magenta Quick Paintball Explosive Item Lime Quick Paintball Explosive Item Light Gray Quick Paintball Explosive Item Light Blue Quick Paintball Explosive Item Green Quick Paintball Explosive Item Gray Quick Paintball Explosive Item Cyan Quick Paintball Explosive Item Brown Quick Paintball Explosive Item Blue Quick Paintball Explosive Item Black Quick Paintball Explosive Item Yellow Paint Bow Yellow Paint Bow|meta|charging2 Yellow Paint Bow|meta|charging3 Yellow Paint Bow|meta|charging4 White Paint Bow White Paint Bow|meta|charging2 White Paint Bow|meta|charging3 White Paint Bow|meta|charging4 Red Paint Bow Red Paint Bow|meta|charging2 Red Paint Bow|meta|charging3 Red Paint Bow|meta|charging4 Purple Paint Bow Purple Paint Bow|meta|charging2 Purple Paint Bow|meta|charging3 Purple Paint Bow|meta|charging4 Pink Paint Bow Pink Paint Bow|meta|charging2 Pink Paint Bow|meta|charging3 Pink Paint Bow|meta|charging4 Orange Paint Bow Orange Paint Bow|meta|charging2 Orange Paint Bow|meta|charging3 Orange Paint Bow|meta|charging4 Magenta Paint Bow Magenta Paint Bow|meta|charging2 Magenta Paint Bow|meta|charging3 Magenta Paint Bow|meta|charging4 Lime Paint Bow Lime Paint Bow|meta|charging2 Lime Paint Bow|meta|charging3 Lime Paint Bow|meta|charging4 Light Gray Paint Bow Light Gray Paint Bow|meta|charging2 Light Gray Paint Bow|meta|charging3 Light Gray Paint Bow|meta|charging4 Light Blue Paint Bow Light Blue Paint Bow|meta|charging2 Light Blue Paint Bow|meta|charging3 Light Blue Paint Bow|meta|charging4 Green Paint Bow Green Paint Bow|meta|charging2 Green Paint Bow|meta|charging3 Green Paint Bow|meta|charging4 Gray Paint Bow Gray Paint Bow|meta|charging2 Gray Paint Bow|meta|charging3 Gray Paint Bow|meta|charging4 Cyan Paint Bow Cyan Paint Bow|meta|charging2 Cyan Paint Bow|meta|charging3 Cyan Paint Bow|meta|charging4 Brown Paint Bow Brown Paint Bow|meta|charging2 Brown Paint Bow|meta|charging3 Brown Paint Bow|meta|charging4 Blue Paint Bow Blue Paint Bow|meta|charging2 Blue Paint Bow|meta|charging3 Blue Paint Bow|meta|charging4 Black Paint Bow Black Paint Bow|meta|charging2 Black Paint Bow|meta|charging3 Black Paint Bow|meta|charging4 Pig Spawn Orb Cow Spawn Orb Sheep Spawn Orb Horse Spawn Orb Deer Spawn Orb Wolf Spawn Orb Wildcat Spawn Orb Spirit Golem Spawn Orb Spirit Wolf Spawn Orb Spirit Bear Spawn Orb Spirit Stag Spawn Orb Spirit Gorilla Spawn Orb Bear Spawn Orb Stag Spawn Orb Gold Watermelon Stag Spawn Orb Gorilla Spawn Orb Cave Golem Spawn Orb Draugr Zombie Spawn Orb Draugr Skeleton Spawn Orb Frost Golem Spawn Orb Frost Zombie Spawn Orb Frost Skeleton Spawn Orb Draugr Knight Spawn Orb Draugr Huntress Spawn Orb Magma Golem Spawn Orb Draugr Warper Spawn Orb Frost Wraith Spawn Orb Draugr Reaver Spawn Orb Mob Catcher Caught Mob Pig Default Caught Mob Cow Default Caught Mob Cow Cream Caught Mob Sheep Default Caught Mob Sheep Black Caught Mob Sheep Red Caught Mob Sheep Orange Caught Mob Sheep Pink Caught Mob Sheep Purple Caught Mob Sheep Yellow Caught Mob Sheep Blue Caught Mob Sheep Brown Caught Mob Sheep Cyan Caught Mob Sheep Gray Caught Mob Sheep Green Caught Mob Sheep Lightblue Caught Mob Sheep Lightgray Caught Mob Sheep Lime Caught Mob Sheep Magenta Caught Mob Horse Default Caught Mob Horse Black Caught Mob Horse Brown Caught Mob Horse Cream Caught Mob Deer Default Caught Mob Wolf Default Caught Mob Wolf White Caught Mob Wolf Brown Caught Mob Wolf Grey Caught Mob Wolf Spectral Caught Mob Wildcat Default Caught Mob Wildcat Tabby Caught Mob Wildcat Grey Caught Mob Wildcat Black Caught Mob Wildcat Calico Caught Mob Wildcat Siamese Caught Mob Wildcat Leopard Caught Mob Spirit_Golem Default Caught Mob Spirit_Wolf Default Caught Mob Spirit_Bear Default Caught Mob Spirit_Stag Default Caught Mob Spirit_Gorilla Default Caught Mob Bear Default Caught Mob Stag Default Caught Mob Gold_Watermelon_Stag Default Caught Mob Gorilla Default Caught Mob Cave_Golem Default Caught Mob Cave_Golem Iron Caught Mob Draugr_Zombie Default Caught Mob Draugr_Zombie Longhairchestplate Caught Mob Draugr_Zombie Longhairclothed Caught Mob Draugr_Zombie Shorthairclothed Caught Mob Draugr_Skeleton Default Caught Mob Frost_Golem Default Caught Mob Frost_Zombie Default Caught Mob Frost_Zombie Longhairchestplate Caught Mob Frost_Zombie Shorthairclothed Caught Mob Frost_Skeleton Default Caught Mob Draugr_Knight Default Caught Mob Draugr_Huntress Default Caught Mob Draugr_Huntress Chainmail Caught Mob Magma_Golem Default Caught Mob Draugr_Warper Default Caught Mob Frost_Wraith Default Caught Mob Draugr_Reaver Default Caught Mob NPC Default Caught Mob NPC Emma Caught Mob NPC Leo Caught Mob NPC Isabel Caught Mob NPC Sanjay Caught Mob NPC Imara Caught Mob NPC Enoch Caught Mob NPC Sara Caught Mob NPC Carmen Caught Mob 67 Default Caught Mob Bobino_Musculino Default Caught Mob Capitano_Explovissimo Default Timed Spike Bomb Timed Spike Bomb|meta|charging2 Timed Spike Bomb|meta|charging3 Timed Spike Bomb|meta|charging4 Toxin Ball Aura XP Fragment Aura XP Orb Aura XP Potion Aura XP Potion II Splash Aura XP Potion Splash Aura XP Potion II Arrow of Aura XP Firecracker Rainbow Firecracker Yellow Firecracker White Firecracker Red Firecracker Purple Firecracker Pink Firecracker Orange Firecracker Magenta Firecracker Lime Firecracker Light Gray Firecracker Light Blue Firecracker Green Firecracker Gray Firecracker Cyan Firecracker Brown Firecracker Blue Firecracker Black Firecracker Firecracker Pebble Rainbow Firecracker Pebble Yellow Firecracker Pebble White Firecracker Pebble Red Firecracker Pebble Purple Firecracker Pebble Pink Firecracker Pebble Orange Firecracker Pebble Magenta Firecracker Pebble Lime Firecracker Pebble Light Gray Firecracker Pebble Light Blue Firecracker Pebble Green Firecracker Pebble Gray Firecracker Pebble Cyan Firecracker Pebble Brown Firecracker Pebble Blue Firecracker Pebble Black Firecracker Pebble WorldBuilder Wand Red Strongfish Green Strongfish Moon Strongfish Wheatfish Moonfish Bombfish Boomerang Fish Root Flounder Abyss Carp Boulder Bass Barnaclejaw Crystalized Wheatfish Darter Shadow Darter Electric Eel Grass Snapper Jungle Spinefish Mangler Catfish Mossback Arapaima Sandbelly Piranha Shadeback Ray Mudbelly Tilapia Mireback Carp Rotslab Eel Aether Minnow Murkborne Ray Eldertide Leviathan Oarfish Alpha Moon Strongfish Bamboo Catfish Blackwater Bream Blackwater Leviathan Boned Sturgeon Bull Shark Channel Sawfish Coastal Mullet Coelacanth Driftwood Catfish Eagle Ray Giant Grouper Giant Moray Giant Stingray Golden Mahseer Greenfin Loach Mangrove Herring Moonlit Boomerang Fish Moonstone Pupfish Mudline Perch Murk Stingray Needlefish Nomai Moray Pearlescent Moonfish Rainbow Guppy Red Snapper Reedglass Minnow Reef Sardine Root Perch Rust Scad Seahorse Snakehead Spined Stickleback Stone Grouper Sumpback Carp Sunset Minnow Tarpon Threadfin Bream Tri-Pointed Needlefish Game Dev Fish Armoured Searobin Ash Lionfish Barefrost Toothfish Blackfin Icefish Basalt Pipefish Brimstone Spikefish Cinder Leviathan Crowned Flame Angelfish Deepwater Lanternfish Driftice Capelin Ember Chub Embermark Wrasse Eviota Vader Frost Herring Frost Wolf Eel Frostpaint Notie Frozen Grenadier Giant Trevally Glacial Lanternfish Glacial Silverfish Heatwarp Flounder Hatchetfish Ice Spined Notothenia Iceshelf Skate Icy Sculpin Lavaflow Trout Lavawake Slopefish Magma Sardinella Magma Trout Marbled Moray Cod Molten Lotella Cod Northern Wolffish Paleice Rockcod Permafrost Halibut Pithead Polarflash Electron Pyroclast Eel Pyroscale Grouper Red Pyreside Rimesnouted Lancetfish Scorched Sunfish Scored Dace Silver Dragonfish Snow Haddock Volcanic Catfish Volcanic Semperi Rusty Rod Lucky Rod Sturdy Rod Jungle Rod Draugr Rod Cursed Rod Tangle Resistant Rod Speed Rod Carbon Rod Deep Sea Rod Master Rod Obsidian Rod Molten Magma Rod Frost Rod Black Ice Rod Mythic Rod Acorn Acorn Jelly Cow's Milk Cheese Caught Fish Fish Fillet Meaty Bone Blinding Pebble Sheep's Milk Yoghurt Pot Truffle Truffle Oil Oats Porridge Poop Fertiliser Medkit Wood Spear Stone Spear Iron Spear Gold Spear Diamond Spear Moonstone Spear Wood Dagger Stone Dagger Iron Dagger Gold Dagger Diamond Dagger Moonstone Dagger Wood Boomerang Stone Boomerang Iron Boomerang Gold Boomerang Diamond Boomerang Moonstone Boomerang Wood Club Stone Club Iron Club Gold Club Diamond Club Moonstone Club Wood Mace Stone Mace Iron Mace Gold Mace Diamond Mace Moonstone Mace Wood Whip Stone Whip Iron Whip Gold Whip Diamond Whip Moonstone Whip Beef Stew Chicken Coleslaw Egg Fish N Chips Fried Rice Lettuce Omelette Onion Red Cabbage Roast Dinner Salad Stuffed Pepper Sushi Tomato Vegetable Soup Wood Pickaxe Stone Pickaxe Iron Pickaxe Gold Pickaxe Diamond Pickaxe Moonstone Pickaxe Golem Pickaxe Wood Axe Stone Axe Iron Axe Gold Axe Diamond Axe Moonstone Axe Artisan Axe Wood Spade Stone Spade Iron Spade Gold Spade Diamond Spade Wood Sword Stone Sword Iron Sword Gold Sword Diamond Sword Knight Sword Wood Hoe Stone Hoe Iron Hoe Gold Hoe Diamond Hoe Wood Helmet Iron Helmet Gold Helmet Diamond Helmet Wood Chestplate Iron Chestplate Gold Chestplate Diamond Chestplate Fur Chestplate Wood Leggings Iron Leggings Gold Leggings Diamond Leggings Wood Boots Iron Boots Gold Boots Diamond Boots Spiked Boots Wood Gauntlets Iron Gauntlets Gold Gauntlets Diamond Gauntlets White Wood Helmet White Wood Chestplate White Wood Leggings White Wood Boots White Wood Gauntlets Orange Wood Helmet Orange Wood Chestplate Orange Wood Leggings Orange Wood Boots Orange Wood Gauntlets Magenta Wood Helmet Magenta Wood Chestplate Magenta Wood Leggings Magenta Wood Boots Magenta Wood Gauntlets Light Blue Wood Helmet Light Blue Wood Chestplate Light Blue Wood Leggings Light Blue Wood Boots Light Blue Wood Gauntlets Yellow Wood Helmet Yellow Wood Chestplate Yellow Wood Leggings Yellow Wood Boots Yellow Wood Gauntlets Lime Wood Helmet Lime Wood Chestplate Lime Wood Leggings Lime Wood Boots Lime Wood Gauntlets Pink Wood Helmet Pink Wood Chestplate Pink Wood Leggings Pink Wood Boots Pink Wood Gauntlets Gray Wood Helmet Gray Wood Chestplate Gray Wood Leggings Gray Wood Boots Gray Wood Gauntlets Light Gray Wood Helmet Light Gray Wood Chestplate Light Gray Wood Leggings Light Gray Wood Boots Light Gray Wood Gauntlets Cyan Wood Helmet Cyan Wood Chestplate Cyan Wood Leggings Cyan Wood Boots Cyan Wood Gauntlets Purple Wood Helmet Purple Wood Chestplate Purple Wood Leggings Purple Wood Boots Purple Wood Gauntlets Blue Wood Helmet Blue Wood Chestplate Blue Wood Leggings Blue Wood Boots Blue Wood Gauntlets Brown Wood Helmet Brown Wood Chestplate Brown Wood Leggings Brown Wood Boots Brown Wood Gauntlets Green Wood Helmet Green Wood Chestplate Green Wood Leggings Green Wood Boots Green Wood Gauntlets Red Wood Helmet Red Wood Chestplate Red Wood Leggings Red Wood Boots Red Wood Gauntlets Black Wood Helmet Black Wood Chestplate Black Wood Leggings Black Wood Boots Black Wood Gauntlets Shears Artisan Shears Stick Coal Raw Iron Iron Bar Iron Fragment Raw Gold Gold Bar Gold Fragment Diamond Diamond Fragment Moonstone Moonstone Fragment Bowl Partially Full Bowl of Cranberries Half Full Bowl of Cranberries Nearly Full Bowl of Cranberries Bowl of Cranberries Mushroom Soup Cotton Bucket Water Bucket Lava Bucket Boat INTERNAL_MESH_Boat Obsidian Boat INTERNAL_MESH_Obsidian Boat Wood Hang Glider INTERNAL_MESH_Wood Hang Glider Iron Hang Glider INTERNAL_MESH_Iron Hang Glider Gold Hang Glider INTERNAL_MESH_Gold Hang Glider Diamond Hang Glider INTERNAL_MESH_Diamond Hang Glider INTERNAL_MESH_Kart Snowball Snowball Launcher Pebble Reinforced Pebble Ball Reinforced Ball Moonstone Orb Fireball Bouncy Bomb RPG Obby RPG Super RPG Grenade Launcher Iceball 67 Base Projectile 67 Boosted Projectile Capitano Grenade Scatter Pellet Wood Bow Wood Bow|meta|charging2 Wood Bow|meta|charging3 Wood Bow|meta|charging4 Stone Bow Stone Bow|meta|charging2 Stone Bow|meta|charging3 Stone Bow|meta|charging4 Iron Bow Iron Bow|meta|charging2 Iron Bow|meta|charging3 Iron Bow|meta|charging4 Gold Bow Gold Bow|meta|charging2 Gold Bow|meta|charging3 Gold Bow|meta|charging4 Diamond Bow Diamond Bow|meta|charging2 Diamond Bow|meta|charging3 Diamond Bow|meta|charging4 Wood Crossbow Wood Crossbow|meta|charging2 Wood Crossbow|meta|charging3 Wood Crossbow|meta|charging4 Stone Crossbow Stone Crossbow|meta|charging2 Stone Crossbow|meta|charging3 Stone Crossbow|meta|charging4 Iron Crossbow Iron Crossbow|meta|charging2 Iron Crossbow|meta|charging3 Iron Crossbow|meta|charging4 Gold Crossbow Gold Crossbow|meta|charging2 Gold Crossbow|meta|charging3 Gold Crossbow|meta|charging4 Diamond Crossbow Diamond Crossbow|meta|charging2 Diamond Crossbow|meta|charging3 Diamond Crossbow|meta|charging4 Wood Crossbow Charged Stone Crossbow Charged Iron Crossbow Charged Gold Crossbow Charged Diamond Crossbow Charged Arrow Compass Compass|meta|dir2 Compass|meta|dir3 Compass|meta|dir4 Compass|meta|dir5 Compass|meta|dir6 Compass|meta|dir7 Compass|meta|dir8 Compass|meta|dir9 Compass|meta|dir10 Compass|meta|dir11 Compass|meta|dir12 Bread Bowl of Rice Apple Plum Coconut Cracked Coconut Pear Cherry Banana Watermelon Slice Gold Watermelon Slice Melon Slice Gold Melon Slice Pumpkin Pie Corn Cornbread Chili Pepper Mango Carrot Raw Potato Baked Potato Beetroot Raw Porkchop Cooked Porkchop Raw Beef Steak Raw Mutton Cooked Mutton Raw Venison Cooked Venison Rotten Flesh Rotten Brain Bone Bone Meal Leather Saddle Spirit Saddle Fur Golem Eye Knight Heart Name Tag Book Empty Bottle Water Bottle Slowness Potion Slowness Potion II Splash Slowness Potion Splash Slowness Potion II Arrow of Slowness Poison Potion Poison Potion II Splash Poison Potion Splash Poison Potion II Arrow of Poison Weakness Potion Weakness Potion II Splash Weakness Potion Splash Weakness Potion II Arrow of Weakness Instant Damage Potion Instant Damage Potion II Splash Instant Damage Potion Splash Instant Damage Potion II Arrow of Instant Damage Milk Potion Splash Milk Potion Arrow of Milk Speed Potion Speed Potion II Splash Speed Potion Splash Speed Potion II Arrow of Speed Defense Potion Defense Potion II Splash Defense Potion Splash Defense Potion II Arrow of Defense Strength Potion Strength Potion II Splash Strength Potion Splash Strength Potion II Arrow of Strength Invisibility Potion Splash Invisibility Potion Arrow of Invisibility Jump Potion Jump Potion II Splash Jump Potion Splash Jump Potion II Arrow of Jumping Knockback Potion Splash Knockback Potion Splash Knockback Potion II Arrow of Knockback Regeneration Potion Regeneration Potion II Splash Regeneration Potion Splash Regeneration Potion II Arrow of Regeneration Instant Healing Potion Instant Healing Potion II Splash Instant Healing Potion Splash Instant Healing Potion II Arrow of Instant Healing Haste Potion Haste Potion II Splash Haste Potion Splash Haste Potion II Arrow of Haste Shield Potion Shield Potion II Splash Shield Potion Splash Shield Potion II Arrow of Shield Double Jump Potion Splash Double Jump Potion Arrow of Double Jump Heat Resistance Potion Splash Heat Resistance Potion Arrow of Heat Resistance X-Ray Vision Potion Splash X-Ray Vision Potion Arrow of X-Ray Vision Mining Yield Potion Mining Yield Potion II Splash Mining Yield Potion Splash Mining Yield Potion II Arrow of Mining Yield Brain Rot Potion Splash Brain Rot Potion Arrow of Brain Rot Chaos Potion Ammo AK-47 AK-47|RequiresAmmo M16 M16|RequiresAmmo MP40 MP40|RequiresAmmo TAR-21 TAR-21|RequiresAmmo M1911 M1911|RequiresAmmo One Shot Pistol One Shot Pistol|RequiresAmmo Double Barrel Double Barrel|RequiresAmmo AWP AWP|RequiresAmmo Deagle Deagle|RequiresAmmo Striker-12 Striker-12|RequiresAmmo VSR VSR|RequiresAmmo Minigun Minigun|RequiresAmmo FMR FMR|RequiresAmmo Gold Coin Updraft Snowdash Floor Creator Moonstone Remote Explosive Moonstone Remote Ice Bridge Yellow Balloon White Balloon Red Balloon Purple Balloon Pink Balloon Orange Balloon Magenta Balloon Lime Balloon Light Gray Balloon Light Blue Balloon Green Balloon Gray Balloon Cyan Balloon Brown Balloon Blue Balloon Black Balloon INTERNAL_MESH_Yellow Balloon INTERNAL_MESH_White Balloon INTERNAL_MESH_Red Balloon INTERNAL_MESH_Purple Balloon INTERNAL_MESH_Pink Balloon INTERNAL_MESH_Orange Balloon INTERNAL_MESH_Magenta Balloon INTERNAL_MESH_Lime Balloon INTERNAL_MESH_Light Gray Balloon INTERNAL_MESH_Light Blue Balloon INTERNAL_MESH_Green Balloon INTERNAL_MESH_Gray Balloon INTERNAL_MESH_Cyan Balloon INTERNAL_MESH_Brown Balloon INTERNAL_MESH_Blue Balloon INTERNAL_MESH_Black Balloon Yellow Popup Tower White Popup Tower Red Popup Tower Purple Popup Tower Pink Popup Tower Orange Popup Tower Magenta Popup Tower Lime Popup Tower Light Gray Popup Tower Light Blue Popup Tower Green Popup Tower Gray Popup Tower Cyan Popup Tower Brown Popup Tower Blue Popup Tower Black Popup Tower Yellow Paintball Gun White Paintball Gun Red Paintball Gun Purple Paintball Gun Pink Paintball Gun Orange Paintball Gun Magenta Paintball Gun Lime Paintball Gun Light Gray Paintball Gun Light Blue Paintball Gun Green Paintball Gun Gray Paintball Gun Cyan Paintball Gun Brown Paintball Gun Blue Paintball Gun Black Paintball Gun Yellow Paintball White Paintball Red Paintball Purple Paintball Pink Paintball Orange Paintball Magenta Paintball Lime Paintball Light Gray Paintball Light Blue Paintball Green Paintball Gray Paintball Cyan Paintball Brown Paintball Blue Paintball Black Paintball Yellow Heavy Paintball Gun White Heavy Paintball Gun Red Heavy Paintball Gun Purple Heavy Paintball Gun Pink Heavy Paintball Gun Orange Heavy Paintball Gun Magenta Heavy Paintball Gun Lime Heavy Paintball Gun Light Gray Heavy Paintball Gun Light Blue Heavy Paintball Gun Green Heavy Paintball Gun Gray Heavy Paintball Gun Cyan Heavy Paintball Gun Brown Heavy Paintball Gun Blue Heavy Paintball Gun Black Heavy Paintball Gun Yellow Paintball Explosive Item White Paintball Explosive Item Red Paintball Explosive Item Purple Paintball Explosive Item Pink Paintball Explosive Item Orange Paintball Explosive Item Magenta Paintball Explosive Item Lime Paintball Explosive Item Light Gray Paintball Explosive Item Light Blue Paintball Explosive Item Green Paintball Explosive Item Gray Paintball Explosive Item Cyan Paintball Explosive Item Brown Paintball Explosive Item Blue Paintball Explosive Item Black Paintball Explosive Item Yellow Sticky Paintball Explosive Item White Sticky Paintball Explosive Item Red Sticky Paintball Explosive Item Purple Sticky Paintball Explosive Item Pink Sticky Paintball Explosive Item Orange Sticky Paintball Explosive Item Magenta Sticky Paintball Explosive Item Lime Sticky Paintball Explosive Item Light Gray Sticky Paintball Explosive Item Light Blue Sticky Paintball Explosive Item Green Sticky Paintball Explosive Item Gray Sticky Paintball Explosive Item Cyan Sticky Paintball Explosive Item Brown Sticky Paintball Explosive Item Blue Sticky Paintball Explosive Item Black Sticky Paintball Explosive Item Yellow Seeking Paintball Explosive Item White Seeking Paintball Explosive Item Red Seeking Paintball Explosive Item Purple Seeking Paintball Explosive Item Pink Seeking Paintball Explosive Item Orange Seeking Paintball Explosive Item Magenta Seeking Paintball Explosive Item Lime Seeking Paintball Explosive Item Light Gray Seeking Paintball Explosive Item Light Blue Seeking Paintball Explosive Item Green Seeking Paintball Explosive Item Gray Seeking Paintball Explosive Item Cyan Seeking Paintball Explosive Item Brown Seeking Paintball Explosive Item Blue Seeking Paintball Explosive Item Black Seeking Paintball Explosive Item Yellow Quick Paintball Explosive Item White Quick Paintball Explosive Item Red Quick Paintball Explosive Item Purple Quick Paintball Explosive Item Pink Quick Paintball Explosive Item Orange Quick Paintball Explosive Item Magenta Quick Paintball Explosive Item Lime Quick Paintball Explosive Item Light Gray Quick Paintball Explosive Item Light Blue Quick Paintball Explosive Item Green Quick Paintball Explosive Item Gray Quick Paintball Explosive Item Cyan Quick Paintball Explosive Item Brown Quick Paintball Explosive Item Blue Quick Paintball Explosive Item Black Quick Paintball Explosive Item Yellow Paint Bow Yellow Paint Bow|meta|charging2 Yellow Paint Bow|meta|charging3 Yellow Paint Bow|meta|charging4 White Paint Bow White Paint Bow|meta|charging2 White Paint Bow|meta|charging3 White Paint Bow|meta|charging4 Red Paint Bow Red Paint Bow|meta|charging2 Red Paint Bow|meta|charging3 Red Paint Bow|meta|charging4 Purple Paint Bow Purple Paint Bow|meta|charging2 Purple Paint Bow|meta|charging3 Purple Paint Bow|meta|charging4 Pink Paint Bow Pink Paint Bow|meta|charging2 Pink Paint Bow|meta|charging3 Pink Paint Bow|meta|charging4 Orange Paint Bow Orange Paint Bow|meta|charging2 Orange Paint Bow|meta|charging3 Orange Paint Bow|meta|charging4 Magenta Paint Bow Magenta Paint Bow|meta|charging2 Magenta Paint Bow|meta|charging3 Magenta Paint Bow|meta|charging4 Lime Paint Bow Lime Paint Bow|meta|charging2 Lime Paint Bow|meta|charging3 Lime Paint Bow|meta|charging4 Light Gray Paint Bow Light Gray Paint Bow|meta|charging2 Light Gray Paint Bow|meta|charging3 Light Gray Paint Bow|meta|charging4 Light Blue Paint Bow Light Blue Paint Bow|meta|charging2 Light Blue Paint Bow|meta|charging3 Light Blue Paint Bow|meta|charging4 Green Paint Bow Green Paint Bow|meta|charging2 Green Paint Bow|meta|charging3 Green Paint Bow|meta|charging4 Gray Paint Bow Gray Paint Bow|meta|charging2 Gray Paint Bow|meta|charging3 Gray Paint Bow|meta|charging4 Cyan Paint Bow Cyan Paint Bow|meta|charging2 Cyan Paint Bow|meta|charging3 Cyan Paint Bow|meta|charging4 Brown Paint Bow Brown Paint Bow|meta|charging2 Brown Paint Bow|meta|charging3 Brown Paint Bow|meta|charging4 Blue Paint Bow Blue Paint Bow|meta|charging2 Blue Paint Bow|meta|charging3 Blue Paint Bow|meta|charging4 Black Paint Bow Black Paint Bow|meta|charging2 Black Paint Bow|meta|charging3 Black Paint Bow|meta|charging4 Pig Spawn Orb Cow Spawn Orb Sheep Spawn Orb Horse Spawn Orb Deer Spawn Orb Wolf Spawn Orb Wildcat Spawn Orb Spirit Golem Spawn Orb Spirit Wolf Spawn Orb Spirit Bear Spawn Orb Spirit Stag Spawn Orb Spirit Gorilla Spawn Orb Bear Spawn Orb Stag Spawn Orb Gold Watermelon Stag Spawn Orb Gorilla Spawn Orb Cave Golem Spawn Orb Draugr Zombie Spawn Orb Draugr Skeleton Spawn Orb Frost Golem Spawn Orb Frost Zombie Spawn Orb Frost Skeleton Spawn Orb Draugr Knight Spawn Orb Draugr Huntress Spawn Orb Magma Golem Spawn Orb Draugr Warper Spawn Orb Frost Wraith Spawn Orb Draugr Reaver Spawn Orb Mob Catcher Caught Mob Pig Default Caught Mob Cow Default Caught Mob Cow Cream Caught Mob Sheep Default Caught Mob Sheep Black Caught Mob Sheep Red Caught Mob Sheep Orange Caught Mob Sheep Pink Caught Mob Sheep Purple Caught Mob Sheep Yellow Caught Mob Sheep Blue Caught Mob Sheep Brown Caught Mob Sheep Cyan Caught Mob Sheep Gray Caught Mob Sheep Green Caught Mob Sheep Lightblue Caught Mob Sheep Lightgray Caught Mob Sheep Lime Caught Mob Sheep Magenta Caught Mob Horse Default Caught Mob Horse Black Caught Mob Horse Brown Caught Mob Horse Cream Caught Mob Deer Default Caught Mob Wolf Default Caught Mob Wolf White Caught Mob Wolf Brown Caught Mob Wolf Grey Caught Mob Wolf Spectral Caught Mob Wildcat Default Caught Mob Wildcat Tabby Caught Mob Wildcat Grey Caught Mob Wildcat Black Caught Mob Wildcat Calico Caught Mob Wildcat Siamese Caught Mob Wildcat Leopard Caught Mob Spirit_Golem Default Caught Mob Spirit_Wolf Default Caught Mob Spirit_Bear Default Caught Mob Spirit_Stag Default Caught Mob Spirit_Gorilla Default Caught Mob Bear Default Caught Mob Stag Default Caught Mob Gold_Watermelon_Stag Default Caught Mob Gorilla Default Caught Mob Cave_Golem Default Caught Mob Cave_Golem Iron Caught Mob Draugr_Zombie Default Caught Mob Draugr_Zombie Longhairchestplate Caught Mob Draugr_Zombie Longhairclothed Caught Mob Draugr_Zombie Shorthairclothed Caught Mob Draugr_Skeleton Default Caught Mob Frost_Golem Default Caught Mob Frost_Zombie Default Caught Mob Frost_Zombie Longhairchestplate Caught Mob Frost_Zombie Shorthairclothed Caught Mob Frost_Skeleton Default Caught Mob Draugr_Knight Default Caught Mob Draugr_Huntress Default Caught Mob Draugr_Huntress Chainmail Caught Mob Magma_Golem Default Caught Mob Draugr_Warper Default Caught Mob Frost_Wraith Default Caught Mob Draugr_Reaver Default Caught Mob NPC Default Caught Mob NPC Emma Caught Mob NPC Leo Caught Mob NPC Isabel Caught Mob NPC Sanjay Caught Mob NPC Imara Caught Mob NPC Enoch Caught Mob NPC Sara Caught Mob NPC Carmen Caught Mob 67 Default Caught Mob Bobino_Musculino Default Caught Mob Capitano_Explovissimo Default Timed Spike Bomb Timed Spike Bomb|meta|charging2 Timed Spike Bomb|meta|charging3 Timed Spike Bomb|meta|charging4 Toxin Ball Aura XP Fragment Aura XP Orb Aura XP Potion Aura XP Potion II Splash Aura XP Potion Splash Aura XP Potion II Arrow of Aura XP Firecracker Rainbow Firecracker Yellow Firecracker White Firecracker Red Firecracker Purple Firecracker Pink Firecracker Orange Firecracker Magenta Firecracker Lime Firecracker Light Gray Firecracker Light Blue Firecracker Green Firecracker Gray Firecracker Cyan Firecracker Brown Firecracker Blue Firecracker Black Firecracker Firecracker Pebble Rainbow Firecracker Pebble Yellow Firecracker Pebble White Firecracker Pebble Red Firecracker Pebble Purple Firecracker Pebble Pink Firecracker Pebble Orange Firecracker Pebble Magenta Firecracker Pebble Lime Firecracker Pebble Light Gray Firecracker Pebble Light Blue Firecracker Pebble Green Firecracker Pebble Gray Firecracker Pebble Cyan Firecracker Pebble Brown Firecracker Pebble Blue Firecracker Pebble Black Firecracker Pebble WorldBuilder Wand Red Strongfish Green Strongfish Moon Strongfish Wheatfish Moonfish Bombfish Boomerang Fish Root Flounder Abyss Carp Boulder Bass Barnaclejaw Crystalized Wheatfish Darter Shadow Darter Electric Eel Grass Snapper Jungle Spinefish Mangler Catfish Mossback Arapaima Sandbelly Piranha Shadeback Ray Mudbelly Tilapia Mireback Carp Rotslab Eel Aether Minnow Murkborne Ray Eldertide Leviathan Oarfish Alpha Moon Strongfish Bamboo Catfish Blackwater Bream Blackwater Leviathan Boned Sturgeon Bull Shark Channel Sawfish Coastal Mullet Coelacanth Driftwood Catfish Eagle Ray Giant Grouper Giant Moray Giant Stingray Golden Mahseer Greenfin Loach Mangrove Herring Moonlit Boomerang Fish Moonstone Pupfish Mudline Perch Murk Stingray Needlefish Nomai Moray Pearlescent Moonfish Rainbow Guppy Red Snapper Reedglass Minnow Reef Sardine Root Perch Rust Scad Seahorse Snakehead Spined Stickleback Stone Grouper Sumpback Carp Sunset Minnow Tarpon Threadfin Bream Tri-Pointed Needlefish Game Dev Fish Armoured Searobin Ash Lionfish Barefrost Toothfish Blackfin Icefish Basalt Pipefish Brimstone Spikefish Cinder Leviathan Crowned Flame Angelfish Deepwater Lanternfish Driftice Capelin Ember Chub Embermark Wrasse Eviota Vader Frost Herring Frost Wolf Eel Frostpaint Notie Frozen Grenadier Giant Trevally Glacial Lanternfish Glacial Silverfish Heatwarp Flounder Hatchetfish Ice Spined Notothenia Iceshelf Skate Icy Sculpin Lavaflow Trout Lavawake Slopefish Magma Sardinella Magma Trout Marbled Moray Cod Molten Lotella Cod Northern Wolffish Paleice Rockcod Permafrost Halibut Pithead Polarflash Electron Pyroclast Eel Pyroscale Grouper Red Pyreside Rimesnouted Lancetfish Scorched Sunfish Scored Dace Silver Dragonfish Snow Haddock Volcanic Catfish Volcanic Semperi Rusty Rod Lucky Rod Sturdy Rod Jungle Rod Draugr Rod Cursed Rod Tangle Resistant Rod Speed Rod Carbon Rod Deep Sea Rod Master Rod Obsidian Rod Molten Magma Rod Frost Rod Black Ice Rod Mythic Rod Acorn Acorn Jelly Cow's Milk Cheese Caught Fish Fish Fillet Meaty Bone Blinding Pebble Sheep's Milk Yoghurt Pot Truffle Truffle Oil Oats Porridge Poop Fertiliser Medkit Wood Spear Stone Spear Iron Spear Gold Spear Diamond Spear Moonstone Spear Wood Dagger Stone Dagger Iron Dagger Gold Dagger Diamond Dagger Moonstone Dagger Wood Boomerang Stone Boomerang Iron Boomerang Gold Boomerang Diamond Boomerang Moonstone Boomerang Wood Club Stone Club Iron Club Gold Club Diamond Club Moonstone Club Wood Mace Stone Mace Iron Mace Gold Mace Diamond Mace Moonstone Mace Wood Whip Stone Whip Iron Whip Gold Whip Diamond Whip Moonstone Whip Beef Stew Chicken Coleslaw Egg Fish N Chips Fried Rice Lettuce Omelette Onion Red Cabbage Roast Dinner Salad Stuffed Pepper Sushi Tomato Vegetable Soup # Mesh Entities, Throwables & Node Mesh Attachment Mesh entities are server-created 3D objects whose position is synced with all clients. Throwables are a specialised subset that use the engine's built-in projectile physics. Node mesh attachment lets you attach additional meshes to specific bones/nodes of an existing entity (e.g. a weapon on a player's hand). ## Limits - There is a limit to the number of mesh entities and throwables that can be created. `attemptCreateMeshEntity` returns `null` when the limit is reached instead of throwing. - There are two separate limits: one for mesh entities without physics and one for mesh entities with physics (which is a lot smaller). --- ## Mesh Entities ### Mesh Types There are four mesh types, each with different options: - **`Box`** - **`BloxdBlock`** - **`Person`** - **`ParticleEmitter`** #### `Box` ```ts type BoxOpts = { hideDist?: number meshOffset?: number[] autoRotate?: boolean lineToEId?: EntityId // EntityId to connect to using a line width: number height: number depth: number diffuseColor?: number[] emissiveColor?: number[] backFaceCulling?: boolean // Default true texture?: string // Can be a blockname. Wraps every one block faceUV?: number[][] } ``` #### `BloxdBlock` ```ts type BloxdBlockOpts = { hideDist?: number meshOffset?: number[] autoRotate?: boolean lineToEId?: EntityId // EntityId to connect to using a line blockName: BlockNameOrId size: number | [number, number, number] } ``` #### `Person` ```ts type PersonOpts = { hideDist?: number meshOffset?: number[] autoRotate?: boolean lineToEId?: EntityId // EntityId to connect to using a line size?: number textures?: Partial pose?: PlayerPose } ``` #### `ParticleEmitter` ```ts type ParticleEmitterOpts = { texture: string minLifeTime: number maxLifeTime: number minEmitPower: number maxEmitPower: number minSize: number maxSize: number gravity: number[] velocityGradients: VelocityGradient[] colorGradients: TimeColorGradient[] | RandomColorGradient[] blendMode: ParticleSystemBlendMode hideDist?: number meshOffset?: number[] autoRotate?: boolean lineToEId?: EntityId // EntityId to connect to using a line height: number width: number depth: number emitRate: number dir1?: number[] dir2?: number[] } ``` ### Creating a Mesh Entity ```ts /** * Try to create a mesh entity. This creates an entity whose mesh position is synced with clients. * Set entity position using setPosition * There is a limit to the number of mesh entities and throwables that can be created, with an even smaller limit for mesh entities with physics. * * @param {MeshType} type * @param {MeshEntityOpts[MeshType]} opts * @param {string} [name] - The default name for the nametag * @param {MeshEntityPhysicsOpts} [physicsOptions] - Physics Options * @param {EntityId} [initiatorId] - The entity that initiated the creation of the mesh entity. * @returns {PNull} - null if the entity creation failed, otherwise the entity ID. */ attemptCreateMeshEntity(type, opts, name, physicsOptions, initiatorId) ``` Use `api.setPosition()` to move the entity after creation. #### Examples Create a red box: ```ts const boxId = api.attemptCreateMeshEntity("Box", { width: 1, height: 1, depth: 1, diffuseColor: [255, 0, 0], }) if (boxId) { api.setPosition(boxId, 10, 50, 10) } ``` Create a Bloxd block mesh: ```ts const blockId = api.attemptCreateMeshEntity("BloxdBlock", { blockName: "Block of Diamond", size: 1, }) ``` Create a person mesh: ```ts const personId = api.attemptCreateMeshEntity("Person", { size: 1, pose: "standing", textures: { head: "trader_black" }, }, "Bedwars Merchant") ``` Create a mesh entity with physics: ```ts const physicsBoxId = api.attemptCreateMeshEntity( "Box", { width: 0.5, height: 0.5, depth: 0.5, diffuseColor: [0, 255, 0] }, "", { doPhysics: true, collidesEntities: true, collideBits: 1, collideMask: 1, }, ) ``` ### Updating a Mesh Entity ```ts /** * Update a mesh entity. If used on a non-mesh entity, will do nothing. * * @param {EntityId} eId * @param {MeshType} type * @param {MeshEntityOpts[MeshType]} opts * @returns {void} */ updateMeshEntity(eId, type, opts) ``` ```ts api.updateMeshEntity(boxId, "Box", { width: 2, height: 2, depth: 2, diffuseColor: [0, 0, 255], }) ``` ### Deleting a Mesh Entity ```ts /** * Delete a mesh entity * * @param {EntityId} eId * @returns {boolean} */ deleteMeshEntity(eId) ``` ```ts api.deleteMeshEntity(boxId) ``` --- ## Throwables Throwables use the engine's built-in projectile system. Each throwable item has predefined velocity, damage, and gravity. You can multiply these defaults with the `velocityMult`, `damageMult`, and `gravityMult` parameters. ### Creating a Throwable ```ts /** * Try to create a throwable entity. * Similar to creating a mesh entity and uses the same rate limiting. * However, this uses the predefined throwables system and physics used by throwable items with the game * Each throwable item has its own behaviour already, including default velocity, damage and gravity multipliers. * * @param {EntityId} throwerEId * @param {ThrowableItem} itemName - Must be an Item that is usually throwable in-engine * @param {[number, number, number]} position - Starting position * @param {[number, number, number]} direction * @param {number} [velocityMult] - Multiplier for the default velocity of the throwable item * @param {number} [damageMult] - Multiplier for the default damage of the throwable item * @param {number} [gravityMult] - Multiplier for the default gravity of the throwable item * @param {ItemAttributes} [attributes] - item attributes (currently used only for the "Boomerag" item) * @returns {string} - null if throwable creation failed, otherwise the entity ID. */ attemptCreateThrowable(throwerEId, itemName, position, direction, velocityMult, damageMult, gravityMult, attributes) ``` #### Example ```ts const pos = api.getPosition(playerId) const { dir } = api.getPlayerFacingInfo(playerId) const throwableId = api.attemptCreateThrowable( playerId, "Fireball", [pos[0], pos[1] + 1.5, pos[2]], dir, 2, // double velocity 1.5, // 1.5x damage ) ``` ### Deleting a Throwable Some throwables are deleted automatically when they hit a block or entity, or despawn after a certain time. You can delete them manually with this method. ```ts /** * Delete a throwable entity before it automatically removes itself. * * @param {EntityId} eId * @returns {boolean} - true if the entity was deleted, false if it was not a throwable entity */ deleteThrowable(eId) ``` ```ts api.deleteThrowable(throwableId) ``` --- ## Node Mesh Attachment Attach or detach a mesh to a specific node ("bone") of an entity. This is useful for attaching items, effects, or decorations to player body parts or other entity nodes. ```ts /** * Attach/detach mesh instances to/from an entity * * @param {EntityId} eId * @param {EntityNamedNode} node - node to attach to * @param {PNull} type - if null, detaches mesh from this node * @param {MeshEntityOpts[MeshType]} [opts] * @param {[number, number, number]} [offset] * @param {[number, number, number]} [rotation] * @returns {void} */ updateEntityNodeMeshAttachment(eId, node, type, opts, offset, rotation) ``` ### Available Nodes `EntityNamedNode` is one of: - `"TorsoNode"` - `"HeadMesh"` - `"ArmRightMesh"` - `"ArmLeftMesh"` - `"LegLeftMesh"` - `"LegRightMesh"` ### Examples Attach a block to a player's right arm: ```ts api.updateEntityNodeMeshAttachment( playerId, "ArmRightMesh", "BloxdBlock", { blockName: "Diamond Block", size: 0.3 }, [0, -0.5, 0], // offset [0, 0, 0], // rotation ) ``` Attach a glowing box to a player's head: ```ts api.updateEntityNodeMeshAttachment( playerId, "HeadMesh", "Box", { width: 0.3, height: 0.3, depth: 0.3, emissiveColor: [255, 215, 0] }, [0, 0.5, 0], ) ``` Detach a mesh from a node: ```ts api.updateEntityNodeMeshAttachment(playerId, "ArmRightMesh", null) ``` --- ## Types Glossary Reference types that you may find useful. ### `MeshEntityOpts` ```ts type MeshEntityOpts = { Box: CommonMeshEntityOpts & { width: number height: number depth: number diffuseColor?: number[] emissiveColor?: number[] backFaceCulling?: boolean // Default true texture?: string // Can be a blockname. Wraps every one block faceUV?: number[][] } BloxdBlock: CommonMeshEntityOpts & { blockName: BlockNameOrId size: number | [number, number, number] } Person: CommonMeshEntityOpts & { size?: number textures?: Partial pose?: PlayerPose } ParticleEmitter: MeshParticleSystemOpts } ``` ### `CommonMeshEntityOpts` ```ts type CommonMeshEntityOpts = { hideDist?: number meshOffset?: number[] autoRotate?: boolean lineToEId?: EntityId // EntityId to connect to using a line } ``` ### `MeshEntityPhysicsOpts` ```ts type MeshEntityPhysicsOpts = { doPhysics: boolean onCollideTerrain?: () => void // Unsupported for custom code collidesEntities?: boolean collideBits?: number // bitmask category of this entity collideMask?: number // bitmask category of entities this entity collides with heightExpandAmt?: number // expand hitbox height by this amount widthExpandAmt?: number // expand hitbox width by this amount vehicleOpts?: MeshEntityVehicleOpts // Unsupported for custom code } ``` ### `MeshParticleSystemOpts` ```ts type MeshParticleSystemOpts = ParticleSystemOpts & CommonMeshEntityOpts & { height: number width: number depth: number emitRate: number dir1?: number[] dir2?: number[] } ``` ### `ParticleSystemOpts` ```ts type ParticleSystemOpts = { texture: string minLifeTime: number maxLifeTime: number minEmitPower: number maxEmitPower: number minSize: number maxSize: number gravity: number[] velocityGradients: VelocityGradient[] colorGradients: TimeColorGradient[] | RandomColorGradient[] blendMode: ParticleSystemBlendMode } ``` ### `TimeColorGradient` ```ts type TimeColorGradient = { timeFraction: number minColor: [number, number, number, number] maxColor?: [number, number, number, number] } ``` ### `RandomColorGradient` ```ts type RandomColorGradient = { color: [number, number, number] } ``` ### `VelocityGradient` ```ts type VelocityGradient = { timeFraction: number factor: number factor2: number } ``` ### `ParticleSystemBlendMode` ```ts enum ParticleSystemBlendMode { // Source color is added to the destination color without alpha affecting the result OneOne = 0, // Blend current color and particle color using particle's alpha Standard = 1, // Add current color and particle color multiplied by particle's alpha Add, // Multiply current color with particle color Multiply, // Multiply current color with particle color then add current color and particle color multiplied by particle's alpha MultiplyAdd, } ``` ### `EntityNamedNode` Nodes on a player/entity skeleton that meshes can be attached to. ```ts type EntityNamedNode = "TorsoNode" | "HeadMesh" | "ArmRightMesh" | "ArmLeftMesh" | "LegLeftMesh" | "LegRightMesh" ``` # Mesh Entities, Throwables & Node Mesh Attachment Mesh entities are server-created 3D objects whose position is synced with all clients. Throwables are a specialised subset that use the engine's built-in projectile physics. Node mesh attachment lets you attach additional meshes to specific bones/nodes of an existing entity (e.g. a weapon on a player's hand). ## Limits - There is a limit to the number of mesh entities and throwables that can be created. `attemptCreateMeshEntity` returns `null` when the limit is reached instead of throwing. - There are two separate limits: one for mesh entities without physics and one for mesh entities with physics (which is a lot smaller). --- ## Mesh Entities ### Mesh Types There are four mesh types, each with different options: - **`Box`** - **`BloxdBlock`** - **`Person`** - **`ParticleEmitter`** #### `Box` ```ts type BoxOpts = { hideDist?: number meshOffset?: number[] autoRotate?: boolean lineToEId?: EntityId // EntityId to connect to using a line width: number height: number depth: number diffuseColor?: number[] emissiveColor?: number[] backFaceCulling?: boolean // Default true texture?: string // Can be a blockname. Wraps every one block faceUV?: number[][] } ``` #### `BloxdBlock` ```ts type BloxdBlockOpts = { hideDist?: number meshOffset?: number[] autoRotate?: boolean lineToEId?: EntityId // EntityId to connect to using a line blockName: BlockNameOrId size: number | [number, number, number] } ``` #### `Person` ```ts type PersonOpts = { hideDist?: number meshOffset?: number[] autoRotate?: boolean lineToEId?: EntityId // EntityId to connect to using a line size?: number textures?: Partial pose?: PlayerPose } ``` #### `ParticleEmitter` ```ts type ParticleEmitterOpts = { texture: string minLifeTime: number maxLifeTime: number minEmitPower: number maxEmitPower: number minSize: number maxSize: number gravity: number[] velocityGradients: VelocityGradient[] colorGradients: TimeColorGradient[] | RandomColorGradient[] blendMode: ParticleSystemBlendMode hideDist?: number meshOffset?: number[] autoRotate?: boolean lineToEId?: EntityId // EntityId to connect to using a line height: number width: number depth: number emitRate: number dir1?: number[] dir2?: number[] } ``` ### Creating a Mesh Entity ```ts /** * Try to create a mesh entity. This creates an entity whose mesh position is synced with clients. * Set entity position using setPosition * There is a limit to the number of mesh entities and throwables that can be created, with an even smaller limit for mesh entities with physics. * * @param {MeshType} type * @param {MeshEntityOpts[MeshType]} opts * @param {string} [name] - The default name for the nametag * @param {MeshEntityPhysicsOpts} [physicsOptions] - Physics Options * @param {EntityId} [initiatorId] - The entity that initiated the creation of the mesh entity. * @returns {PNull} - null if the entity creation failed, otherwise the entity ID. */ attemptCreateMeshEntity(type, opts, name, physicsOptions, initiatorId) ``` Use `api.setPosition()` to move the entity after creation. #### Examples Create a red box: ```ts const boxId = api.attemptCreateMeshEntity("Box", { width: 1, height: 1, depth: 1, diffuseColor: [255, 0, 0], }) if (boxId) { api.setPosition(boxId, 10, 50, 10) } ``` Create a Bloxd block mesh: ```ts const blockId = api.attemptCreateMeshEntity("BloxdBlock", { blockName: "Block of Diamond", size: 1, }) ``` Create a person mesh: ```ts const personId = api.attemptCreateMeshEntity("Person", { size: 1, pose: "standing", textures: { head: "trader_black" }, }, "Bedwars Merchant") ``` Create a mesh entity with physics: ```ts const physicsBoxId = api.attemptCreateMeshEntity( "Box", { width: 0.5, height: 0.5, depth: 0.5, diffuseColor: [0, 255, 0] }, "", { doPhysics: true, collidesEntities: true, collideBits: 1, collideMask: 1, }, ) ``` ### Updating a Mesh Entity ```ts /** * Update a mesh entity. If used on a non-mesh entity, will do nothing. * * @param {EntityId} eId * @param {MeshType} type * @param {MeshEntityOpts[MeshType]} opts * @returns {void} */ updateMeshEntity(eId, type, opts) ``` ```ts api.updateMeshEntity(boxId, "Box", { width: 2, height: 2, depth: 2, diffuseColor: [0, 0, 255], }) ``` ### Deleting a Mesh Entity ```ts /** * Delete a mesh entity * * @param {EntityId} eId * @returns {boolean} */ deleteMeshEntity(eId) ``` ```ts api.deleteMeshEntity(boxId) ``` --- ## Throwables Throwables use the engine's built-in projectile system. Each throwable item has predefined velocity, damage, and gravity. You can multiply these defaults with the `velocityMult`, `damageMult`, and `gravityMult` parameters. ### Creating a Throwable ```ts /** * Try to create a throwable entity. * Similar to creating a mesh entity and uses the same rate limiting. * However, this uses the predefined throwables system and physics used by throwable items with the game * Each throwable item has its own behaviour already, including default velocity, damage and gravity multipliers. * * @param {EntityId} throwerEId * @param {ThrowableItem} itemName - Must be an Item that is usually throwable in-engine * @param {[number, number, number]} position - Starting position * @param {[number, number, number]} direction * @param {number} [velocityMult] - Multiplier for the default velocity of the throwable item * @param {number} [damageMult] - Multiplier for the default damage of the throwable item * @param {number} [gravityMult] - Multiplier for the default gravity of the throwable item * @param {ItemAttributes} [attributes] - item attributes (currently used only for the "Boomerag" item) * @returns {string} - null if throwable creation failed, otherwise the entity ID. */ attemptCreateThrowable(throwerEId, itemName, position, direction, velocityMult, damageMult, gravityMult, attributes) ``` #### Example ```ts const pos = api.getPosition(playerId) const { dir } = api.getPlayerFacingInfo(playerId) const throwableId = api.attemptCreateThrowable( playerId, "Fireball", [pos[0], pos[1] + 1.5, pos[2]], dir, 2, // double velocity 1.5, // 1.5x damage ) ``` ### Deleting a Throwable Some throwables are deleted automatically when they hit a block or entity, or despawn after a certain time. You can delete them manually with this method. ```ts /** * Delete a throwable entity before it automatically removes itself. * * @param {EntityId} eId * @returns {boolean} - true if the entity was deleted, false if it was not a throwable entity */ deleteThrowable(eId) ``` ```ts api.deleteThrowable(throwableId) ``` --- ## Node Mesh Attachment Attach or detach a mesh to a specific node ("bone") of an entity. This is useful for attaching items, effects, or decorations to player body parts or other entity nodes. ```ts /** * Attach/detach mesh instances to/from an entity * * @param {EntityId} eId * @param {EntityNamedNode} node - node to attach to * @param {PNull} type - if null, detaches mesh from this node * @param {MeshEntityOpts[MeshType]} [opts] * @param {[number, number, number]} [offset] * @param {[number, number, number]} [rotation] * @returns {void} */ updateEntityNodeMeshAttachment(eId, node, type, opts, offset, rotation) ``` ### Available Nodes `EntityNamedNode` is one of: - `"TorsoNode"` - `"HeadMesh"` - `"ArmRightMesh"` - `"ArmLeftMesh"` - `"LegLeftMesh"` - `"LegRightMesh"` ### Examples Attach a block to a player's right arm: ```ts api.updateEntityNodeMeshAttachment( playerId, "ArmRightMesh", "BloxdBlock", { blockName: "Diamond Block", size: 0.3 }, [0, -0.5, 0], // offset [0, 0, 0], // rotation ) ``` Attach a glowing box to a player's head: ```ts api.updateEntityNodeMeshAttachment( playerId, "HeadMesh", "Box", { width: 0.3, height: 0.3, depth: 0.3, emissiveColor: [255, 215, 0] }, [0, 0.5, 0], ) ``` Detach a mesh from a node: ```ts api.updateEntityNodeMeshAttachment(playerId, "ArmRightMesh", null) ``` --- ## Types Glossary Reference types that you may find useful. ### `MeshEntityOpts` ```ts type MeshEntityOpts = { Box: CommonMeshEntityOpts & { width: number height: number depth: number diffuseColor?: number[] emissiveColor?: number[] backFaceCulling?: boolean // Default true texture?: string // Can be a blockname. Wraps every one block faceUV?: number[][] } BloxdBlock: CommonMeshEntityOpts & { blockName: BlockNameOrId size: number | [number, number, number] } Person: CommonMeshEntityOpts & { size?: number textures?: Partial pose?: PlayerPose } ParticleEmitter: MeshParticleSystemOpts } ``` ### `CommonMeshEntityOpts` ```ts type CommonMeshEntityOpts = { hideDist?: number meshOffset?: number[] autoRotate?: boolean lineToEId?: EntityId // EntityId to connect to using a line } ``` ### `MeshEntityPhysicsOpts` ```ts type MeshEntityPhysicsOpts = { doPhysics: boolean onCollideTerrain?: () => void // Unsupported for custom code collidesEntities?: boolean collideBits?: number // bitmask category of this entity collideMask?: number // bitmask category of entities this entity collides with heightExpandAmt?: number // expand hitbox height by this amount widthExpandAmt?: number // expand hitbox width by this amount vehicleOpts?: MeshEntityVehicleOpts // Unsupported for custom code } ``` ### `MeshParticleSystemOpts` ```ts type MeshParticleSystemOpts = ParticleSystemOpts & CommonMeshEntityOpts & { height: number width: number depth: number emitRate: number dir1?: number[] dir2?: number[] } ``` ### `ParticleSystemOpts` ```ts type ParticleSystemOpts = { texture: string minLifeTime: number maxLifeTime: number minEmitPower: number maxEmitPower: number minSize: number maxSize: number gravity: number[] velocityGradients: VelocityGradient[] colorGradients: TimeColorGradient[] | RandomColorGradient[] blendMode: ParticleSystemBlendMode } ``` ### `TimeColorGradient` ```ts type TimeColorGradient = { timeFraction: number minColor: [number, number, number, number] maxColor?: [number, number, number, number] } ``` ### `RandomColorGradient` ```ts type RandomColorGradient = { color: [number, number, number] } ``` ### `VelocityGradient` ```ts type VelocityGradient = { timeFraction: number factor: number factor2: number } ``` ### `ParticleSystemBlendMode` ```ts enum ParticleSystemBlendMode { // Source color is added to the destination color without alpha affecting the result OneOne = 0, // Blend current color and particle color using particle's alpha Standard = 1, // Add current color and particle color multiplied by particle's alpha Add, // Multiply current color with particle color Multiply, // Multiply current color with particle color then add current color and particle color multiplied by particle's alpha MultiplyAdd, } ``` ### `EntityNamedNode` Nodes on a player/entity skeleton that meshes can be attached to. ```ts type EntityNamedNode = "TorsoNode" | "HeadMesh" | "ArmRightMesh" | "ArmLeftMesh" | "LegLeftMesh" | "LegRightMesh" ``` # Mesh Entities, Throwables & Node Mesh Attachment Mesh entities are server-created 3D objects whose position is synced with all clients. Throwables are a specialised subset that use the engine's built-in projectile physics. Node mesh attachment lets you attach additional meshes to specific bones/nodes of an existing entity (e.g. a weapon on a player's hand). ## Limits - There is a limit to the number of mesh entities and throwables that can be created. `attemptCreateMeshEntity` returns `null` when the limit is reached instead of throwing. - There are two separate limits: one for mesh entities without physics and one for mesh entities with physics (which is a lot smaller). --- ## Mesh Entities ### Mesh Types There are four mesh types, each with different options: - **`Box`** - **`BloxdBlock`** - **`Person`** - **`ParticleEmitter`** #### `Box` ```ts type BoxOpts = { hideDist?: number meshOffset?: number[] autoRotate?: boolean lineToEId?: EntityId // EntityId to connect to using a line width: number height: number depth: number diffuseColor?: number[] emissiveColor?: number[] backFaceCulling?: boolean // Default true texture?: string // Can be a blockname. Wraps every one block faceUV?: number[][] } ``` #### `BloxdBlock` ```ts type BloxdBlockOpts = { hideDist?: number meshOffset?: number[] autoRotate?: boolean lineToEId?: EntityId // EntityId to connect to using a line blockName: BlockNameOrId size: number | [number, number, number] } ``` #### `Person` ```ts type PersonOpts = { hideDist?: number meshOffset?: number[] autoRotate?: boolean lineToEId?: EntityId // EntityId to connect to using a line size?: number textures?: Partial pose?: PlayerPose } ``` #### `ParticleEmitter` ```ts type ParticleEmitterOpts = { texture: string minLifeTime: number maxLifeTime: number minEmitPower: number maxEmitPower: number minSize: number maxSize: number gravity: number[] velocityGradients: VelocityGradient[] colorGradients: TimeColorGradient[] | RandomColorGradient[] blendMode: ParticleSystemBlendMode hideDist?: number meshOffset?: number[] autoRotate?: boolean lineToEId?: EntityId // EntityId to connect to using a line height: number width: number depth: number emitRate: number dir1?: number[] dir2?: number[] } ``` ### Creating a Mesh Entity ```ts /** * Try to create a mesh entity. This creates an entity whose mesh position is synced with clients. * Set entity position using setPosition * There is a limit to the number of mesh entities and throwables that can be created, with an even smaller limit for mesh entities with physics. * * @param {MeshType} type * @param {MeshEntityOpts[MeshType]} opts * @param {string} [name] - The default name for the nametag * @param {MeshEntityPhysicsOpts} [physicsOptions] - Physics Options * @param {EntityId} [initiatorId] - The entity that initiated the creation of the mesh entity. * @returns {PNull} - null if the entity creation failed, otherwise the entity ID. */ attemptCreateMeshEntity(type, opts, name, physicsOptions, initiatorId) ``` Use `api.setPosition()` to move the entity after creation. #### Examples Create a red box: ```ts const boxId = api.attemptCreateMeshEntity("Box", { width: 1, height: 1, depth: 1, diffuseColor: [255, 0, 0], }) if (boxId) { api.setPosition(boxId, 10, 50, 10) } ``` Create a Bloxd block mesh: ```ts const blockId = api.attemptCreateMeshEntity("BloxdBlock", { blockName: "Block of Diamond", size: 1, }) ``` Create a person mesh: ```ts const personId = api.attemptCreateMeshEntity("Person", { size: 1, pose: "standing", textures: { head: "trader_black" }, }, "Bedwars Merchant") ``` Create a mesh entity with physics: ```ts const physicsBoxId = api.attemptCreateMeshEntity( "Box", { width: 0.5, height: 0.5, depth: 0.5, diffuseColor: [0, 255, 0] }, "", { doPhysics: true, collidesEntities: true, collideBits: 1, collideMask: 1, }, ) ``` ### Updating a Mesh Entity ```ts /** * Update a mesh entity. If used on a non-mesh entity, will do nothing. * * @param {EntityId} eId * @param {MeshType} type * @param {MeshEntityOpts[MeshType]} opts * @returns {void} */ updateMeshEntity(eId, type, opts) ``` ```ts api.updateMeshEntity(boxId, "Box", { width: 2, height: 2, depth: 2, diffuseColor: [0, 0, 255], }) ``` ### Deleting a Mesh Entity ```ts /** * Delete a mesh entity * * @param {EntityId} eId * @returns {boolean} */ deleteMeshEntity(eId) ``` ```ts api.deleteMeshEntity(boxId) ``` --- ## Throwables Throwables use the engine's built-in projectile system. Each throwable item has predefined velocity, damage, and gravity. You can multiply these defaults with the `velocityMult`, `damageMult`, and `gravityMult` parameters. ### Creating a Throwable ```ts /** * Try to create a throwable entity. * Similar to creating a mesh entity and uses the same rate limiting. * However, this uses the predefined throwables system and physics used by throwable items with the game * Each throwable item has its own behaviour already, including default velocity, damage and gravity multipliers. * * @param {EntityId} throwerEId * @param {ThrowableItem} itemName - Must be an Item that is usually throwable in-engine * @param {[number, number, number]} position - Starting position * @param {[number, number, number]} direction * @param {number} [velocityMult] - Multiplier for the default velocity of the throwable item * @param {number} [damageMult] - Multiplier for the default damage of the throwable item * @param {number} [gravityMult] - Multiplier for the default gravity of the throwable item * @param {ItemAttributes} [attributes] - item attributes (currently used only for the "Boomerag" item) * @returns {string} - null if throwable creation failed, otherwise the entity ID. */ attemptCreateThrowable(throwerEId, itemName, position, direction, velocityMult, damageMult, gravityMult, attributes) ``` #### Example ```ts const pos = api.getPosition(playerId) const { dir } = api.getPlayerFacingInfo(playerId) const throwableId = api.attemptCreateThrowable( playerId, "Fireball", [pos[0], pos[1] + 1.5, pos[2]], dir, 2, // double velocity 1.5, // 1.5x damage ) ``` ### Deleting a Throwable Some throwables are deleted automatically when they hit a block or entity, or despawn after a certain time. You can delete them manually with this method. ```ts /** * Delete a throwable entity before it automatically removes itself. * * @param {EntityId} eId * @returns {boolean} - true if the entity was deleted, false if it was not a throwable entity */ deleteThrowable(eId) ``` ```ts api.deleteThrowable(throwableId) ``` --- ## Node Mesh Attachment Attach or detach a mesh to a specific node ("bone") of an entity. This is useful for attaching items, effects, or decorations to player body parts or other entity nodes. ```ts /** * Attach/detach mesh instances to/from an entity * * @param {EntityId} eId * @param {EntityNamedNode} node - node to attach to * @param {PNull} type - if null, detaches mesh from this node * @param {MeshEntityOpts[MeshType]} [opts] * @param {[number, number, number]} [offset] * @param {[number, number, number]} [rotation] * @returns {void} */ updateEntityNodeMeshAttachment(eId, node, type, opts, offset, rotation) ``` ### Available Nodes `EntityNamedNode` is one of: - `"TorsoNode"` - `"HeadMesh"` - `"ArmRightMesh"` - `"ArmLeftMesh"` - `"LegLeftMesh"` - `"LegRightMesh"` ### Examples Attach a block to a player's right arm: ```ts api.updateEntityNodeMeshAttachment( playerId, "ArmRightMesh", "BloxdBlock", { blockName: "Diamond Block", size: 0.3 }, [0, -0.5, 0], // offset [0, 0, 0], // rotation ) ``` Attach a glowing box to a player's head: ```ts api.updateEntityNodeMeshAttachment( playerId, "HeadMesh", "Box", { width: 0.3, height: 0.3, depth: 0.3, emissiveColor: [255, 215, 0] }, [0, 0.5, 0], ) ``` Detach a mesh from a node: ```ts api.updateEntityNodeMeshAttachment(playerId, "ArmRightMesh", null) ``` --- ## Types Glossary Reference types that you may find useful. ### `MeshEntityOpts` ```ts type MeshEntityOpts = { Box: CommonMeshEntityOpts & { width: number height: number depth: number diffuseColor?: number[] emissiveColor?: number[] backFaceCulling?: boolean // Default true texture?: string // Can be a blockname. Wraps every one block faceUV?: number[][] } BloxdBlock: CommonMeshEntityOpts & { blockName: BlockNameOrId size: number | [number, number, number] } Person: CommonMeshEntityOpts & { size?: number textures?: Partial pose?: PlayerPose } ParticleEmitter: MeshParticleSystemOpts } ``` ### `CommonMeshEntityOpts` ```ts type CommonMeshEntityOpts = { hideDist?: number meshOffset?: number[] autoRotate?: boolean lineToEId?: EntityId // EntityId to connect to using a line } ``` ### `MeshEntityPhysicsOpts` ```ts type MeshEntityPhysicsOpts = { doPhysics: boolean onCollideTerrain?: () => void // Unsupported for custom code collidesEntities?: boolean collideBits?: number // bitmask category of this entity collideMask?: number // bitmask category of entities this entity collides with heightExpandAmt?: number // expand hitbox height by this amount widthExpandAmt?: number // expand hitbox width by this amount vehicleOpts?: MeshEntityVehicleOpts // Unsupported for custom code } ``` ### `MeshParticleSystemOpts` ```ts type MeshParticleSystemOpts = ParticleSystemOpts & CommonMeshEntityOpts & { height: number width: number depth: number emitRate: number dir1?: number[] dir2?: number[] } ``` ### `ParticleSystemOpts` ```ts type ParticleSystemOpts = { texture: string minLifeTime: number maxLifeTime: number minEmitPower: number maxEmitPower: number minSize: number maxSize: number gravity: number[] velocityGradients: VelocityGradient[] colorGradients: TimeColorGradient[] | RandomColorGradient[] blendMode: ParticleSystemBlendMode } ``` ### `TimeColorGradient` ```ts type TimeColorGradient = { timeFraction: number minColor: [number, number, number, number] maxColor?: [number, number, number, number] } ``` ### `RandomColorGradient` ```ts type RandomColorGradient = { color: [number, number, number] } ``` ### `VelocityGradient` ```ts type VelocityGradient = { timeFraction: number factor: number factor2: number } ``` ### `ParticleSystemBlendMode` ```ts enum ParticleSystemBlendMode { // Source color is added to the destination color without alpha affecting the result OneOne = 0, // Blend current color and particle color using particle's alpha Standard = 1, // Add current color and particle color multiplied by particle's alpha Add, // Multiply current color with particle color Multiply, // Multiply current color with particle color then add current color and particle color multiplied by particle's alpha MultiplyAdd, } ``` ### `EntityNamedNode` Nodes on a player/entity skeleton that meshes can be attached to. ```ts type EntityNamedNode = "TorsoNode" | "HeadMesh" | "ArmRightMesh" | "ArmLeftMesh" | "LegLeftMesh" | "LegRightMesh" ``` # Mob Settings These impact the behaviour of mobs, what they look like, and how they sound. These can either be set on a per-mob basis or the default can be set for all mobs of a particular type. These API methods allow you to modify mob settings: ```js /** * Returns the current default value for a mob setting. * * @param {TMobType} mobType * @param {TMobSetting} setting * @returns {MobSettings[TMobSetting]} */ getDefaultMobSetting(mobType, setting) /** * Set the default value for a mob setting. * * @param {TMobType} mobType * @param {TMobSetting} setting * @param {MobSettings[TMobSetting]} value * @returns {void} */ setDefaultMobSetting(mobType, setting, value) /** * Get the current value of a mob setting for a specific mob. * * @param {MobId} mobId * @param {TMobSetting} setting * @param {boolean} [returnDefaultIfNotOverridden] - If true, return the default setting if not overridden. * @returns {MobSettings[TMobSetting]} */ getMobSetting(mobId, setting, returnDefaultIfNotOverridden) /** * Set the current value of a mob setting for a specific mob. * * @param {MobId} mobId * @param {TMobSetting} setting * @param {MobSettings[TMobSetting]} value * @returns {void} */ setMobSetting(mobId, setting, value) ``` Here is the full list of available mob settings: ## attackDamage **Type:** `number` **Example:** `0` ## attackEffectDuration **Type:** `number` **Example:** `0` ## attackEffectName **Type:** `string` **Example:** `null` ## attackImpulse **Type:** `number` **Example:** `0` ## attackInterval **Type:** `number` **Example:** `0` ## attackItemName **Type:** `string` **Example:** `null` ## attackRadius **Type:** `number` **Example:** `0` ## attackSound **Type:** `string` **Example:** `null` ## baseJumpImpulseXZ **Type:** `number` **Example:** `0` ## baseJumpImpulseY **Type:** `number` **Example:** `0` ## baseRunningSpeed **Type:** `number` **Example:** `4.55 * 0.85` ## baseWalkingSpeed **Type:** `number` **Example:** `3.5` ## burstAttackInfo **Type:** ` { burstAttackIntervals: readonly number[]; } ` **Example:** `null` ## chaseRadius **Type:** `number` **Example:** `0` ## combatTetherInfo **Type:** `MobCombatTetherCombatInfo` **Example:** ```ts { range: 11, particleOpts: { texture: "soul_0", colorGradients: [ { timeFraction: 0, minColor: [245, 35, 25, 1], maxColor: [255, 45, 35, 1], }, ], }, } ``` ## evadeInfo **Type:** `MobEvadeInfo` **Example:** ```ts { probability: 0.6, minAngle: Math.PI * 0.35, maxAngle: Math.PI * 0.6, impulse: 8, } ``` ## healthRegen **Type:** ` { amount: number; interval: number; startAfter: number; } ` **Example:** `null` ## heldItemName **Type:** `string` **Example:** `null` ## hostilityRadius **Type:** `number` **Example:** `0` ## hurtSound **Type:** `string` **Example:** `"pigHurt"` ## idleSound **Type:** `string` **Example:** `"pigOink"` ## initialHealth **Type:** `number` **Example:** `75` ## isRideable **Type:** `boolean` **Example:** `false` ## jumpCount **Type:** `number` **Example:** `0` ## jumpMultiplier **Type:** `number` **Example:** `1` ## maxFollowingRadius **Type:** `number` **Example:** `12` ## maxHealth **Type:** `number` **Example:** `75` ## metaInfo **Type:** `string` **Example:** `""` ## minFollowingRadius **Type:** `number` **Example:** `5` ## name **Type:** `string` **Example:** `""` ## onDeathAura **Type:** `number` **Example:** `20` ## onDeathItemDrops **Type:** ` { itemName: string; probabilityOfDrop: number; dropMinAmount: number; dropMaxAmount: number; applyBurstImpulseToDrop?: boolean; }[] ` **Example:** ```ts [ { itemName: "Raw Porkchop", probabilityOfDrop: 1, dropMinAmount: 1, dropMaxAmount: 3, }, ] ``` ## onDeathParticleTexture **Type:** `string` **Example:** `"critical_hit"` ## onTamedHealthMultiplier **Type:** `number` **Example:** `4.0` ## ownerDbId **Type:** `string` **Example:** `null` ## petInfo **Type:** `MobPetInfo` **Example:** ```ts { friendshipPoints: 0, lastFedAt: null, highestFriendshipLevelReached: 0, superlikedFood: null, superlikedFoodKnown: false, bonusesGained: [], } ``` ## ridingSpeedMult **Type:** `number` **Example:** `1` ## runAwayRadius **Type:** `number` **Example:** `0` ## runningSpeedMultiplier **Type:** `number` **Example:** `1` ## secondaryAttackDamage **Type:** `number` **Example:** `0` ## secondaryAttackImpulse **Type:** `number` **Example:** `0` ## secondaryAttackItemName **Type:** `string` **Example:** `null` ## secondaryAttackRadius **Type:** `number` **Example:** `0` ## secondaryAttackSound **Type:** `string` **Example:** `null` ## secondaryBurstAttackInfo **Type:** ` { burstAttackIntervals: readonly number[]; } ` **Example:** `null` ## stoppingRadius **Type:** `number` **Example:** `0.5` ## swingArmOnAttack **Type:** `boolean` **Example:** `true` ## swingArmOnSecondaryAttack **Type:** `boolean` **Example:** `true` /** * @type {MobTameInfo} */ tameInfo = { tameItemName: [ "Raw Porkchop", "Raw Beef", "Raw Mutton", "Raw Venison", "Cooked Porkchop", "Steak", "Cooked Mutton", "Cooked Venison" ], probabilityOfTame: 0.32, isSaddleable: false, supportsFriendship: true, likedFoods: [ "Raw Porkchop", "Raw Beef", "Raw Mutton", "Raw Venison", "Cooked Porkchop", "Steak", "Cooked Mutton", "Cooked Venison", "Banana", "Baked Potato", "Rotten Brain" ], neutralFoods: [ "Catnip", "Pumpkin Pie", "Bowl of Cranberries", "Watermelon Slice", "Gold Watermelon Slice", "Bread", "Rotten Flesh", "Mushroom Soup", "Plum", "Carrot", "Beetroot", "Raw Potato" ], dislikedFoods: [ "Apple", "Wheat", "Pear", "Cherry", "Bowl of Rice", "Melon Slice", "Gold Melon Slice", "Chili Pepper", "Cracked Coconut" ], foodItemsWithEffects: [ { itemName: "Catnip", effects: [ { name: "Speed", duration: 30000, level: 1 }, { name: "Damage", duration: 30000, level: 1 } ] } ], guaranteedDrop: "Caught Fish", commonDrops: [ "Poop", "Wheat Seeds" ], levelUpBonuses: { 1: "Renaming", 2: "Special Drops", 3: "Damage +", 4: "Painting", 5: "Poison Claws" } } ## territoryRadius **Type:** `number` **Example:** `0` ## variation **Type:** `"default"` **Example:** `"default"` ## walkingSpeedMultiplier **Type:** `number` **Example:** `1` ## warpTargetSpecialAttackInfo **Type:** `MobWarpTargetSpecialAttackInfo` **Example:** ```ts { cooldown: 20_000, range: 32, sound: "warperPhase", delay: 1_000, minDestinationRadius: 5, maxDestinationRadius: 7, swingArm: false, particleOpts: { duration: 2_000, texture: "soul_0", colorGradients: [ { timeFraction: 0, minColor: [70, 215, 230, 1], maxColor: [75, 225, 240, 1], }, ], }, } ``` ## Mob Variations Some mob types support variations other than just `"default"`: ```js 67: "default" Pig: "default" Cow: "default", "cream" Sheep: "default", "black", "red", "orange", "pink", "purple", "yellow", "blue", "brown", "cyan", "gray", "green", "lightBlue", "lightGray", "lime", "magenta" Horse: "default", "black", "brown", "cream" Cave Golem: "default", "iron" Draugr Zombie: "default", "longHairChestplate", "longHairClothed", "shortHairClothed" Draugr Skeleton: "default" Frost Golem: "default" Frost Zombie: "default", "longHairChestplate", "shortHairClothed" Frost Skeleton: "default" Draugr Knight: "default" Wolf: "default", "white", "brown", "grey", "spectral" Bear: "default" Deer: "default" Stag: "default" Gold Watermelon Stag: "default" Gorilla: "default" Wildcat: "default", "tabby", "grey", "black", "calico", "siamese", "leopard" Magma Golem: "default" Draugr Huntress: "default", "chainmail" Spirit Golem: "default" Spirit Wolf: "default" Spirit Bear: "default" Spirit Stag: "default" Spirit Gorilla: "default" Draugr Warper: "default" Frost Wraith: "default" Draugr Reaver: "default" NPC: "default", "emma", "leo", "isabel", "sanjay", "imara", "enoch", "sara", "carmen" Bobino Musculino: "default" Capitano Explovissimo: "default" ``` ## Mob AI A mob's AI state determines its behaviour, e.g.: whether it is stood still, walking in a straight line, chasing someone, running towards a coordinate, etc. These API methods allow you to modify a mob's AI state: ```js /** * Gets the current AI state for the given mob. * * @param {MobId} mobId * @returns { { state: MobAiState; params: MobAiStateParams } } */ getMobAiState(mobId) /** * Sets the current AI state for the given mob. * Some AI states will require context such as the ID of the lifeform being chased. * * @param {MobId} mobId * @param {TState} state * @param {MobAiStateParams} params * @returns {void} */ setMobAiState(mobId, state, params) ``` Here is the full list of available mob AI states and their parameters: | State | Description | Parameters | |-------|-------------|------------| | `idle` | The mob is stood still, but it still has awareness of its environment.
For example: if the mob is hostile, it will still chase and attack nearby players. | `null` | | `disabled` | The mob is stood still, and it has no awareness of its environment.
It will not even react if provoked. | `null` | | `idleBeforeTurning` | The mob is stood still (idle) and is about to turn. | `null` | | `turning` | The mob has chosen a new direction at random and is turning to face it. | `null` | | `idleBeforeWalking` | The mob is stood still (idle) and is about to walk. | `null` | | `walking` | The mob is walking in the direction it is facing. | `null` | | `runningAway` | The mob is running away from the target lifeform. | `{ targetId: LifeformId }` | | `chasing` | The mob is chasing the target lifeform. | `{ targetId: LifeformId }` | | `following` | The mob is following the target lifeform.
It will stop if it is within the `minFollowingDistance` (mob setting) of the target,
and teleport to the target if it is outside the `maxFollowingDistance` (mob setting) of the target. | `{ targetId: LifeformId }` | | `watching` | The mob is stood still looking at the target. | `{ targetId: LifeformId }` | | `walkingToPosition` | The mob is walking towards the position.
It will stop if it is within the `stoppingRadius` (mob setting) of the position. | `{ pos: Pos }` | | `runningToPosition` | The mob is running towards the position.
It will stop if it is within the `stoppingRadius` (mob setting) of the position. | `{ pos: Pos }` | # Mob Settings These impact the behaviour of mobs, what they look like, and how they sound. These can either be set on a per-mob basis or the default can be set for all mobs of a particular type. These API methods allow you to modify mob settings: ```js /** * Returns the current default value for a mob setting. * * @param {TMobType} mobType * @param {TMobSetting} setting * @returns {MobSettings[TMobSetting]} */ getDefaultMobSetting(mobType, setting) /** * Set the default value for a mob setting. * * @param {TMobType} mobType * @param {TMobSetting} setting * @param {MobSettings[TMobSetting]} value * @returns {void} */ setDefaultMobSetting(mobType, setting, value) /** * Get the current value of a mob setting for a specific mob. * * @param {MobId} mobId * @param {TMobSetting} setting * @param {boolean} [returnDefaultIfNotOverridden] - If true, return the default setting if not overridden. * @returns {MobSettings[TMobSetting]} */ getMobSetting(mobId, setting, returnDefaultIfNotOverridden) /** * Set the current value of a mob setting for a specific mob. * * @param {MobId} mobId * @param {TMobSetting} setting * @param {MobSettings[TMobSetting]} value * @returns {void} */ setMobSetting(mobId, setting, value) ``` Here is the full list of available mob settings: ## attackDamage **Type:** `number` **Example:** `0` ## attackEffectDuration **Type:** `number` **Example:** `0` ## attackEffectName **Type:** `string` **Example:** `null` ## attackImpulse **Type:** `number` **Example:** `0` ## attackInterval **Type:** `number` **Example:** `0` ## attackItemName **Type:** `string` **Example:** `null` ## attackRadius **Type:** `number` **Example:** `0` ## attackSound **Type:** `string` **Example:** `null` ## baseJumpImpulseXZ **Type:** `number` **Example:** `0` ## baseJumpImpulseY **Type:** `number` **Example:** `0` ## baseRunningSpeed **Type:** `number` **Example:** `4.55 * 0.85` ## baseWalkingSpeed **Type:** `number` **Example:** `3.5` ## burstAttackInfo **Type:** ` { burstAttackIntervals: readonly number[]; } ` **Example:** `null` ## chaseRadius **Type:** `number` **Example:** `0` ## combatTetherInfo **Type:** `MobCombatTetherCombatInfo` **Example:** ```ts { range: 11, particleOpts: { texture: "soul_0", colorGradients: [ { timeFraction: 0, minColor: [245, 35, 25, 1], maxColor: [255, 45, 35, 1], }, ], }, } ``` ## evadeInfo **Type:** `MobEvadeInfo` **Example:** ```ts { probability: 0.6, minAngle: Math.PI * 0.35, maxAngle: Math.PI * 0.6, impulse: 8, } ``` ## healthRegen **Type:** ` { amount: number; interval: number; startAfter: number; } ` **Example:** `null` ## heldItemName **Type:** `string` **Example:** `null` ## hostilityRadius **Type:** `number` **Example:** `0` ## hurtSound **Type:** `string` **Example:** `"pigHurt"` ## idleSound **Type:** `string` **Example:** `"pigOink"` ## initialHealth **Type:** `number` **Example:** `75` ## isRideable **Type:** `boolean` **Example:** `false` ## jumpCount **Type:** `number` **Example:** `0` ## jumpMultiplier **Type:** `number` **Example:** `1` ## maxFollowingRadius **Type:** `number` **Example:** `12` ## maxHealth **Type:** `number` **Example:** `75` ## metaInfo **Type:** `string` **Example:** `""` ## minFollowingRadius **Type:** `number` **Example:** `5` ## name **Type:** `string` **Example:** `""` ## onDeathAura **Type:** `number` **Example:** `20` ## onDeathItemDrops **Type:** ` { itemName: string; probabilityOfDrop: number; dropMinAmount: number; dropMaxAmount: number; applyBurstImpulseToDrop?: boolean; }[] ` **Example:** ```ts [ { itemName: "Raw Porkchop", probabilityOfDrop: 1, dropMinAmount: 1, dropMaxAmount: 3, }, ] ``` ## onDeathParticleTexture **Type:** `string` **Example:** `"critical_hit"` ## onTamedHealthMultiplier **Type:** `number` **Example:** `4.0` ## ownerDbId **Type:** `string` **Example:** `null` ## petInfo **Type:** `MobPetInfo` **Example:** ```ts { friendshipPoints: 0, lastFedAt: null, highestFriendshipLevelReached: 0, superlikedFood: null, superlikedFoodKnown: false, bonusesGained: [], } ``` ## ridingSpeedMult **Type:** `number` **Example:** `1` ## runAwayRadius **Type:** `number` **Example:** `0` ## runningSpeedMultiplier **Type:** `number` **Example:** `1` ## secondaryAttackDamage **Type:** `number` **Example:** `0` ## secondaryAttackImpulse **Type:** `number` **Example:** `0` ## secondaryAttackItemName **Type:** `string` **Example:** `null` ## secondaryAttackRadius **Type:** `number` **Example:** `0` ## secondaryAttackSound **Type:** `string` **Example:** `null` ## secondaryBurstAttackInfo **Type:** ` { burstAttackIntervals: readonly number[]; } ` **Example:** `null` ## stoppingRadius **Type:** `number` **Example:** `0.5` ## swingArmOnAttack **Type:** `boolean` **Example:** `true` ## swingArmOnSecondaryAttack **Type:** `boolean` **Example:** `true` /** * @type {MobTameInfo} */ tameInfo = { tameItemName: [ "Raw Porkchop", "Raw Beef", "Raw Mutton", "Raw Venison", "Cooked Porkchop", "Steak", "Cooked Mutton", "Cooked Venison" ], probabilityOfTame: 0.32, isSaddleable: false, supportsFriendship: true, likedFoods: [ "Raw Porkchop", "Raw Beef", "Raw Mutton", "Raw Venison", "Cooked Porkchop", "Steak", "Cooked Mutton", "Cooked Venison", "Banana", "Baked Potato", "Rotten Brain" ], neutralFoods: [ "Catnip", "Pumpkin Pie", "Bowl of Cranberries", "Watermelon Slice", "Gold Watermelon Slice", "Bread", "Rotten Flesh", "Mushroom Soup", "Plum", "Carrot", "Beetroot", "Raw Potato" ], dislikedFoods: [ "Apple", "Wheat", "Pear", "Cherry", "Bowl of Rice", "Melon Slice", "Gold Melon Slice", "Chili Pepper", "Cracked Coconut" ], foodItemsWithEffects: [ { itemName: "Catnip", effects: [ { name: "Speed", duration: 30000, level: 1 }, { name: "Damage", duration: 30000, level: 1 } ] } ], guaranteedDrop: "Caught Fish", commonDrops: [ "Poop", "Wheat Seeds" ], levelUpBonuses: { 1: "Renaming", 2: "Special Drops", 3: "Damage +", 4: "Painting", 5: "Poison Claws" } } ## territoryRadius **Type:** `number` **Example:** `0` ## variation **Type:** `"default"` **Example:** `"default"` ## walkingSpeedMultiplier **Type:** `number` **Example:** `1` ## warpTargetSpecialAttackInfo **Type:** `MobWarpTargetSpecialAttackInfo` **Example:** ```ts { cooldown: 20_000, range: 32, sound: "warperPhase", delay: 1_000, minDestinationRadius: 5, maxDestinationRadius: 7, swingArm: false, particleOpts: { duration: 2_000, texture: "soul_0", colorGradients: [ { timeFraction: 0, minColor: [70, 215, 230, 1], maxColor: [75, 225, 240, 1], }, ], }, } ``` ## Mob Variations Some mob types support variations other than just `"default"`: ```js 67: "default" Pig: "default" Cow: "default", "cream" Sheep: "default", "black", "red", "orange", "pink", "purple", "yellow", "blue", "brown", "cyan", "gray", "green", "lightBlue", "lightGray", "lime", "magenta" Horse: "default", "black", "brown", "cream" Cave Golem: "default", "iron" Draugr Zombie: "default", "longHairChestplate", "longHairClothed", "shortHairClothed" Draugr Skeleton: "default" Frost Golem: "default" Frost Zombie: "default", "longHairChestplate", "shortHairClothed" Frost Skeleton: "default" Draugr Knight: "default" Wolf: "default", "white", "brown", "grey", "spectral" Bear: "default" Deer: "default" Stag: "default" Gold Watermelon Stag: "default" Gorilla: "default" Wildcat: "default", "tabby", "grey", "black", "calico", "siamese", "leopard" Magma Golem: "default" Draugr Huntress: "default", "chainmail" Spirit Golem: "default" Spirit Wolf: "default" Spirit Bear: "default" Spirit Stag: "default" Spirit Gorilla: "default" Draugr Warper: "default" Frost Wraith: "default" Draugr Reaver: "default" NPC: "default", "emma", "leo", "isabel", "sanjay", "imara", "enoch", "sara", "carmen" Bobino Musculino: "default" Capitano Explovissimo: "default" ``` ## Mob AI A mob's AI state determines its behaviour, e.g.: whether it is stood still, walking in a straight line, chasing someone, running towards a coordinate, etc. These API methods allow you to modify a mob's AI state: ```js /** * Gets the current AI state for the given mob. * * @param {MobId} mobId * @returns { { state: MobAiState; params: MobAiStateParams } } */ getMobAiState(mobId) /** * Sets the current AI state for the given mob. * Some AI states will require context such as the ID of the lifeform being chased. * * @param {MobId} mobId * @param {TState} state * @param {MobAiStateParams} params * @returns {void} */ setMobAiState(mobId, state, params) ``` Here is the full list of available mob AI states and their parameters: | State | Description | Parameters | |-------|-------------|------------| | `idle` | The mob is stood still, but it still has awareness of its environment.
For example: if the mob is hostile, it will still chase and attack nearby players. | `null` | | `disabled` | The mob is stood still, and it has no awareness of its environment.
It will not even react if provoked. | `null` | | `idleBeforeTurning` | The mob is stood still (idle) and is about to turn. | `null` | | `turning` | The mob has chosen a new direction at random and is turning to face it. | `null` | | `idleBeforeWalking` | The mob is stood still (idle) and is about to walk. | `null` | | `walking` | The mob is walking in the direction it is facing. | `null` | | `runningAway` | The mob is running away from the target lifeform. | `{ targetId: LifeformId }` | | `chasing` | The mob is chasing the target lifeform. | `{ targetId: LifeformId }` | | `following` | The mob is following the target lifeform.
It will stop if it is within the `minFollowingDistance` (mob setting) of the target,
and teleport to the target if it is outside the `maxFollowingDistance` (mob setting) of the target. | `{ targetId: LifeformId }` | | `watching` | The mob is stood still looking at the target. | `{ targetId: LifeformId }` | | `walkingToPosition` | The mob is walking towards the position.
It will stop if it is within the `stoppingRadius` (mob setting) of the position. | `{ pos: Pos }` | | `runningToPosition` | The mob is running towards the position.
It will stop if it is within the `stoppingRadius` (mob setting) of the position. | `{ pos: Pos }` | # Mob Settings These impact the behaviour of mobs, what they look like, and how they sound. These can either be set on a per-mob basis or the default can be set for all mobs of a particular type. These API methods allow you to modify mob settings: ```js /** * Returns the current default value for a mob setting. * * @param {TMobType} mobType * @param {TMobSetting} setting * @returns {MobSettings[TMobSetting]} */ getDefaultMobSetting(mobType, setting) /** * Set the default value for a mob setting. * * @param {TMobType} mobType * @param {TMobSetting} setting * @param {MobSettings[TMobSetting]} value * @returns {void} */ setDefaultMobSetting(mobType, setting, value) /** * Get the current value of a mob setting for a specific mob. * * @param {MobId} mobId * @param {TMobSetting} setting * @param {boolean} [returnDefaultIfNotOverridden] - If true, return the default setting if not overridden. * @returns {MobSettings[TMobSetting]} */ getMobSetting(mobId, setting, returnDefaultIfNotOverridden) /** * Set the current value of a mob setting for a specific mob. * * @param {MobId} mobId * @param {TMobSetting} setting * @param {MobSettings[TMobSetting]} value * @returns {void} */ setMobSetting(mobId, setting, value) ``` Here is the full list of available mob settings: ## attackDamage **Type:** `number` **Example:** `0` ## attackEffectDuration **Type:** `number` **Example:** `0` ## attackEffectName **Type:** `string` **Example:** `null` ## attackImpulse **Type:** `number` **Example:** `0` ## attackInterval **Type:** `number` **Example:** `0` ## attackItemName **Type:** `string` **Example:** `null` ## attackRadius **Type:** `number` **Example:** `0` ## attackSound **Type:** `string` **Example:** `null` ## baseJumpImpulseXZ **Type:** `number` **Example:** `0` ## baseJumpImpulseY **Type:** `number` **Example:** `0` ## baseRunningSpeed **Type:** `number` **Example:** `4.55 * 0.85` ## baseWalkingSpeed **Type:** `number` **Example:** `3.5` ## burstAttackInfo **Type:** ` { burstAttackIntervals: readonly number[]; } ` **Example:** `null` ## chaseRadius **Type:** `number` **Example:** `0` ## combatTetherInfo **Type:** `MobCombatTetherCombatInfo` **Example:** ```ts { range: 11, particleOpts: { texture: "soul_0", colorGradients: [ { timeFraction: 0, minColor: [245, 35, 25, 1], maxColor: [255, 45, 35, 1], }, ], }, } ``` ## evadeInfo **Type:** `MobEvadeInfo` **Example:** ```ts { probability: 0.6, minAngle: Math.PI * 0.35, maxAngle: Math.PI * 0.6, impulse: 8, } ``` ## healthRegen **Type:** ` { amount: number; interval: number; startAfter: number; } ` **Example:** `null` ## heldItemName **Type:** `string` **Example:** `null` ## hostilityRadius **Type:** `number` **Example:** `0` ## hurtSound **Type:** `string` **Example:** `"pigHurt"` ## idleSound **Type:** `string` **Example:** `"pigOink"` ## initialHealth **Type:** `number` **Example:** `75` ## isRideable **Type:** `boolean` **Example:** `false` ## jumpCount **Type:** `number` **Example:** `0` ## jumpMultiplier **Type:** `number` **Example:** `1` ## maxFollowingRadius **Type:** `number` **Example:** `12` ## maxHealth **Type:** `number` **Example:** `75` ## metaInfo **Type:** `string` **Example:** `""` ## minFollowingRadius **Type:** `number` **Example:** `5` ## name **Type:** `string` **Example:** `""` ## onDeathAura **Type:** `number` **Example:** `20` ## onDeathItemDrops **Type:** ` { itemName: string; probabilityOfDrop: number; dropMinAmount: number; dropMaxAmount: number; applyBurstImpulseToDrop?: boolean; }[] ` **Example:** ```ts [ { itemName: "Raw Porkchop", probabilityOfDrop: 1, dropMinAmount: 1, dropMaxAmount: 3, }, ] ``` ## onDeathParticleTexture **Type:** `string` **Example:** `"critical_hit"` ## onTamedHealthMultiplier **Type:** `number` **Example:** `4.0` ## ownerDbId **Type:** `string` **Example:** `null` ## petInfo **Type:** `MobPetInfo` **Example:** ```ts { friendshipPoints: 0, lastFedAt: null, highestFriendshipLevelReached: 0, superlikedFood: null, superlikedFoodKnown: false, bonusesGained: [], } ``` ## ridingSpeedMult **Type:** `number` **Example:** `1` ## runAwayRadius **Type:** `number` **Example:** `0` ## runningSpeedMultiplier **Type:** `number` **Example:** `1` ## secondaryAttackDamage **Type:** `number` **Example:** `0` ## secondaryAttackImpulse **Type:** `number` **Example:** `0` ## secondaryAttackItemName **Type:** `string` **Example:** `null` ## secondaryAttackRadius **Type:** `number` **Example:** `0` ## secondaryAttackSound **Type:** `string` **Example:** `null` ## secondaryBurstAttackInfo **Type:** ` { burstAttackIntervals: readonly number[]; } ` **Example:** `null` ## stoppingRadius **Type:** `number` **Example:** `0.5` ## swingArmOnAttack **Type:** `boolean` **Example:** `true` ## swingArmOnSecondaryAttack **Type:** `boolean` **Example:** `true` /** * @type {MobTameInfo} */ tameInfo = { tameItemName: [ "Raw Porkchop", "Raw Beef", "Raw Mutton", "Raw Venison", "Cooked Porkchop", "Steak", "Cooked Mutton", "Cooked Venison" ], probabilityOfTame: 0.32, isSaddleable: false, supportsFriendship: true, likedFoods: [ "Raw Porkchop", "Raw Beef", "Raw Mutton", "Raw Venison", "Cooked Porkchop", "Steak", "Cooked Mutton", "Cooked Venison", "Banana", "Baked Potato", "Rotten Brain" ], neutralFoods: [ "Catnip", "Pumpkin Pie", "Bowl of Cranberries", "Watermelon Slice", "Gold Watermelon Slice", "Bread", "Rotten Flesh", "Mushroom Soup", "Plum", "Carrot", "Beetroot", "Raw Potato" ], dislikedFoods: [ "Apple", "Wheat", "Pear", "Cherry", "Bowl of Rice", "Melon Slice", "Gold Melon Slice", "Chili Pepper", "Cracked Coconut" ], foodItemsWithEffects: [ { itemName: "Catnip", effects: [ { name: "Speed", duration: 30000, level: 1 }, { name: "Damage", duration: 30000, level: 1 } ] } ], guaranteedDrop: "Caught Fish", commonDrops: [ "Poop", "Wheat Seeds" ], levelUpBonuses: { 1: "Renaming", 2: "Special Drops", 3: "Damage +", 4: "Painting", 5: "Poison Claws" } } ## territoryRadius **Type:** `number` **Example:** `0` ## variation **Type:** `"default"` **Example:** `"default"` ## walkingSpeedMultiplier **Type:** `number` **Example:** `1` ## warpTargetSpecialAttackInfo **Type:** `MobWarpTargetSpecialAttackInfo` **Example:** ```ts { cooldown: 20_000, range: 32, sound: "warperPhase", delay: 1_000, minDestinationRadius: 5, maxDestinationRadius: 7, swingArm: false, particleOpts: { duration: 2_000, texture: "soul_0", colorGradients: [ { timeFraction: 0, minColor: [70, 215, 230, 1], maxColor: [75, 225, 240, 1], }, ], }, } ``` ## Mob Variations Some mob types support variations other than just `"default"`: ```js 67: "default" Pig: "default" Cow: "default", "cream" Sheep: "default", "black", "red", "orange", "pink", "purple", "yellow", "blue", "brown", "cyan", "gray", "green", "lightBlue", "lightGray", "lime", "magenta" Horse: "default", "black", "brown", "cream" Cave Golem: "default", "iron" Draugr Zombie: "default", "longHairChestplate", "longHairClothed", "shortHairClothed" Draugr Skeleton: "default" Frost Golem: "default" Frost Zombie: "default", "longHairChestplate", "shortHairClothed" Frost Skeleton: "default" Draugr Knight: "default" Wolf: "default", "white", "brown", "grey", "spectral" Bear: "default" Deer: "default" Stag: "default" Gold Watermelon Stag: "default" Gorilla: "default" Wildcat: "default", "tabby", "grey", "black", "calico", "siamese", "leopard" Magma Golem: "default" Draugr Huntress: "default", "chainmail" Spirit Golem: "default" Spirit Wolf: "default" Spirit Bear: "default" Spirit Stag: "default" Spirit Gorilla: "default" Draugr Warper: "default" Frost Wraith: "default" Draugr Reaver: "default" NPC: "default", "emma", "leo", "isabel", "sanjay", "imara", "enoch", "sara", "carmen" Bobino Musculino: "default" Capitano Explovissimo: "default" ``` ## Mob AI A mob's AI state determines its behaviour, e.g.: whether it is stood still, walking in a straight line, chasing someone, running towards a coordinate, etc. These API methods allow you to modify a mob's AI state: ```js /** * Gets the current AI state for the given mob. * * @param {MobId} mobId * @returns { { state: MobAiState; params: MobAiStateParams } } */ getMobAiState(mobId) /** * Sets the current AI state for the given mob. * Some AI states will require context such as the ID of the lifeform being chased. * * @param {MobId} mobId * @param {TState} state * @param {MobAiStateParams} params * @returns {void} */ setMobAiState(mobId, state, params) ``` Here is the full list of available mob AI states and their parameters: | State | Description | Parameters | |-------|-------------|------------| | `idle` | The mob is stood still, but it still has awareness of its environment.
For example: if the mob is hostile, it will still chase and attack nearby players. | `null` | | `disabled` | The mob is stood still, and it has no awareness of its environment.
It will not even react if provoked. | `null` | | `idleBeforeTurning` | The mob is stood still (idle) and is about to turn. | `null` | | `turning` | The mob has chosen a new direction at random and is turning to face it. | `null` | | `idleBeforeWalking` | The mob is stood still (idle) and is about to walk. | `null` | | `walking` | The mob is walking in the direction it is facing. | `null` | | `runningAway` | The mob is running away from the target lifeform. | `{ targetId: LifeformId }` | | `chasing` | The mob is chasing the target lifeform. | `{ targetId: LifeformId }` | | `following` | The mob is following the target lifeform.
It will stop if it is within the `minFollowingDistance` (mob setting) of the target,
and teleport to the target if it is outside the `maxFollowingDistance` (mob setting) of the target. | `{ targetId: LifeformId }` | | `watching` | The mob is stood still looking at the target. | `{ targetId: LifeformId }` | | `walkingToPosition` | The mob is walking towards the position.
It will stop if it is within the `stoppingRadius` (mob setting) of the position. | `{ pos: Pos }` | | `runningToPosition` | The mob is running towards the position.
It will stop if it is within the `stoppingRadius` (mob setting) of the position. | `{ pos: Pos }` | # Particles These are the strings you can give to functions that take a particle effect `texture` as input: `bubble` `critical_hit` `drift` `effect_5` `generic_2` `glint` `heart` `scary_face` `soul_0` `square_particle` `z-particle` Here's the code for an example particle effect: ```ts let [x, y, z] = thisPos y += 1 api.playParticleEffect({ dir1: [-1, -1, -1], dir2: [1, 1, 1], pos1: [x, y, z], pos2: [x + 1, y + 1, z + 1], texture: "bubble", minLifeTime: 0.2, maxLifeTime: 0.6, minEmitPower: 2, maxEmitPower: 2, minSize: 0.25, maxSize: 0.35, manualEmitCount: 20, gravity: [0, -10, 0], colorGradients: [ { timeFraction: 0, minColor: [60, 60, 150, 1], maxColor: [200, 200, 255, 1], }, ], velocityGradients: [ { timeFraction: 0, factor: 1, factor2: 1, }, ], blendMode: 1, }) ``` You can also use a `presetId` instead to use a pre-defined particle effect, to replicate effects we use in-engine. Here is the code for an example of using a presetId: ```ts let [x, y, z] = thisPos y += 1 api.playParticleEffect({ presetId: "aura", pos1: [x, y, z], pos2: [x + 1, y + 1, z + 1], }) ``` Here is a list of the presetIds you can use: `brainRot` `stomp` `fertiliser` `bonemeal` `mobTameSuccess` `mobTameFailure` `mobCatch` `spawnCaughtMob` `mobFeedDefault` `mobFeedSuperliked` `mobFeedLike` `mobFeedNeutral` `mobFeedDisliked` `mobDeath` `mobDeathSoul` `boardShopSuccess` `mobSpawnerBlockFail` `mobSpawnerBlockPassive` `mobSpawnerBlockNeutral` `mobSpawnerBlockHostile` `mobSpawnOrb` `aura` `yellowFirecrackerSmall` `yellowFirecrackerLarge` `whiteFirecrackerSmall` `whiteFirecrackerLarge` `redFirecrackerSmall` `redFirecrackerLarge` `purpleFirecrackerSmall` `purpleFirecrackerLarge` `pinkFirecrackerSmall` `pinkFirecrackerLarge` `orangeFirecrackerSmall` `orangeFirecrackerLarge` `magentaFirecrackerSmall` `magentaFirecrackerLarge` `limeFirecrackerSmall` `limeFirecrackerLarge` `lightGrayFirecrackerSmall` `lightGrayFirecrackerLarge` `lightBlueFirecrackerSmall` `lightBlueFirecrackerLarge` `greenFirecrackerSmall` `greenFirecrackerLarge` `grayFirecrackerSmall` `grayFirecrackerLarge` `cyanFirecrackerSmall` `cyanFirecrackerLarge` `brownFirecrackerSmall` `brownFirecrackerLarge` `blueFirecrackerSmall` `blueFirecrackerLarge` `blackFirecrackerSmall` `blackFirecrackerLarge` `defaultFirecrackerSmall` `defaultFirecrackerLarge` `mango` `speedInner` `speedOuter` `damageReductionInner` `damageReductionOuter` `damageInner` `damageOuter` `invisibleInner` `invisibleOuter` `jumpBoostInner` `jumpBoostOuter` `knockbackInner` `knockbackOuter` `poisonedInner` `poisonedOuter` `slownessInner` `slownessOuter` `weaknessInner` `weaknessOuter` `cleansedInner` `cleansedOuter` `instantDamageInner` `instantDamageOuter` `healthRegenInner` `healthRegenOuter` `instantHealthInner` `instantHealthOuter` `hasteInner` `hasteOuter` `shieldInner` `shieldOuter` `doubleJumpInner` `doubleJumpOuter` `heatResistanceInner` `heatResistanceOuter` `thiefInner` `thiefOuter` `xRayVisionInner` `xRayVisionOuter` `miningYieldInner` `miningYieldOuter` `brainRotInner` `brainRotOuter` `auraInner` `auraOuter` `wallClimbingInner` `wallClimbingOuter` `airWalkInner` `airWalkOuter` `pickpocketerInner` `pickpocketerOuter` `lifestealInner` `lifestealOuter` `bouncinessInner` `bouncinessOuter` `blindnessInner` `blindnessOuter` `poopyInner` `poopyOuter` # Particles These are the strings you can give to functions that take a particle effect `texture` as input: `bubble` `critical_hit` `drift` `effect_5` `generic_2` `glint` `heart` `scary_face` `soul_0` `square_particle` `z-particle` Here's the code for an example particle effect: ```ts let [x, y, z] = thisPos y += 1 api.playParticleEffect({ dir1: [-1, -1, -1], dir2: [1, 1, 1], pos1: [x, y, z], pos2: [x + 1, y + 1, z + 1], texture: "bubble", minLifeTime: 0.2, maxLifeTime: 0.6, minEmitPower: 2, maxEmitPower: 2, minSize: 0.25, maxSize: 0.35, manualEmitCount: 20, gravity: [0, -10, 0], colorGradients: [ { timeFraction: 0, minColor: [60, 60, 150, 1], maxColor: [200, 200, 255, 1], }, ], velocityGradients: [ { timeFraction: 0, factor: 1, factor2: 1, }, ], blendMode: 1, }) ``` You can also use a `presetId` instead to use a pre-defined particle effect, to replicate effects we use in-engine. Here is the code for an example of using a presetId: ```ts let [x, y, z] = thisPos y += 1 api.playParticleEffect({ presetId: "aura", pos1: [x, y, z], pos2: [x + 1, y + 1, z + 1], }) ``` Here is a list of the presetIds you can use: `brainRot` `stomp` `fertiliser` `bonemeal` `mobTameSuccess` `mobTameFailure` `mobCatch` `spawnCaughtMob` `mobFeedDefault` `mobFeedSuperliked` `mobFeedLike` `mobFeedNeutral` `mobFeedDisliked` `mobDeath` `mobDeathSoul` `boardShopSuccess` `mobSpawnerBlockFail` `mobSpawnerBlockPassive` `mobSpawnerBlockNeutral` `mobSpawnerBlockHostile` `mobSpawnOrb` `aura` `yellowFirecrackerSmall` `yellowFirecrackerLarge` `whiteFirecrackerSmall` `whiteFirecrackerLarge` `redFirecrackerSmall` `redFirecrackerLarge` `purpleFirecrackerSmall` `purpleFirecrackerLarge` `pinkFirecrackerSmall` `pinkFirecrackerLarge` `orangeFirecrackerSmall` `orangeFirecrackerLarge` `magentaFirecrackerSmall` `magentaFirecrackerLarge` `limeFirecrackerSmall` `limeFirecrackerLarge` `lightGrayFirecrackerSmall` `lightGrayFirecrackerLarge` `lightBlueFirecrackerSmall` `lightBlueFirecrackerLarge` `greenFirecrackerSmall` `greenFirecrackerLarge` `grayFirecrackerSmall` `grayFirecrackerLarge` `cyanFirecrackerSmall` `cyanFirecrackerLarge` `brownFirecrackerSmall` `brownFirecrackerLarge` `blueFirecrackerSmall` `blueFirecrackerLarge` `blackFirecrackerSmall` `blackFirecrackerLarge` `defaultFirecrackerSmall` `defaultFirecrackerLarge` `mango` `speedInner` `speedOuter` `damageReductionInner` `damageReductionOuter` `damageInner` `damageOuter` `invisibleInner` `invisibleOuter` `jumpBoostInner` `jumpBoostOuter` `knockbackInner` `knockbackOuter` `poisonedInner` `poisonedOuter` `slownessInner` `slownessOuter` `weaknessInner` `weaknessOuter` `cleansedInner` `cleansedOuter` `instantDamageInner` `instantDamageOuter` `healthRegenInner` `healthRegenOuter` `instantHealthInner` `instantHealthOuter` `hasteInner` `hasteOuter` `shieldInner` `shieldOuter` `doubleJumpInner` `doubleJumpOuter` `heatResistanceInner` `heatResistanceOuter` `thiefInner` `thiefOuter` `xRayVisionInner` `xRayVisionOuter` `miningYieldInner` `miningYieldOuter` `brainRotInner` `brainRotOuter` `auraInner` `auraOuter` `wallClimbingInner` `wallClimbingOuter` `airWalkInner` `airWalkOuter` `pickpocketerInner` `pickpocketerOuter` `lifestealInner` `lifestealOuter` `bouncinessInner` `bouncinessOuter` `blindnessInner` `blindnessOuter` `poopyInner` `poopyOuter` # Particles These are the strings you can give to functions that take a particle effect `texture` as input: `bubble` `critical_hit` `drift` `effect_5` `generic_2` `glint` `heart` `scary_face` `soul_0` `square_particle` `z-particle` Here's the code for an example particle effect: ```ts let [x, y, z] = thisPos y += 1 api.playParticleEffect({ dir1: [-1, -1, -1], dir2: [1, 1, 1], pos1: [x, y, z], pos2: [x + 1, y + 1, z + 1], texture: "bubble", minLifeTime: 0.2, maxLifeTime: 0.6, minEmitPower: 2, maxEmitPower: 2, minSize: 0.25, maxSize: 0.35, manualEmitCount: 20, gravity: [0, -10, 0], colorGradients: [ { timeFraction: 0, minColor: [60, 60, 150, 1], maxColor: [200, 200, 255, 1], }, ], velocityGradients: [ { timeFraction: 0, factor: 1, factor2: 1, }, ], blendMode: 1, }) ``` You can also use a `presetId` instead to use a pre-defined particle effect, to replicate effects we use in-engine. Here is the code for an example of using a presetId: ```ts let [x, y, z] = thisPos y += 1 api.playParticleEffect({ presetId: "aura", pos1: [x, y, z], pos2: [x + 1, y + 1, z + 1], }) ``` Here is a list of the presetIds you can use: `brainRot` `stomp` `fertiliser` `bonemeal` `mobTameSuccess` `mobTameFailure` `mobCatch` `spawnCaughtMob` `mobFeedDefault` `mobFeedSuperliked` `mobFeedLike` `mobFeedNeutral` `mobFeedDisliked` `mobDeath` `mobDeathSoul` `boardShopSuccess` `mobSpawnerBlockFail` `mobSpawnerBlockPassive` `mobSpawnerBlockNeutral` `mobSpawnerBlockHostile` `mobSpawnOrb` `aura` `yellowFirecrackerSmall` `yellowFirecrackerLarge` `whiteFirecrackerSmall` `whiteFirecrackerLarge` `redFirecrackerSmall` `redFirecrackerLarge` `purpleFirecrackerSmall` `purpleFirecrackerLarge` `pinkFirecrackerSmall` `pinkFirecrackerLarge` `orangeFirecrackerSmall` `orangeFirecrackerLarge` `magentaFirecrackerSmall` `magentaFirecrackerLarge` `limeFirecrackerSmall` `limeFirecrackerLarge` `lightGrayFirecrackerSmall` `lightGrayFirecrackerLarge` `lightBlueFirecrackerSmall` `lightBlueFirecrackerLarge` `greenFirecrackerSmall` `greenFirecrackerLarge` `grayFirecrackerSmall` `grayFirecrackerLarge` `cyanFirecrackerSmall` `cyanFirecrackerLarge` `brownFirecrackerSmall` `brownFirecrackerLarge` `blueFirecrackerSmall` `blueFirecrackerLarge` `blackFirecrackerSmall` `blackFirecrackerLarge` `defaultFirecrackerSmall` `defaultFirecrackerLarge` `mango` `speedInner` `speedOuter` `damageReductionInner` `damageReductionOuter` `damageInner` `damageOuter` `invisibleInner` `invisibleOuter` `jumpBoostInner` `jumpBoostOuter` `knockbackInner` `knockbackOuter` `poisonedInner` `poisonedOuter` `slownessInner` `slownessOuter` `weaknessInner` `weaknessOuter` `cleansedInner` `cleansedOuter` `instantDamageInner` `instantDamageOuter` `healthRegenInner` `healthRegenOuter` `instantHealthInner` `instantHealthOuter` `hasteInner` `hasteOuter` `shieldInner` `shieldOuter` `doubleJumpInner` `doubleJumpOuter` `heatResistanceInner` `heatResistanceOuter` `thiefInner` `thiefOuter` `xRayVisionInner` `xRayVisionOuter` `miningYieldInner` `miningYieldOuter` `brainRotInner` `brainRotOuter` `auraInner` `auraOuter` `wallClimbingInner` `wallClimbingOuter` `airWalkInner` `airWalkOuter` `pickpocketerInner` `pickpocketerOuter` `lifestealInner` `lifestealOuter` `bouncinessInner` `bouncinessOuter` `blindnessInner` `blindnessOuter` `poopyInner` `poopyOuter` # Quick Time Events (QTEs) QTEs are interactive prompts shown to a player that require a response (clicking, holding, etc). They are triggered from server-side game code via `api.addQTE()` and the result is received via the `onPlayerFinishQTE` callback. ## Overview - **`progressBar`**: Click rapidly to fill a progress bar before it drains to zero. - **`timedClick`**: Click within a time window to succeed. - **`gravityBar`**: Hold click to keep a catch zone aligned with a moving target. - **`precisionBar`**: Click when the marker is within the success zone to succeed. - **`rhythmClick`**: Click when a shrinking outer circle aligns with a fixed inner circle. ## `progressBar` The player clicks repeatedly to increase a progress bar. The bar drains continuously over time. Reaching 100% completes the QTE successfully. If `canFail` is true and progress reaches 0, the QTE fails; otherwise progress is clamped at 0 and the player can keep trying. ### Parameters ```ts type ProgressBarQteParams = { progressStartValue?: number // Starting progress value (0-100). default: 30 progressDecreasePerTick: number // How much progress drains each tick while the player isn't clicking. default: 0.075 progressPerClick: number // How much progress is gained per click. default: 5 canFail: boolean // If true, the QTE fails when progress reaches 0; otherwise progress clamps at 0. default: false description: CustomTextStyling // Rich text shown as the QTE prompt. default: [{ str: "Click repeatedly to complete!" }] clickIcon: string // Icon displayed on the click target. default: "fa-solid fa-computer-mouse" scale?: number // Scale multiplier for the click icon (must be > 0). default: 1 rotation?: number // Rotation in degrees for the click icon (must be ≥ 0). default: 15 } ``` ### Sensible Defaults ```ts api.addQTE(playerId, { type: "progressBar", parameters: { progressStartValue: 30, progressDecreasePerTick: 0.075, progressPerClick: 5, canFail: false, description: [{ str: "Click repeatedly to complete!" }], clickIcon: "fa-solid fa-computer-mouse", scale: 1, rotation: 15, }, }) ``` ## `timedClick` A prompt appears and the player must click before the timer runs out. Clicking within the time window succeeds; letting it expire fails the QTE. ### Parameters ```ts type TimedClickQteParams = { timeWindow: number // Duration in milliseconds the player has to click. default: 3000 icon: string // Icon displayed on the click target. default: "fa-solid fa-computer-mouse" label: CustomTextStyling // Rich text shown as the QTE prompt. default: [{ str: "Click to complete the QTE!" }] showTimer: boolean // Whether to display a countdown timer. default: true scale?: number // Scale multiplier for the icon (must be > 0). default: 1 rotation?: number // Rotation in degrees for the icon (must be ≥ 0). default: 15 breatheCenter?: boolean // If true, the icon pulses with a breathing animation anchored to the centre. default: false } ``` ### Sensible Defaults ```ts api.addQTE(playerId, { type: "timedClick", parameters: { timeWindow: 3000, icon: "fa-solid fa-computer-mouse", label: [{ str: "Click to complete the QTE!" }], showTimer: true, scale: 1, rotation: 15, breatheCenter: false, }, }) ``` ## `gravityBar` A mover travels along a bar, periodically changing direction. The player holds click to push their catch zone upward and releases to let gravity pull it down. Progress fills while the mover overlaps the catch zone and drains when it doesn't. Reaching 100% succeeds. If `canFail` is true, hitting 0% fails the QTE. ### Parameters ```ts type GravityBarQteParams = { progressStartValue?: number // Starting progress value (0-100). default: 30 catchZoneSize: number // Size of the player's catch zone as a fraction of the bar (must be > 0, 0-1). default: 0.25 moverSpeed: number // Speed at which the mover travels along the bar (must be > 0). default: 3 moverErraticness: number // How erratically the mover changes direction (higher = more unpredictable). default: 0.8 gravity: number // Downward pull on the catch zone when the player isn't holding click. default: 1 riseSpeed: number // Upward force on the catch zone while the player holds click. default: 1.5 progressGainPerSecond: number // Progress gained per second while the mover is inside the catch zone. default: 8 progressDrainPerSecond: number // Progress lost per second while the mover is outside the catch zone. default: 4 canFail: boolean // If true, the QTE fails when progress reaches 0; otherwise progress clamps at 0. default: false description: CustomTextStyling // Rich text shown as the QTE prompt. default: [{ str: "Hold to catch!" }] icon?: string // Icon displayed on the mover. default: "Moonfish" } ``` ### Sensible Defaults ```ts api.addQTE(playerId, { type: "gravityBar", parameters: { progressStartValue: 30, catchZoneSize: 0.25, moverSpeed: 3, moverErraticness: 0.8, gravity: 1, riseSpeed: 1.5, progressGainPerSecond: 8, progressDrainPerSecond: 4, canFail: false, description: [{ str: "Hold to catch!" }], icon: "Moonfish", }, }) ``` ## `precisionBar` A marker oscillates back and forth along a bar. A highlighted success zone sits in the centre. The player has one click — if the marker is inside the success zone, the QTE succeeds; otherwise it fails. The marker keeps bouncing indefinitely until the player clicks. ### Parameters ```ts type PrecisionBarQteParams = { speed: number // Speed of the marker in full bar-widths per second (must be > 0, e.g. 1.0 = one full sweep per second). default: 0.5 successZoneSize: number // Fraction of the bar that counts as the success zone, centred in the middle (must be > 0, 0-1, e.g. 0.15 = 15%). default: 0.15 label: CustomTextStyling // Rich text shown as the QTE prompt. default: [{ str: "Click when the marker is within the green zone." }] icon?: string // Icon displayed on the marker. default: "" scale?: number // Scale multiplier for the icon (must be > 0). default: 1 rotation?: number // Rotation in degrees for the icon (must be ≥ 0). default: 0 } ``` ### Sensible Defaults ```ts api.addQTE(playerId, { type: "precisionBar", parameters: { speed: 0.5, successZoneSize: 0.15, label: [{ str: "Click when the marker is within the green zone." }], icon: "", scale: 1, rotation: 0, }, }) ``` ## `rhythmClick` An outer circle shrinks toward a fixed inner circle. The player must click when the two overlap. Each successful click counts toward `requiredSuccesses`. Missing the window (clicking too early/late or letting the circle pass without clicking) counts as a miss. If `maxMisses` is set and exceeded, the QTE fails; otherwise missed attempts simply reset the circle for another try. ### Parameters ```ts type RhythmClickQteParams = { requiredSuccesses: number // Number of successful clicks needed to complete the QTE (must be a positive integer). default: 5 shrinkDurationMs: number // Duration in milliseconds for the outer circle to shrink from max size to centre (must be > 0). default: 1200 toleranceFraction: number // Fraction of the inner circle radius that counts as a successful overlap (must be > 0, 0-1, e.g. 0.15 = ±15%). default: 0.15 maxMisses?: number // Max misses allowed before failing. If omitted, unlimited misses are permitted (must be a non-negative integer). default: 3 label: CustomTextStyling // Rich text shown as the QTE prompt. default: [{ str: "Click when the circles align!" }] icon?: string // Icon displayed in the centre of the circles. default: "" } ``` ### Sensible Defaults ```ts api.addQTE(playerId, { type: "rhythmClick", parameters: { requiredSuccesses: 5, shrinkDurationMs: 1200, toleranceFraction: 0.15, maxMisses: 3, label: [{ str: "Click when the circles align!" }], icon: "", }, }) ``` ## Usage ### Starting a QTE ```ts const qteId = api.addQTE(playerId, { type: "progressBar", parameters: { progressDecreasePerTick: 0.075, progressPerClick: 7, canFail: false, description: [{ str: "Click repeatedly to complete!" }], clickIcon: "fa-solid fa-computer-mouse", }, }) ``` ### Handling the Result ```ts onPlayerFinishQTE(playerId, qteId, result) { if (result) { // Player succeeded } else { // Player failed } } ``` ### Cancelling a QTE ```ts api.deleteQTE(playerId, qteId) ``` ### Checking Active QTEs ```ts const hasQTE = api.hasActiveQTE(playerId) ``` # Quick Time Events (QTEs) QTEs are interactive prompts shown to a player that require a response (clicking, holding, etc). They are triggered from server-side game code via `api.addQTE()` and the result is received via the `onPlayerFinishQTE` callback. ## Overview - **`progressBar`**: Click rapidly to fill a progress bar before it drains to zero. - **`timedClick`**: Click within a time window to succeed. - **`gravityBar`**: Hold click to keep a catch zone aligned with a moving target. - **`precisionBar`**: Click when the marker is within the success zone to succeed. - **`rhythmClick`**: Click when a shrinking outer circle aligns with a fixed inner circle. ## `progressBar` The player clicks repeatedly to increase a progress bar. The bar drains continuously over time. Reaching 100% completes the QTE successfully. If `canFail` is true and progress reaches 0, the QTE fails; otherwise progress is clamped at 0 and the player can keep trying. ### Parameters ```ts type ProgressBarQteParams = { progressStartValue?: number // Starting progress value (0-100). default: 30 progressDecreasePerTick: number // How much progress drains each tick while the player isn't clicking. default: 0.075 progressPerClick: number // How much progress is gained per click. default: 5 canFail: boolean // If true, the QTE fails when progress reaches 0; otherwise progress clamps at 0. default: false description: CustomTextStyling // Rich text shown as the QTE prompt. default: [{ str: "Click repeatedly to complete!" }] clickIcon: string // Icon displayed on the click target. default: "fa-solid fa-computer-mouse" scale?: number // Scale multiplier for the click icon (must be > 0). default: 1 rotation?: number // Rotation in degrees for the click icon (must be ≥ 0). default: 15 } ``` ### Sensible Defaults ```ts api.addQTE(playerId, { type: "progressBar", parameters: { progressStartValue: 30, progressDecreasePerTick: 0.075, progressPerClick: 5, canFail: false, description: [{ str: "Click repeatedly to complete!" }], clickIcon: "fa-solid fa-computer-mouse", scale: 1, rotation: 15, }, }) ``` ## `timedClick` A prompt appears and the player must click before the timer runs out. Clicking within the time window succeeds; letting it expire fails the QTE. ### Parameters ```ts type TimedClickQteParams = { timeWindow: number // Duration in milliseconds the player has to click. default: 3000 icon: string // Icon displayed on the click target. default: "fa-solid fa-computer-mouse" label: CustomTextStyling // Rich text shown as the QTE prompt. default: [{ str: "Click to complete the QTE!" }] showTimer: boolean // Whether to display a countdown timer. default: true scale?: number // Scale multiplier for the icon (must be > 0). default: 1 rotation?: number // Rotation in degrees for the icon (must be ≥ 0). default: 15 breatheCenter?: boolean // If true, the icon pulses with a breathing animation anchored to the centre. default: false } ``` ### Sensible Defaults ```ts api.addQTE(playerId, { type: "timedClick", parameters: { timeWindow: 3000, icon: "fa-solid fa-computer-mouse", label: [{ str: "Click to complete the QTE!" }], showTimer: true, scale: 1, rotation: 15, breatheCenter: false, }, }) ``` ## `gravityBar` A mover travels along a bar, periodically changing direction. The player holds click to push their catch zone upward and releases to let gravity pull it down. Progress fills while the mover overlaps the catch zone and drains when it doesn't. Reaching 100% succeeds. If `canFail` is true, hitting 0% fails the QTE. ### Parameters ```ts type GravityBarQteParams = { progressStartValue?: number // Starting progress value (0-100). default: 30 catchZoneSize: number // Size of the player's catch zone as a fraction of the bar (must be > 0, 0-1). default: 0.25 moverSpeed: number // Speed at which the mover travels along the bar (must be > 0). default: 3 moverErraticness: number // How erratically the mover changes direction (higher = more unpredictable). default: 0.8 gravity: number // Downward pull on the catch zone when the player isn't holding click. default: 1 riseSpeed: number // Upward force on the catch zone while the player holds click. default: 1.5 progressGainPerSecond: number // Progress gained per second while the mover is inside the catch zone. default: 8 progressDrainPerSecond: number // Progress lost per second while the mover is outside the catch zone. default: 4 canFail: boolean // If true, the QTE fails when progress reaches 0; otherwise progress clamps at 0. default: false description: CustomTextStyling // Rich text shown as the QTE prompt. default: [{ str: "Hold to catch!" }] icon?: string // Icon displayed on the mover. default: "Moonfish" } ``` ### Sensible Defaults ```ts api.addQTE(playerId, { type: "gravityBar", parameters: { progressStartValue: 30, catchZoneSize: 0.25, moverSpeed: 3, moverErraticness: 0.8, gravity: 1, riseSpeed: 1.5, progressGainPerSecond: 8, progressDrainPerSecond: 4, canFail: false, description: [{ str: "Hold to catch!" }], icon: "Moonfish", }, }) ``` ## `precisionBar` A marker oscillates back and forth along a bar. A highlighted success zone sits in the centre. The player has one click — if the marker is inside the success zone, the QTE succeeds; otherwise it fails. The marker keeps bouncing indefinitely until the player clicks. ### Parameters ```ts type PrecisionBarQteParams = { speed: number // Speed of the marker in full bar-widths per second (must be > 0, e.g. 1.0 = one full sweep per second). default: 0.5 successZoneSize: number // Fraction of the bar that counts as the success zone, centred in the middle (must be > 0, 0-1, e.g. 0.15 = 15%). default: 0.15 label: CustomTextStyling // Rich text shown as the QTE prompt. default: [{ str: "Click when the marker is within the green zone." }] icon?: string // Icon displayed on the marker. default: "" scale?: number // Scale multiplier for the icon (must be > 0). default: 1 rotation?: number // Rotation in degrees for the icon (must be ≥ 0). default: 0 } ``` ### Sensible Defaults ```ts api.addQTE(playerId, { type: "precisionBar", parameters: { speed: 0.5, successZoneSize: 0.15, label: [{ str: "Click when the marker is within the green zone." }], icon: "", scale: 1, rotation: 0, }, }) ``` ## `rhythmClick` An outer circle shrinks toward a fixed inner circle. The player must click when the two overlap. Each successful click counts toward `requiredSuccesses`. Missing the window (clicking too early/late or letting the circle pass without clicking) counts as a miss. If `maxMisses` is set and exceeded, the QTE fails; otherwise missed attempts simply reset the circle for another try. ### Parameters ```ts type RhythmClickQteParams = { requiredSuccesses: number // Number of successful clicks needed to complete the QTE (must be a positive integer). default: 5 shrinkDurationMs: number // Duration in milliseconds for the outer circle to shrink from max size to centre (must be > 0). default: 1200 toleranceFraction: number // Fraction of the inner circle radius that counts as a successful overlap (must be > 0, 0-1, e.g. 0.15 = ±15%). default: 0.15 maxMisses?: number // Max misses allowed before failing. If omitted, unlimited misses are permitted (must be a non-negative integer). default: 3 label: CustomTextStyling // Rich text shown as the QTE prompt. default: [{ str: "Click when the circles align!" }] icon?: string // Icon displayed in the centre of the circles. default: "" } ``` ### Sensible Defaults ```ts api.addQTE(playerId, { type: "rhythmClick", parameters: { requiredSuccesses: 5, shrinkDurationMs: 1200, toleranceFraction: 0.15, maxMisses: 3, label: [{ str: "Click when the circles align!" }], icon: "", }, }) ``` ## Usage ### Starting a QTE ```ts const qteId = api.addQTE(playerId, { type: "progressBar", parameters: { progressDecreasePerTick: 0.075, progressPerClick: 7, canFail: false, description: [{ str: "Click repeatedly to complete!" }], clickIcon: "fa-solid fa-computer-mouse", }, }) ``` ### Handling the Result ```ts onPlayerFinishQTE(playerId, qteId, result) { if (result) { // Player succeeded } else { // Player failed } } ``` ### Cancelling a QTE ```ts api.deleteQTE(playerId, qteId) ``` ### Checking Active QTEs ```ts const hasQTE = api.hasActiveQTE(playerId) ``` # Quick Time Events (QTEs) QTEs are interactive prompts shown to a player that require a response (clicking, holding, etc). They are triggered from server-side game code via `api.addQTE()` and the result is received via the `onPlayerFinishQTE` callback. ## Overview - **`progressBar`**: Click rapidly to fill a progress bar before it drains to zero. - **`timedClick`**: Click within a time window to succeed. - **`gravityBar`**: Hold click to keep a catch zone aligned with a moving target. - **`precisionBar`**: Click when the marker is within the success zone to succeed. - **`rhythmClick`**: Click when a shrinking outer circle aligns with a fixed inner circle. ## `progressBar` The player clicks repeatedly to increase a progress bar. The bar drains continuously over time. Reaching 100% completes the QTE successfully. If `canFail` is true and progress reaches 0, the QTE fails; otherwise progress is clamped at 0 and the player can keep trying. ### Parameters ```ts type ProgressBarQteParams = { progressStartValue?: number // Starting progress value (0-100). default: 30 progressDecreasePerTick: number // How much progress drains each tick while the player isn't clicking. default: 0.075 progressPerClick: number // How much progress is gained per click. default: 5 canFail: boolean // If true, the QTE fails when progress reaches 0; otherwise progress clamps at 0. default: false description: CustomTextStyling // Rich text shown as the QTE prompt. default: [{ str: "Click repeatedly to complete!" }] clickIcon: string // Icon displayed on the click target. default: "fa-solid fa-computer-mouse" scale?: number // Scale multiplier for the click icon (must be > 0). default: 1 rotation?: number // Rotation in degrees for the click icon (must be ≥ 0). default: 15 } ``` ### Sensible Defaults ```ts api.addQTE(playerId, { type: "progressBar", parameters: { progressStartValue: 30, progressDecreasePerTick: 0.075, progressPerClick: 5, canFail: false, description: [{ str: "Click repeatedly to complete!" }], clickIcon: "fa-solid fa-computer-mouse", scale: 1, rotation: 15, }, }) ``` ## `timedClick` A prompt appears and the player must click before the timer runs out. Clicking within the time window succeeds; letting it expire fails the QTE. ### Parameters ```ts type TimedClickQteParams = { timeWindow: number // Duration in milliseconds the player has to click. default: 3000 icon: string // Icon displayed on the click target. default: "fa-solid fa-computer-mouse" label: CustomTextStyling // Rich text shown as the QTE prompt. default: [{ str: "Click to complete the QTE!" }] showTimer: boolean // Whether to display a countdown timer. default: true scale?: number // Scale multiplier for the icon (must be > 0). default: 1 rotation?: number // Rotation in degrees for the icon (must be ≥ 0). default: 15 breatheCenter?: boolean // If true, the icon pulses with a breathing animation anchored to the centre. default: false } ``` ### Sensible Defaults ```ts api.addQTE(playerId, { type: "timedClick", parameters: { timeWindow: 3000, icon: "fa-solid fa-computer-mouse", label: [{ str: "Click to complete the QTE!" }], showTimer: true, scale: 1, rotation: 15, breatheCenter: false, }, }) ``` ## `gravityBar` A mover travels along a bar, periodically changing direction. The player holds click to push their catch zone upward and releases to let gravity pull it down. Progress fills while the mover overlaps the catch zone and drains when it doesn't. Reaching 100% succeeds. If `canFail` is true, hitting 0% fails the QTE. ### Parameters ```ts type GravityBarQteParams = { progressStartValue?: number // Starting progress value (0-100). default: 30 catchZoneSize: number // Size of the player's catch zone as a fraction of the bar (must be > 0, 0-1). default: 0.25 moverSpeed: number // Speed at which the mover travels along the bar (must be > 0). default: 3 moverErraticness: number // How erratically the mover changes direction (higher = more unpredictable). default: 0.8 gravity: number // Downward pull on the catch zone when the player isn't holding click. default: 1 riseSpeed: number // Upward force on the catch zone while the player holds click. default: 1.5 progressGainPerSecond: number // Progress gained per second while the mover is inside the catch zone. default: 8 progressDrainPerSecond: number // Progress lost per second while the mover is outside the catch zone. default: 4 canFail: boolean // If true, the QTE fails when progress reaches 0; otherwise progress clamps at 0. default: false description: CustomTextStyling // Rich text shown as the QTE prompt. default: [{ str: "Hold to catch!" }] icon?: string // Icon displayed on the mover. default: "Moonfish" } ``` ### Sensible Defaults ```ts api.addQTE(playerId, { type: "gravityBar", parameters: { progressStartValue: 30, catchZoneSize: 0.25, moverSpeed: 3, moverErraticness: 0.8, gravity: 1, riseSpeed: 1.5, progressGainPerSecond: 8, progressDrainPerSecond: 4, canFail: false, description: [{ str: "Hold to catch!" }], icon: "Moonfish", }, }) ``` ## `precisionBar` A marker oscillates back and forth along a bar. A highlighted success zone sits in the centre. The player has one click — if the marker is inside the success zone, the QTE succeeds; otherwise it fails. The marker keeps bouncing indefinitely until the player clicks. ### Parameters ```ts type PrecisionBarQteParams = { speed: number // Speed of the marker in full bar-widths per second (must be > 0, e.g. 1.0 = one full sweep per second). default: 0.5 successZoneSize: number // Fraction of the bar that counts as the success zone, centred in the middle (must be > 0, 0-1, e.g. 0.15 = 15%). default: 0.15 label: CustomTextStyling // Rich text shown as the QTE prompt. default: [{ str: "Click when the marker is within the green zone." }] icon?: string // Icon displayed on the marker. default: "" scale?: number // Scale multiplier for the icon (must be > 0). default: 1 rotation?: number // Rotation in degrees for the icon (must be ≥ 0). default: 0 } ``` ### Sensible Defaults ```ts api.addQTE(playerId, { type: "precisionBar", parameters: { speed: 0.5, successZoneSize: 0.15, label: [{ str: "Click when the marker is within the green zone." }], icon: "", scale: 1, rotation: 0, }, }) ``` ## `rhythmClick` An outer circle shrinks toward a fixed inner circle. The player must click when the two overlap. Each successful click counts toward `requiredSuccesses`. Missing the window (clicking too early/late or letting the circle pass without clicking) counts as a miss. If `maxMisses` is set and exceeded, the QTE fails; otherwise missed attempts simply reset the circle for another try. ### Parameters ```ts type RhythmClickQteParams = { requiredSuccesses: number // Number of successful clicks needed to complete the QTE (must be a positive integer). default: 5 shrinkDurationMs: number // Duration in milliseconds for the outer circle to shrink from max size to centre (must be > 0). default: 1200 toleranceFraction: number // Fraction of the inner circle radius that counts as a successful overlap (must be > 0, 0-1, e.g. 0.15 = ±15%). default: 0.15 maxMisses?: number // Max misses allowed before failing. If omitted, unlimited misses are permitted (must be a non-negative integer). default: 3 label: CustomTextStyling // Rich text shown as the QTE prompt. default: [{ str: "Click when the circles align!" }] icon?: string // Icon displayed in the centre of the circles. default: "" } ``` ### Sensible Defaults ```ts api.addQTE(playerId, { type: "rhythmClick", parameters: { requiredSuccesses: 5, shrinkDurationMs: 1200, toleranceFraction: 0.15, maxMisses: 3, label: [{ str: "Click when the circles align!" }], icon: "", }, }) ``` ## Usage ### Starting a QTE ```ts const qteId = api.addQTE(playerId, { type: "progressBar", parameters: { progressDecreasePerTick: 0.075, progressPerClick: 7, canFail: false, description: [{ str: "Click repeatedly to complete!" }], clickIcon: "fa-solid fa-computer-mouse", }, }) ``` ### Handling the Result ```ts onPlayerFinishQTE(playerId, qteId, result) { if (result) { // Player succeeded } else { // Player failed } } ``` ### Cancelling a QTE ```ts api.deleteQTE(playerId, qteId) ``` ### Checking Active QTEs ```ts const hasQTE = api.hasActiveQTE(playerId) ``` # Code API You can run javascript when right clicking code blocks and press to code boards. This is only available to owners of worlds lobbies. The javascript can interact with the Bloxd.io game api. Please use [our discord](https://discord.gg/playbloxd) to report any issues you come across or features you'd like to see added. ## Code Blocks - World owners can find these by searching in the creative menu - No need to add `press to code`, this text is only needed for code boards, and will automatically be removed - If you want to run code without opening the code editor, you can trigger the code block by right clicking an adjacent `press to code` board instead ## Boards - You can begin a board with `press to code` to run javascript when you right click it. - Normally you can't edit a code board after placing it, but you can currently work around this by putting a space before `press to code`. - Boards only allow for a small amount of text, we recommend you use Code Blocks instead, or you can work around this by using multiple boards ## Notes - Global variables `myId` and `playerId` store the player ID of who is running the code. - Global variable `thisPos` stores the position of the currently executing code block or press to code board. - `myId`, `playerId`, `thisPos` and `ownerDbId` are all defined on `api` - You can use `api.log` or `console.log` for printing and debugging (they do the same thing). - You can use `Date.now()` instead of `api.now()` if you prefer, both return the time in milliseconds. - Comments like `/* comment */` work, but comments like `// comment` don't work right now. ## Examples Code Block to make the player jump: ```js f = api.setVelocity(myId, 0, 9, 0) ``` Push the player: ```js api.applyImpulse(myId, 9, 0, 9) ``` Send an orange message to yourself: ```js api.sendMessage(myId, "text", { color: "orange" }) ``` Create flying text: ```js const speed = 100 api.sendFlyingMiddleMessage(myId, ["Message to display"], speed) ``` Send a message to all players: ```js api.broadcastMessage("announcement", { color: "red" }) ``` Set player health to 99, and print the old health: ```js const oldHealth = api.getHealth(myId) api.setHealth(myId, 99) api.log("Old Health:", oldHealth) ``` Define a function to get the player IDs excluding your own ID: ```js getOtherIds = () => { const ids = api.getPlayerIds() const otherIds = [] for (const id of ids) { if (id !== myId) { otherIds.push(id) } } return otherIds } ``` Use the function above to make other players look like zombies: ```js for (const otherId of getOtherIds()) { api.setPlayerPose(otherId, "zombie") api.changePlayerIntoSkin(otherId, "head", "zombie") } ``` Make all players look like floating wizards: ```js for (const playerId of api.getPlayerIds()) { api.setPlayerPose(playerId, "driving") api.changePlayerIntoSkin(playerId, "head", "wizard") } ``` ## Glossary of Referenced Types These 'types' can't be referenced by your code, but they help explain some of the parameters in the API. ```ts type CustomTextStyling = (string | EntityName | TranslatedText | StyledIcon | StyledText)[] type EntityMeshScalingMap = { [key in "TorsoNode" | "HeadMesh" | "ArmRightMesh" | "ArmLeftMesh" | "LegLeftMesh" | "LegRightMesh"]?: number[] } type EntityName = { entityName: string style?: { color?: string colour?: string } } type IngameIconName = "Damage" | "Damage Reduction" | "Speed" | "VoidJump" | "Fist" | "Frozen" | "Hydrated" | "Invisible" | "Jump Boost" | "Poisoned" | "Slowness" | "Weakness" | "Health Regen" | "Haste" | "Double Jump" | "Heat Resistance" | "Gliding" | "Boating" | "Obsidian Boating" | "Riding" | "Bunny Hop" | "FallDamage" | "Feather Falling" | "Thief" | "X-Ray Vision" | "Mining Yield" | "Brain Rot" | "Rested Damage" | "Rested Haste" | "Rested Speed" | "Rested Farming Yield" | "Rested Aura" | "Blindness" | "Pickpocketer" | "Lifesteal" | "Bounciness" | "Air Walk" | "Wall Climbing" | "Thorns" | "Poopy" | "Draugr Knight Head" | "Draugr Warper Head" | "Magma Golem Head" | "Mystery Fish" | "Damage Enchantment" | "Critical Damage Enchantment" | "Attack Speed Enchantment" | "Protection Enchantment" | "Health Enchantment" | "Health Regen Enchantment" | "Stomp Damage Enchantment" | "Knockback Resist Enchantment" | "Arrow Speed Enchantment" | "Arrow Damage Enchantment" | "Quick Charge Enchantment" | "Break Speed Enchantment" | "Momentum Enchantment" | "Mining Yield Enchantment" | "Farming Yield Enchantment" | "Mining Aura Enchantment" | "Digging Aura Enchantment" | "Lumber Aura Enchantment" | "Farming Aura Enchantment" | "Vertical Knockback Enchantment" | "Horizontal Knockback Enchantment" | "Self Yield" | "Friends" | "Riding Speed" | "Feed Aura" | "Double Poop" | "Mob Slayer" | "Rainbow Wool" | "Pack Leader" | "Max Health" | "Poison Claws" | "Mob Yield" | "Antlers Bonus" | "Health" | "HealthShield" | "Cross" | "Friendship" | "Dotted Friendship" | "Hunger" | "Empty Hunger" | "Pixelated Heart" | "Question Mark" | "Trader Black" | "Trader Blue" | "Trader Piggy" enum ParticleSystemBlendMode { // Source color is added to the destination color without alpha affecting the result OneOne = 0, // Blend current color and particle color using particle's alpha Standard = 1, // Add current color and particle color multiplied by particle's alpha Add, // Multiply current color with particle color Multiply, // Multiply current color with particle color then add current color and particle color multiplied by particle's alpha MultiplyAdd, } type RecipesForItem = { requires: { items: ItemName[]; amt: number }[] produces: number station?: string | string[] onCraftedAura?: number isStarterRecipe?: boolean attributes?: ItemAttributes }[] type StyledIcon = { icon: string style?: { color?: string colour?: string fontSize?: string opacity?: number } } type StyledText = { str: string | EntityName | TranslatedText style?: TextStyle clickableUrl?: string } type TempParticleSystemOpts = { texture: string minLifeTime: number maxLifeTime: number minEmitPower: number maxEmitPower: number minSize: number maxSize: number gravity: number[] velocityGradients: { timeFraction: number factor: number factor2: number }[] colorGradients: { timeFraction: number minColor: [number, number, number, number] maxColor?: [number, number, number, number] }[] | { color: [number, number, number] }[] blendMode: ParticleSystemBlendMode dir1: number[] dir2: number[] pos1: number[] pos2: number[] manualEmitCount: number hideDist: number } type TranslatedText = { translationKey: string params?: Record } type ItemAttributes = { customDisplayName?: string; customDescription?: string; customAttributes?: Record } enum WalkThroughType { CANT_WALK_THROUGH = 0, CAN_WALK_THROUGH = 1, DEFAULT_WALK_THROUGH = 2, } type WorldBlockChangedInfo = { cause: PNull<"Paintball" | "FloorCreator" | "Sapling" | "StemFruit" | "MeltingIce" | "Explosion"> } type EarthSkyBox = { type: "earth" inclination?: number turbidity?: number infiniteDistance?: boolean luminance?: number yCameraOffset?: number azimuth?: number // Not part of sky model by default; heavily tint to a vertex color vertexTint?: [number, number, number] } type ShopItem = { image: string cost?: number currency?: string amount?: number // Display amount shown on the shop tile image (0 and 1 are not displayed) imageColour?: string canBuy?: boolean isSelected?: boolean buyButtonText?: string | CustomTextStyling customTitle?: string | CustomTextStyling description?: string | CustomTextStyling onBoughtMessage?: string | CustomTextStyling redDot?: boolean forceRemoveRedDot?: boolean badge?: { text: string | CustomTextStyling; type: ShopItemBadgeType } userInput?: ShopItemUserInput sell?: boolean // Optional, defaults to false. If true, the sign of "cost" is flipped. So a "cost" of -25 would give the player 25 currency AND be displayed as "25" (instead of -25) sortPriority?: number // Descending, bigger number means closer to the top hidden?: boolean } type ShopItemUserInput = | { type: "text"; placeholderText?: string; wordCharsOnly?: boolean; initialValue?: string } // wordCharsOnly defaults to false. If true, only allows \w character (alphanumeric and _). initialValue always takes precedence as the text input value when set. | { type: "number"; placeholderText?: string; initialValue?: string } | { type: "dropdown" dropdownOptions: readonly (string | { option: string; cost: number })[] shouldResetSelectionOnOptionsChange?: boolean // Defaults to false. If true, the selection will reset to the first option when dropdownOptions changes. initialValue?: string } | { type: "player"; excludedPlayers?: PlayerId[] } // Defaults to excluding the current player | { type: "color"; initialValue?: string } type ShopCategoryConfig = Partial<{ autoSelectCategory: boolean customTitle: string // Supports translation keys and ordinary text redDot: boolean forceRemoveRedDot: boolean sortPriority: number description: string | CustomTextStyling }> type MobSpawnOpts = Partial<{ mobHerdId: MobHerdId spawnerId: PlayerId mobDbId: MobDbId name: string playSoundOnSpawn: boolean variation: MobVariation physicsOpts: Partial<{ width: number height: number collidesEntities: boolean }> }> type MeshEntityOpts = { Box: CommonMeshEntityOpts & { width: number height: number depth: number diffuseColor?: number[] emissiveColor?: number[] backFaceCulling?: boolean // Default true texture?: string // Can be a blockname. Wraps every one block faceUV?: number[][] } BloxdBlock: CommonMeshEntityOpts & { blockName: BlockNameOrId size: number | [number, number, number] } Person: CommonMeshEntityOpts & { size?: number textures?: Partial pose?: PlayerPose } ParticleEmitter: MeshParticleSystemOpts } type CommonMeshEntityOpts = { hideDist?: number meshOffset?: number[] autoRotate?: boolean lineToEId?: EntityId // EntityId to connect to using a line } type MeshEntityPhysicsOpts = { doPhysics: boolean onCollideTerrain?: () => void // Unsupported for custom code collidesEntities?: boolean collideBits?: number // bitmask category of this entity collideMask?: number // bitmask category of entities this entity collides with heightExpandAmt?: number // expand hitbox height by this amount widthExpandAmt?: number // expand hitbox width by this amount vehicleOpts?: MeshEntityVehicleOpts // Unsupported for custom code } /** * ANIMATION SCHEMA TYPES * * An animation schema describes how an entity should be positioned as time passes. * For each node in the entity's skeleton, we define an animation timeline. * A timeline is sequence of "key frames". * A keyframe represents an important position; if this is a jumping animation, * then an example of a keyframe would be the peak of the jump. * * When deciding how an entity should be positioned during an animation, * we will usually find ourselves between two keyframes. * For example, if our keyframes are at time fractions 0.0, 0.5 and 1.0, * and the current time fraction is 0.3, then we will need to find a middle ground * between the first and second keyframe. * This process is known as interpolating, or "lerping". * The default way of doing this is linear lerping; drawing a straight line between two points. * An alternative is splining; drawing a curve. */ export type AnimationSchema = { animationDurationMs: number loop?: LoopModeSchema nodeAnimations?: NodeSkeletonAnimationSchema } type LoopModeSchema = boolean | "hold-on-last-frame" type NodeSkeletonAnimationSchema = Record type NodeAnimationSchema = { timeline: AnimationTimelineSchema } type AnimationTimelineSchema = readonly KeyframeSchema[] type KeyframeSchema = { timeFraction: number rotation?: LerpPointSchema // Rotations are assumed to be in radians. } /** * "pre" and "post" points exist to allow for discontinuities. */ export type LerpPointSchema = | Point | { lerpMode?: LerpModeSchema point: Point } | { lerpMode?: LerpModeSchema pre: Point // When lerping towards a point, we lerp towards its pre. post: Point // When lerping away from a point, we lerp away from its post. } /** * "catmull-rom-spline" is a form of splining; drawing a curve between two points. */ export type LerpModeSchema = "linear" | "catmull-rom-spline" /** * BLOCKBENCH ANIMATION SCHEMA TYPES * * We support native Blockbench animations. It should just be a case of copying and pasting * the specific animation from the exported JSON file. * * Notable differences: * - Blockbench animations do not use time fractions. Instead, they use absolute time. * - The unit of time is seconds, not milliseconds. * - The angular unit is degrees, not radians. * - The x-axis is mirrored. */ export type BlockbenchAnimationSchema = { animation_length: number // The duration of the animation in seconds. loop?: BlockbenchLoopModeSchema bones?: BlockbenchBonesAnimationSchema } type BlockbenchLoopModeSchema = boolean | "hold_on_last_frame" type BlockbenchBonesAnimationSchema = Record type BlockbenchBoneAnimationSchema = { rotation?: BlockbenchAnimationTimelineSchema // Blockbench rotations are in degrees. } type BlockbenchAnimationTimelineSchema = Point | Record /** * "pre" and "post" points exist to allow for discontinuities. */ export type BlockbenchAnimationFrameSchema = | Point | { lerp_mode?: BlockbenchLerpModeSchema pre?: Point // When lerping towards a point, we lerp towards its pre. post: Point // When lerping away from a point, we lerp away from its post. } /** * "catmullrom" is a form of splining; drawing a curve between two points. */ export type BlockbenchLerpModeSchema = "linear" | "catmullrom" /** * The timestamp of the keyframe in seconds. */ type TimestampString = string type Point = Vec3 ``` # Code API You can run javascript when right clicking code blocks and press to code boards. This is only available to owners of worlds lobbies. The javascript can interact with the Bloxd.io game api. Please use [our discord](https://discord.gg/playbloxd) to report any issues you come across or features you'd like to see added. ## Code Blocks - World owners can find these by searching in the creative menu - No need to add `press to code`, this text is only needed for code boards, and will automatically be removed - If you want to run code without opening the code editor, you can trigger the code block by right clicking an adjacent `press to code` board instead ## Boards - You can begin a board with `press to code` to run javascript when you right click it. - Normally you can't edit a code board after placing it, but you can currently work around this by putting a space before `press to code`. - Boards only allow for a small amount of text, we recommend you use Code Blocks instead, or you can work around this by using multiple boards ## Notes - Global variables `myId` and `playerId` store the player ID of who is running the code. - Global variable `thisPos` stores the position of the currently executing code block or press to code board. - `myId`, `playerId`, `thisPos` and `ownerDbId` are all defined on `api` - You can use `api.log` or `console.log` for printing and debugging (they do the same thing). - You can use `Date.now()` instead of `api.now()` if you prefer, both return the time in milliseconds. - Comments like `/* comment */` work, but comments like `// comment` don't work right now. ## Examples Code Block to make the player jump: ```js f = api.setVelocity(myId, 0, 9, 0) ``` Push the player: ```js api.applyImpulse(myId, 9, 0, 9) ``` Send an orange message to yourself: ```js api.sendMessage(myId, "text", { color: "orange" }) ``` Create flying text: ```js const speed = 100 api.sendFlyingMiddleMessage(myId, ["Message to display"], speed) ``` Send a message to all players: ```js api.broadcastMessage("announcement", { color: "red" }) ``` Set player health to 99, and print the old health: ```js const oldHealth = api.getHealth(myId) api.setHealth(myId, 99) api.log("Old Health:", oldHealth) ``` Define a function to get the player IDs excluding your own ID: ```js getOtherIds = () => { const ids = api.getPlayerIds() const otherIds = [] for (const id of ids) { if (id !== myId) { otherIds.push(id) } } return otherIds } ``` Use the function above to make other players look like zombies: ```js for (const otherId of getOtherIds()) { api.setPlayerPose(otherId, "zombie") api.changePlayerIntoSkin(otherId, "head", "zombie") } ``` Make all players look like floating wizards: ```js for (const playerId of api.getPlayerIds()) { api.setPlayerPose(playerId, "driving") api.changePlayerIntoSkin(playerId, "head", "wizard") } ``` ## Glossary of Referenced Types These 'types' can't be referenced by your code, but they help explain some of the parameters in the API. ```ts type CustomTextStyling = (string | EntityName | TranslatedText | StyledIcon | StyledText)[] type EntityMeshScalingMap = { [key in "TorsoNode" | "HeadMesh" | "ArmRightMesh" | "ArmLeftMesh" | "LegLeftMesh" | "LegRightMesh"]?: number[] } type EntityName = { entityName: string style?: { color?: string colour?: string } } type IngameIconName = "Damage" | "Damage Reduction" | "Speed" | "VoidJump" | "Fist" | "Frozen" | "Hydrated" | "Invisible" | "Jump Boost" | "Poisoned" | "Slowness" | "Weakness" | "Health Regen" | "Haste" | "Double Jump" | "Heat Resistance" | "Gliding" | "Boating" | "Obsidian Boating" | "Riding" | "Bunny Hop" | "FallDamage" | "Feather Falling" | "Thief" | "X-Ray Vision" | "Mining Yield" | "Brain Rot" | "Rested Damage" | "Rested Haste" | "Rested Speed" | "Rested Farming Yield" | "Rested Aura" | "Blindness" | "Pickpocketer" | "Lifesteal" | "Bounciness" | "Air Walk" | "Wall Climbing" | "Thorns" | "Poopy" | "Draugr Knight Head" | "Draugr Warper Head" | "Magma Golem Head" | "Mystery Fish" | "Damage Enchantment" | "Critical Damage Enchantment" | "Attack Speed Enchantment" | "Protection Enchantment" | "Health Enchantment" | "Health Regen Enchantment" | "Stomp Damage Enchantment" | "Knockback Resist Enchantment" | "Arrow Speed Enchantment" | "Arrow Damage Enchantment" | "Quick Charge Enchantment" | "Break Speed Enchantment" | "Momentum Enchantment" | "Mining Yield Enchantment" | "Farming Yield Enchantment" | "Mining Aura Enchantment" | "Digging Aura Enchantment" | "Lumber Aura Enchantment" | "Farming Aura Enchantment" | "Vertical Knockback Enchantment" | "Horizontal Knockback Enchantment" | "Self Yield" | "Friends" | "Riding Speed" | "Feed Aura" | "Double Poop" | "Mob Slayer" | "Rainbow Wool" | "Pack Leader" | "Max Health" | "Poison Claws" | "Mob Yield" | "Antlers Bonus" | "Health" | "HealthShield" | "Cross" | "Friendship" | "Dotted Friendship" | "Hunger" | "Empty Hunger" | "Pixelated Heart" | "Question Mark" | "Trader Black" | "Trader Blue" | "Trader Piggy" enum ParticleSystemBlendMode { // Source color is added to the destination color without alpha affecting the result OneOne = 0, // Blend current color and particle color using particle's alpha Standard = 1, // Add current color and particle color multiplied by particle's alpha Add, // Multiply current color with particle color Multiply, // Multiply current color with particle color then add current color and particle color multiplied by particle's alpha MultiplyAdd, } type RecipesForItem = { requires: { items: ItemName[]; amt: number }[] produces: number station?: string | string[] onCraftedAura?: number isStarterRecipe?: boolean attributes?: ItemAttributes }[] type StyledIcon = { icon: string style?: { color?: string colour?: string fontSize?: string opacity?: number } } type StyledText = { str: string | EntityName | TranslatedText style?: TextStyle clickableUrl?: string } type TempParticleSystemOpts = { texture: string minLifeTime: number maxLifeTime: number minEmitPower: number maxEmitPower: number minSize: number maxSize: number gravity: number[] velocityGradients: { timeFraction: number factor: number factor2: number }[] colorGradients: { timeFraction: number minColor: [number, number, number, number] maxColor?: [number, number, number, number] }[] | { color: [number, number, number] }[] blendMode: ParticleSystemBlendMode dir1: number[] dir2: number[] pos1: number[] pos2: number[] manualEmitCount: number hideDist: number } type TranslatedText = { translationKey: string params?: Record } type ItemAttributes = { customDisplayName?: string; customDescription?: string; customAttributes?: Record } enum WalkThroughType { CANT_WALK_THROUGH = 0, CAN_WALK_THROUGH = 1, DEFAULT_WALK_THROUGH = 2, } type WorldBlockChangedInfo = { cause: PNull<"Paintball" | "FloorCreator" | "Sapling" | "StemFruit" | "MeltingIce" | "Explosion"> } type EarthSkyBox = { type: "earth" inclination?: number turbidity?: number infiniteDistance?: boolean luminance?: number yCameraOffset?: number azimuth?: number // Not part of sky model by default; heavily tint to a vertex color vertexTint?: [number, number, number] } type ShopItem = { image: string cost?: number currency?: string amount?: number // Display amount shown on the shop tile image (0 and 1 are not displayed) imageColour?: string canBuy?: boolean isSelected?: boolean buyButtonText?: string | CustomTextStyling customTitle?: string | CustomTextStyling description?: string | CustomTextStyling onBoughtMessage?: string | CustomTextStyling redDot?: boolean forceRemoveRedDot?: boolean badge?: { text: string | CustomTextStyling; type: ShopItemBadgeType } userInput?: ShopItemUserInput sell?: boolean // Optional, defaults to false. If true, the sign of "cost" is flipped. So a "cost" of -25 would give the player 25 currency AND be displayed as "25" (instead of -25) sortPriority?: number // Descending, bigger number means closer to the top hidden?: boolean } type ShopItemUserInput = | { type: "text"; placeholderText?: string; wordCharsOnly?: boolean; initialValue?: string } // wordCharsOnly defaults to false. If true, only allows \w character (alphanumeric and _). initialValue always takes precedence as the text input value when set. | { type: "number"; placeholderText?: string; initialValue?: string } | { type: "dropdown" dropdownOptions: readonly (string | { option: string; cost: number })[] shouldResetSelectionOnOptionsChange?: boolean // Defaults to false. If true, the selection will reset to the first option when dropdownOptions changes. initialValue?: string } | { type: "player"; excludedPlayers?: PlayerId[] } // Defaults to excluding the current player | { type: "color"; initialValue?: string } type ShopCategoryConfig = Partial<{ autoSelectCategory: boolean customTitle: string // Supports translation keys and ordinary text redDot: boolean forceRemoveRedDot: boolean sortPriority: number description: string | CustomTextStyling }> type MobSpawnOpts = Partial<{ mobHerdId: MobHerdId spawnerId: PlayerId mobDbId: MobDbId name: string playSoundOnSpawn: boolean variation: MobVariation physicsOpts: Partial<{ width: number height: number collidesEntities: boolean }> }> type MeshEntityOpts = { Box: CommonMeshEntityOpts & { width: number height: number depth: number diffuseColor?: number[] emissiveColor?: number[] backFaceCulling?: boolean // Default true texture?: string // Can be a blockname. Wraps every one block faceUV?: number[][] } BloxdBlock: CommonMeshEntityOpts & { blockName: BlockNameOrId size: number | [number, number, number] } Person: CommonMeshEntityOpts & { size?: number textures?: Partial pose?: PlayerPose } ParticleEmitter: MeshParticleSystemOpts } type CommonMeshEntityOpts = { hideDist?: number meshOffset?: number[] autoRotate?: boolean lineToEId?: EntityId // EntityId to connect to using a line } type MeshEntityPhysicsOpts = { doPhysics: boolean onCollideTerrain?: () => void // Unsupported for custom code collidesEntities?: boolean collideBits?: number // bitmask category of this entity collideMask?: number // bitmask category of entities this entity collides with heightExpandAmt?: number // expand hitbox height by this amount widthExpandAmt?: number // expand hitbox width by this amount vehicleOpts?: MeshEntityVehicleOpts // Unsupported for custom code } /** * ANIMATION SCHEMA TYPES * * An animation schema describes how an entity should be positioned as time passes. * For each node in the entity's skeleton, we define an animation timeline. * A timeline is sequence of "key frames". * A keyframe represents an important position; if this is a jumping animation, * then an example of a keyframe would be the peak of the jump. * * When deciding how an entity should be positioned during an animation, * we will usually find ourselves between two keyframes. * For example, if our keyframes are at time fractions 0.0, 0.5 and 1.0, * and the current time fraction is 0.3, then we will need to find a middle ground * between the first and second keyframe. * This process is known as interpolating, or "lerping". * The default way of doing this is linear lerping; drawing a straight line between two points. * An alternative is splining; drawing a curve. */ export type AnimationSchema = { animationDurationMs: number loop?: LoopModeSchema nodeAnimations?: NodeSkeletonAnimationSchema } type LoopModeSchema = boolean | "hold-on-last-frame" type NodeSkeletonAnimationSchema = Record type NodeAnimationSchema = { timeline: AnimationTimelineSchema } type AnimationTimelineSchema = readonly KeyframeSchema[] type KeyframeSchema = { timeFraction: number rotation?: LerpPointSchema // Rotations are assumed to be in radians. } /** * "pre" and "post" points exist to allow for discontinuities. */ export type LerpPointSchema = | Point | { lerpMode?: LerpModeSchema point: Point } | { lerpMode?: LerpModeSchema pre: Point // When lerping towards a point, we lerp towards its pre. post: Point // When lerping away from a point, we lerp away from its post. } /** * "catmull-rom-spline" is a form of splining; drawing a curve between two points. */ export type LerpModeSchema = "linear" | "catmull-rom-spline" /** * BLOCKBENCH ANIMATION SCHEMA TYPES * * We support native Blockbench animations. It should just be a case of copying and pasting * the specific animation from the exported JSON file. * * Notable differences: * - Blockbench animations do not use time fractions. Instead, they use absolute time. * - The unit of time is seconds, not milliseconds. * - The angular unit is degrees, not radians. * - The x-axis is mirrored. */ export type BlockbenchAnimationSchema = { animation_length: number // The duration of the animation in seconds. loop?: BlockbenchLoopModeSchema bones?: BlockbenchBonesAnimationSchema } type BlockbenchLoopModeSchema = boolean | "hold_on_last_frame" type BlockbenchBonesAnimationSchema = Record type BlockbenchBoneAnimationSchema = { rotation?: BlockbenchAnimationTimelineSchema // Blockbench rotations are in degrees. } type BlockbenchAnimationTimelineSchema = Point | Record /** * "pre" and "post" points exist to allow for discontinuities. */ export type BlockbenchAnimationFrameSchema = | Point | { lerp_mode?: BlockbenchLerpModeSchema pre?: Point // When lerping towards a point, we lerp towards its pre. post: Point // When lerping away from a point, we lerp away from its post. } /** * "catmullrom" is a form of splining; drawing a curve between two points. */ export type BlockbenchLerpModeSchema = "linear" | "catmullrom" /** * The timestamp of the keyframe in seconds. */ type TimestampString = string type Point = Vec3 ``` # Code API You can run javascript when right clicking code blocks and press to code boards. This is only available to owners of worlds lobbies. The javascript can interact with the Bloxd.io game api. Please use [our discord](https://discord.gg/playbloxd) to report any issues you come across or features you'd like to see added. ## Code Blocks - World owners can find these by searching in the creative menu - No need to add `press to code`, this text is only needed for code boards, and will automatically be removed - If you want to run code without opening the code editor, you can trigger the code block by right clicking an adjacent `press to code` board instead ## Boards - You can begin a board with `press to code` to run javascript when you right click it. - Normally you can't edit a code board after placing it, but you can currently work around this by putting a space before `press to code`. - Boards only allow for a small amount of text, we recommend you use Code Blocks instead, or you can work around this by using multiple boards ## Notes - Global variables `myId` and `playerId` store the player ID of who is running the code. - Global variable `thisPos` stores the position of the currently executing code block or press to code board. - `myId`, `playerId`, `thisPos` and `ownerDbId` are all defined on `api` - You can use `api.log` or `console.log` for printing and debugging (they do the same thing). - You can use `Date.now()` instead of `api.now()` if you prefer, both return the time in milliseconds. - Comments like `/* comment */` work, but comments like `// comment` don't work right now. ## Examples Code Block to make the player jump: ```js f = api.setVelocity(myId, 0, 9, 0) ``` Push the player: ```js api.applyImpulse(myId, 9, 0, 9) ``` Send an orange message to yourself: ```js api.sendMessage(myId, "text", { color: "orange" }) ``` Create flying text: ```js const speed = 100 api.sendFlyingMiddleMessage(myId, ["Message to display"], speed) ``` Send a message to all players: ```js api.broadcastMessage("announcement", { color: "red" }) ``` Set player health to 99, and print the old health: ```js const oldHealth = api.getHealth(myId) api.setHealth(myId, 99) api.log("Old Health:", oldHealth) ``` Define a function to get the player IDs excluding your own ID: ```js getOtherIds = () => { const ids = api.getPlayerIds() const otherIds = [] for (const id of ids) { if (id !== myId) { otherIds.push(id) } } return otherIds } ``` Use the function above to make other players look like zombies: ```js for (const otherId of getOtherIds()) { api.setPlayerPose(otherId, "zombie") api.changePlayerIntoSkin(otherId, "head", "zombie") } ``` Make all players look like floating wizards: ```js for (const playerId of api.getPlayerIds()) { api.setPlayerPose(playerId, "driving") api.changePlayerIntoSkin(playerId, "head", "wizard") } ``` ## Glossary of Referenced Types These 'types' can't be referenced by your code, but they help explain some of the parameters in the API. ```ts type CustomTextStyling = (string | EntityName | TranslatedText | StyledIcon | StyledText)[] type EntityMeshScalingMap = { [key in "TorsoNode" | "HeadMesh" | "ArmRightMesh" | "ArmLeftMesh" | "LegLeftMesh" | "LegRightMesh"]?: number[] } type EntityName = { entityName: string style?: { color?: string colour?: string } } type IngameIconName = "Damage" | "Damage Reduction" | "Speed" | "VoidJump" | "Fist" | "Frozen" | "Hydrated" | "Invisible" | "Jump Boost" | "Poisoned" | "Slowness" | "Weakness" | "Health Regen" | "Haste" | "Double Jump" | "Heat Resistance" | "Gliding" | "Boating" | "Obsidian Boating" | "Riding" | "Bunny Hop" | "FallDamage" | "Feather Falling" | "Thief" | "X-Ray Vision" | "Mining Yield" | "Brain Rot" | "Rested Damage" | "Rested Haste" | "Rested Speed" | "Rested Farming Yield" | "Rested Aura" | "Blindness" | "Pickpocketer" | "Lifesteal" | "Bounciness" | "Air Walk" | "Wall Climbing" | "Thorns" | "Poopy" | "Draugr Knight Head" | "Draugr Warper Head" | "Magma Golem Head" | "Mystery Fish" | "Damage Enchantment" | "Critical Damage Enchantment" | "Attack Speed Enchantment" | "Protection Enchantment" | "Health Enchantment" | "Health Regen Enchantment" | "Stomp Damage Enchantment" | "Knockback Resist Enchantment" | "Arrow Speed Enchantment" | "Arrow Damage Enchantment" | "Quick Charge Enchantment" | "Break Speed Enchantment" | "Momentum Enchantment" | "Mining Yield Enchantment" | "Farming Yield Enchantment" | "Mining Aura Enchantment" | "Digging Aura Enchantment" | "Lumber Aura Enchantment" | "Farming Aura Enchantment" | "Vertical Knockback Enchantment" | "Horizontal Knockback Enchantment" | "Self Yield" | "Friends" | "Riding Speed" | "Feed Aura" | "Double Poop" | "Mob Slayer" | "Rainbow Wool" | "Pack Leader" | "Max Health" | "Poison Claws" | "Mob Yield" | "Antlers Bonus" | "Health" | "HealthShield" | "Cross" | "Friendship" | "Dotted Friendship" | "Hunger" | "Empty Hunger" | "Pixelated Heart" | "Question Mark" | "Trader Black" | "Trader Blue" | "Trader Piggy" enum ParticleSystemBlendMode { // Source color is added to the destination color without alpha affecting the result OneOne = 0, // Blend current color and particle color using particle's alpha Standard = 1, // Add current color and particle color multiplied by particle's alpha Add, // Multiply current color with particle color Multiply, // Multiply current color with particle color then add current color and particle color multiplied by particle's alpha MultiplyAdd, } type RecipesForItem = { requires: { items: ItemName[]; amt: number }[] produces: number station?: string | string[] onCraftedAura?: number isStarterRecipe?: boolean attributes?: ItemAttributes }[] type StyledIcon = { icon: string style?: { color?: string colour?: string fontSize?: string opacity?: number } } type StyledText = { str: string | EntityName | TranslatedText style?: TextStyle clickableUrl?: string } type TempParticleSystemOpts = { texture: string minLifeTime: number maxLifeTime: number minEmitPower: number maxEmitPower: number minSize: number maxSize: number gravity: number[] velocityGradients: { timeFraction: number factor: number factor2: number }[] colorGradients: { timeFraction: number minColor: [number, number, number, number] maxColor?: [number, number, number, number] }[] | { color: [number, number, number] }[] blendMode: ParticleSystemBlendMode dir1: number[] dir2: number[] pos1: number[] pos2: number[] manualEmitCount: number hideDist: number } type TranslatedText = { translationKey: string params?: Record } type ItemAttributes = { customDisplayName?: string; customDescription?: string; customAttributes?: Record } enum WalkThroughType { CANT_WALK_THROUGH = 0, CAN_WALK_THROUGH = 1, DEFAULT_WALK_THROUGH = 2, } type WorldBlockChangedInfo = { cause: PNull<"Paintball" | "FloorCreator" | "Sapling" | "StemFruit" | "MeltingIce" | "Explosion"> } type EarthSkyBox = { type: "earth" inclination?: number turbidity?: number infiniteDistance?: boolean luminance?: number yCameraOffset?: number azimuth?: number // Not part of sky model by default; heavily tint to a vertex color vertexTint?: [number, number, number] } type ShopItem = { image: string cost?: number currency?: string amount?: number // Display amount shown on the shop tile image (0 and 1 are not displayed) imageColour?: string canBuy?: boolean isSelected?: boolean buyButtonText?: string | CustomTextStyling customTitle?: string | CustomTextStyling description?: string | CustomTextStyling onBoughtMessage?: string | CustomTextStyling redDot?: boolean forceRemoveRedDot?: boolean badge?: { text: string | CustomTextStyling; type: ShopItemBadgeType } userInput?: ShopItemUserInput sell?: boolean // Optional, defaults to false. If true, the sign of "cost" is flipped. So a "cost" of -25 would give the player 25 currency AND be displayed as "25" (instead of -25) sortPriority?: number // Descending, bigger number means closer to the top hidden?: boolean } type ShopItemUserInput = | { type: "text"; placeholderText?: string; wordCharsOnly?: boolean; initialValue?: string } // wordCharsOnly defaults to false. If true, only allows \w character (alphanumeric and _). initialValue always takes precedence as the text input value when set. | { type: "number"; placeholderText?: string; initialValue?: string } | { type: "dropdown" dropdownOptions: readonly (string | { option: string; cost: number })[] shouldResetSelectionOnOptionsChange?: boolean // Defaults to false. If true, the selection will reset to the first option when dropdownOptions changes. initialValue?: string } | { type: "player"; excludedPlayers?: PlayerId[] } // Defaults to excluding the current player | { type: "color"; initialValue?: string } type ShopCategoryConfig = Partial<{ autoSelectCategory: boolean customTitle: string // Supports translation keys and ordinary text redDot: boolean forceRemoveRedDot: boolean sortPriority: number description: string | CustomTextStyling }> type MobSpawnOpts = Partial<{ mobHerdId: MobHerdId spawnerId: PlayerId mobDbId: MobDbId name: string playSoundOnSpawn: boolean variation: MobVariation physicsOpts: Partial<{ width: number height: number collidesEntities: boolean }> }> type MeshEntityOpts = { Box: CommonMeshEntityOpts & { width: number height: number depth: number diffuseColor?: number[] emissiveColor?: number[] backFaceCulling?: boolean // Default true texture?: string // Can be a blockname. Wraps every one block faceUV?: number[][] } BloxdBlock: CommonMeshEntityOpts & { blockName: BlockNameOrId size: number | [number, number, number] } Person: CommonMeshEntityOpts & { size?: number textures?: Partial pose?: PlayerPose } ParticleEmitter: MeshParticleSystemOpts } type CommonMeshEntityOpts = { hideDist?: number meshOffset?: number[] autoRotate?: boolean lineToEId?: EntityId // EntityId to connect to using a line } type MeshEntityPhysicsOpts = { doPhysics: boolean onCollideTerrain?: () => void // Unsupported for custom code collidesEntities?: boolean collideBits?: number // bitmask category of this entity collideMask?: number // bitmask category of entities this entity collides with heightExpandAmt?: number // expand hitbox height by this amount widthExpandAmt?: number // expand hitbox width by this amount vehicleOpts?: MeshEntityVehicleOpts // Unsupported for custom code } /** * ANIMATION SCHEMA TYPES * * An animation schema describes how an entity should be positioned as time passes. * For each node in the entity's skeleton, we define an animation timeline. * A timeline is sequence of "key frames". * A keyframe represents an important position; if this is a jumping animation, * then an example of a keyframe would be the peak of the jump. * * When deciding how an entity should be positioned during an animation, * we will usually find ourselves between two keyframes. * For example, if our keyframes are at time fractions 0.0, 0.5 and 1.0, * and the current time fraction is 0.3, then we will need to find a middle ground * between the first and second keyframe. * This process is known as interpolating, or "lerping". * The default way of doing this is linear lerping; drawing a straight line between two points. * An alternative is splining; drawing a curve. */ export type AnimationSchema = { animationDurationMs: number loop?: LoopModeSchema nodeAnimations?: NodeSkeletonAnimationSchema } type LoopModeSchema = boolean | "hold-on-last-frame" type NodeSkeletonAnimationSchema = Record type NodeAnimationSchema = { timeline: AnimationTimelineSchema } type AnimationTimelineSchema = readonly KeyframeSchema[] type KeyframeSchema = { timeFraction: number rotation?: LerpPointSchema // Rotations are assumed to be in radians. } /** * "pre" and "post" points exist to allow for discontinuities. */ export type LerpPointSchema = | Point | { lerpMode?: LerpModeSchema point: Point } | { lerpMode?: LerpModeSchema pre: Point // When lerping towards a point, we lerp towards its pre. post: Point // When lerping away from a point, we lerp away from its post. } /** * "catmull-rom-spline" is a form of splining; drawing a curve between two points. */ export type LerpModeSchema = "linear" | "catmull-rom-spline" /** * BLOCKBENCH ANIMATION SCHEMA TYPES * * We support native Blockbench animations. It should just be a case of copying and pasting * the specific animation from the exported JSON file. * * Notable differences: * - Blockbench animations do not use time fractions. Instead, they use absolute time. * - The unit of time is seconds, not milliseconds. * - The angular unit is degrees, not radians. * - The x-axis is mirrored. */ export type BlockbenchAnimationSchema = { animation_length: number // The duration of the animation in seconds. loop?: BlockbenchLoopModeSchema bones?: BlockbenchBonesAnimationSchema } type BlockbenchLoopModeSchema = boolean | "hold_on_last_frame" type BlockbenchBonesAnimationSchema = Record type BlockbenchBoneAnimationSchema = { rotation?: BlockbenchAnimationTimelineSchema // Blockbench rotations are in degrees. } type BlockbenchAnimationTimelineSchema = Point | Record /** * "pre" and "post" points exist to allow for discontinuities. */ export type BlockbenchAnimationFrameSchema = | Point | { lerp_mode?: BlockbenchLerpModeSchema pre?: Point // When lerping towards a point, we lerp towards its pre. post: Point // When lerping away from a point, we lerp away from its post. } /** * "catmullrom" is a form of splining; drawing a curve between two points. */ export type BlockbenchLerpModeSchema = "linear" | "catmullrom" /** * The timestamp of the keyframe in seconds. */ type TimestampString = string type Point = Vec3 ``` # Skins and Poses This document lists all API-selectable skins and poses that can be used with the game API. ## Usage ### Changing Player Skin Use `api.changePlayerIntoSkin(playerId, part, skinName)` to change a player's skin: ```js api.changePlayerIntoSkin(playerId, "body", "body_0_0") api.changePlayerIntoSkin(playerId, "head", "wizard") // NPC skin ``` ### Setting Player Pose Use `api.setPlayerPose(playerId, pose)` to change a player's pose: ```js api.setPlayerPose(playerId, "standing") api.setPlayerPose(playerId, "sitting") ``` --- ## Poses (7 poses) ``` standing sitting zombie gliding driving sleeping riding ``` --- ## Skin Parts The following skin parts can be customised: `skin`, `hat`, `head`, `eyebrows`, `eyes`, `back`, `body`, `legs`, `shoes` --- ## NPC Skins (12 skins) These are special full-body skins typically used for NPCs. Apply them via the `head` part: ```js api.changePlayerIntoSkin(playerId, "head", "wizard") ``` ``` chef farmer farmer_gill monster_hunter_lorenzo painter_spencer piggy_banker portal_mage trader trader_black trader_blue wizard zombie ``` --- ## Skin (24 skins) `skin_0_0, skin_0_1, skin_0_2, skin_0_3, skin_0_4, skin_0_5, skin_0_6, skin_0_7, skin_0_8, skin_0_9, skin_0_10, skin_0_11, skin_0_12, skin_0_13, skin_0_14, skin_0_15, skin_0_16, skin_0_17, skin_0_18, skin_0_19, skin_0_20, skin_0_21, skin_0_22, skin_0_23` ## Hat (1 skins) `hat_none` ## Head (46 skins) `head_0, head_1_0, head_1_1, head_1_2, head_1_3, head_1_4, head_2_0, head_2_1, head_2_2, head_2_3, head_2_4, head_3_0, head_3_1, head_3_2, head_3_3, head_3_4, head_4_0, head_4_1, head_4_2, head_4_3, head_4_4, head_5_0, head_5_1, head_5_2, head_5_3, head_5_4, head_6_0, head_6_1, head_6_2, head_6_3, head_6_4, head_7_0, head_7_1, head_7_2, head_7_3, head_7_4, head_8_0, head_8_1, head_8_2, head_8_3, head_8_4, head_9_0, head_9_1, head_9_2, head_9_3, head_9_4` ## Eyebrows (16 skins) `eyebrows_0, eyebrows_1_0, eyebrows_1_1, eyebrows_1_2, eyebrows_1_3, eyebrows_1_4, eyebrows_2_0, eyebrows_2_1, eyebrows_2_2, eyebrows_2_3, eyebrows_2_4, eyebrows_3_0, eyebrows_3_1, eyebrows_3_2, eyebrows_3_3, eyebrows_3_4` ## Eyes (50 skins) `eyes_0_0, eyes_0_1, eyes_0_2, eyes_0_3, eyes_0_4, eyes_1_0, eyes_1_1, eyes_1_2, eyes_1_3, eyes_1_4, eyes_2_0, eyes_2_1, eyes_2_2, eyes_2_3, eyes_2_4, eyes_3_0, eyes_3_1, eyes_3_2, eyes_3_3, eyes_3_4, eyes_4_0, eyes_4_1, eyes_4_2, eyes_4_3, eyes_4_4, eyes_5_0, eyes_5_1, eyes_5_2, eyes_5_3, eyes_5_4, eyes_6_0, eyes_6_1, eyes_6_2, eyes_6_3, eyes_6_4, eyes_7_0, eyes_7_1, eyes_7_2, eyes_7_3, eyes_7_4, eyes_8_0, eyes_8_1, eyes_8_2, eyes_8_3, eyes_8_4, eyes_9_0, eyes_9_1, eyes_9_2, eyes_9_3, eyes_9_4` ## Back (1 skins) `back_none` ## Body (56 skins) `body_0_0, body_0_1, body_0_2, body_0_3, body_0_4, body_0_5, body_0_6, body_0_7, body_1_0, body_1_1, body_1_2, body_1_3, body_1_4, body_1_5, body_1_6, body_1_7, body_2_0, body_2_1, body_2_2, body_2_3, body_2_4, body_2_5, body_2_6, body_2_7, body_3_0, body_3_1, body_3_2, body_3_3, body_3_4, body_3_5, body_3_6, body_3_7, body_4_0, body_4_1, body_4_2, body_4_3, body_4_4, body_4_5, body_4_6, body_4_7, body_5_0, body_5_1, body_5_2, body_5_3, body_5_4, body_5_5, body_5_6, body_5_7, body_6_0, body_6_1, body_6_2, body_6_3, body_6_4, body_6_5, body_6_6, body_6_7` ## Legs (15 skins) `legs_0_0, legs_0_1, legs_0_2, legs_0_3, legs_0_4, legs_1_0, legs_1_1, legs_1_2, legs_1_3, legs_1_4, legs_2_0, legs_2_1, legs_2_2, legs_2_3, legs_2_4` ## Shoes (9 skins) `shoes_0_0, shoes_0_1, shoes_0_2, shoes_1_0, shoes_1_1, shoes_1_2, shoes_2_0, shoes_2_1, shoes_2_2` --- ## Notes - Skin names ending with `_none` are internal variants and cannot be used via the API. - Skin variants follow the pattern `{part}_{style}_{colour}` (e.g., `body_0_0`, `head_1_2`). - NPC skins apply a complete character appearance and override individual part selections. # Skins and Poses This document lists all API-selectable skins and poses that can be used with the game API. ## Usage ### Changing Player Skin Use `api.changePlayerIntoSkin(playerId, part, skinName)` to change a player's skin: ```js api.changePlayerIntoSkin(playerId, "body", "body_0_0") api.changePlayerIntoSkin(playerId, "head", "wizard") // NPC skin ``` ### Setting Player Pose Use `api.setPlayerPose(playerId, pose)` to change a player's pose: ```js api.setPlayerPose(playerId, "standing") api.setPlayerPose(playerId, "sitting") ``` --- ## Poses (7 poses) ``` standing sitting zombie gliding driving sleeping riding ``` --- ## Skin Parts The following skin parts can be customised: `skin`, `hat`, `head`, `eyebrows`, `eyes`, `back`, `body`, `legs`, `shoes` --- ## NPC Skins (12 skins) These are special full-body skins typically used for NPCs. Apply them via the `head` part: ```js api.changePlayerIntoSkin(playerId, "head", "wizard") ``` ``` chef farmer farmer_gill monster_hunter_lorenzo painter_spencer piggy_banker portal_mage trader trader_black trader_blue wizard zombie ``` --- ## Skin (24 skins) `skin_0_0, skin_0_1, skin_0_2, skin_0_3, skin_0_4, skin_0_5, skin_0_6, skin_0_7, skin_0_8, skin_0_9, skin_0_10, skin_0_11, skin_0_12, skin_0_13, skin_0_14, skin_0_15, skin_0_16, skin_0_17, skin_0_18, skin_0_19, skin_0_20, skin_0_21, skin_0_22, skin_0_23` ## Hat (1 skins) `hat_none` ## Head (46 skins) `head_0, head_1_0, head_1_1, head_1_2, head_1_3, head_1_4, head_2_0, head_2_1, head_2_2, head_2_3, head_2_4, head_3_0, head_3_1, head_3_2, head_3_3, head_3_4, head_4_0, head_4_1, head_4_2, head_4_3, head_4_4, head_5_0, head_5_1, head_5_2, head_5_3, head_5_4, head_6_0, head_6_1, head_6_2, head_6_3, head_6_4, head_7_0, head_7_1, head_7_2, head_7_3, head_7_4, head_8_0, head_8_1, head_8_2, head_8_3, head_8_4, head_9_0, head_9_1, head_9_2, head_9_3, head_9_4` ## Eyebrows (16 skins) `eyebrows_0, eyebrows_1_0, eyebrows_1_1, eyebrows_1_2, eyebrows_1_3, eyebrows_1_4, eyebrows_2_0, eyebrows_2_1, eyebrows_2_2, eyebrows_2_3, eyebrows_2_4, eyebrows_3_0, eyebrows_3_1, eyebrows_3_2, eyebrows_3_3, eyebrows_3_4` ## Eyes (50 skins) `eyes_0_0, eyes_0_1, eyes_0_2, eyes_0_3, eyes_0_4, eyes_1_0, eyes_1_1, eyes_1_2, eyes_1_3, eyes_1_4, eyes_2_0, eyes_2_1, eyes_2_2, eyes_2_3, eyes_2_4, eyes_3_0, eyes_3_1, eyes_3_2, eyes_3_3, eyes_3_4, eyes_4_0, eyes_4_1, eyes_4_2, eyes_4_3, eyes_4_4, eyes_5_0, eyes_5_1, eyes_5_2, eyes_5_3, eyes_5_4, eyes_6_0, eyes_6_1, eyes_6_2, eyes_6_3, eyes_6_4, eyes_7_0, eyes_7_1, eyes_7_2, eyes_7_3, eyes_7_4, eyes_8_0, eyes_8_1, eyes_8_2, eyes_8_3, eyes_8_4, eyes_9_0, eyes_9_1, eyes_9_2, eyes_9_3, eyes_9_4` ## Back (1 skins) `back_none` ## Body (56 skins) `body_0_0, body_0_1, body_0_2, body_0_3, body_0_4, body_0_5, body_0_6, body_0_7, body_1_0, body_1_1, body_1_2, body_1_3, body_1_4, body_1_5, body_1_6, body_1_7, body_2_0, body_2_1, body_2_2, body_2_3, body_2_4, body_2_5, body_2_6, body_2_7, body_3_0, body_3_1, body_3_2, body_3_3, body_3_4, body_3_5, body_3_6, body_3_7, body_4_0, body_4_1, body_4_2, body_4_3, body_4_4, body_4_5, body_4_6, body_4_7, body_5_0, body_5_1, body_5_2, body_5_3, body_5_4, body_5_5, body_5_6, body_5_7, body_6_0, body_6_1, body_6_2, body_6_3, body_6_4, body_6_5, body_6_6, body_6_7` ## Legs (15 skins) `legs_0_0, legs_0_1, legs_0_2, legs_0_3, legs_0_4, legs_1_0, legs_1_1, legs_1_2, legs_1_3, legs_1_4, legs_2_0, legs_2_1, legs_2_2, legs_2_3, legs_2_4` ## Shoes (9 skins) `shoes_0_0, shoes_0_1, shoes_0_2, shoes_1_0, shoes_1_1, shoes_1_2, shoes_2_0, shoes_2_1, shoes_2_2` --- ## Notes - Skin names ending with `_none` are internal variants and cannot be used via the API. - Skin variants follow the pattern `{part}_{style}_{colour}` (e.g., `body_0_0`, `head_1_2`). - NPC skins apply a complete character appearance and override individual part selections. # Skins and Poses This document lists all API-selectable skins and poses that can be used with the game API. ## Usage ### Changing Player Skin Use `api.changePlayerIntoSkin(playerId, part, skinName)` to change a player's skin: ```js api.changePlayerIntoSkin(playerId, "body", "body_0_0") api.changePlayerIntoSkin(playerId, "head", "wizard") // NPC skin ``` ### Setting Player Pose Use `api.setPlayerPose(playerId, pose)` to change a player's pose: ```js api.setPlayerPose(playerId, "standing") api.setPlayerPose(playerId, "sitting") ``` --- ## Poses (7 poses) ``` standing sitting zombie gliding driving sleeping riding ``` --- ## Skin Parts The following skin parts can be customised: `skin`, `hat`, `head`, `eyebrows`, `eyes`, `back`, `body`, `legs`, `shoes` --- ## NPC Skins (12 skins) These are special full-body skins typically used for NPCs. Apply them via the `head` part: ```js api.changePlayerIntoSkin(playerId, "head", "wizard") ``` ``` chef farmer farmer_gill monster_hunter_lorenzo painter_spencer piggy_banker portal_mage trader trader_black trader_blue wizard zombie ``` --- ## Skin (24 skins) `skin_0_0, skin_0_1, skin_0_2, skin_0_3, skin_0_4, skin_0_5, skin_0_6, skin_0_7, skin_0_8, skin_0_9, skin_0_10, skin_0_11, skin_0_12, skin_0_13, skin_0_14, skin_0_15, skin_0_16, skin_0_17, skin_0_18, skin_0_19, skin_0_20, skin_0_21, skin_0_22, skin_0_23` ## Hat (1 skins) `hat_none` ## Head (46 skins) `head_0, head_1_0, head_1_1, head_1_2, head_1_3, head_1_4, head_2_0, head_2_1, head_2_2, head_2_3, head_2_4, head_3_0, head_3_1, head_3_2, head_3_3, head_3_4, head_4_0, head_4_1, head_4_2, head_4_3, head_4_4, head_5_0, head_5_1, head_5_2, head_5_3, head_5_4, head_6_0, head_6_1, head_6_2, head_6_3, head_6_4, head_7_0, head_7_1, head_7_2, head_7_3, head_7_4, head_8_0, head_8_1, head_8_2, head_8_3, head_8_4, head_9_0, head_9_1, head_9_2, head_9_3, head_9_4` ## Eyebrows (16 skins) `eyebrows_0, eyebrows_1_0, eyebrows_1_1, eyebrows_1_2, eyebrows_1_3, eyebrows_1_4, eyebrows_2_0, eyebrows_2_1, eyebrows_2_2, eyebrows_2_3, eyebrows_2_4, eyebrows_3_0, eyebrows_3_1, eyebrows_3_2, eyebrows_3_3, eyebrows_3_4` ## Eyes (50 skins) `eyes_0_0, eyes_0_1, eyes_0_2, eyes_0_3, eyes_0_4, eyes_1_0, eyes_1_1, eyes_1_2, eyes_1_3, eyes_1_4, eyes_2_0, eyes_2_1, eyes_2_2, eyes_2_3, eyes_2_4, eyes_3_0, eyes_3_1, eyes_3_2, eyes_3_3, eyes_3_4, eyes_4_0, eyes_4_1, eyes_4_2, eyes_4_3, eyes_4_4, eyes_5_0, eyes_5_1, eyes_5_2, eyes_5_3, eyes_5_4, eyes_6_0, eyes_6_1, eyes_6_2, eyes_6_3, eyes_6_4, eyes_7_0, eyes_7_1, eyes_7_2, eyes_7_3, eyes_7_4, eyes_8_0, eyes_8_1, eyes_8_2, eyes_8_3, eyes_8_4, eyes_9_0, eyes_9_1, eyes_9_2, eyes_9_3, eyes_9_4` ## Back (1 skins) `back_none` ## Body (56 skins) `body_0_0, body_0_1, body_0_2, body_0_3, body_0_4, body_0_5, body_0_6, body_0_7, body_1_0, body_1_1, body_1_2, body_1_3, body_1_4, body_1_5, body_1_6, body_1_7, body_2_0, body_2_1, body_2_2, body_2_3, body_2_4, body_2_5, body_2_6, body_2_7, body_3_0, body_3_1, body_3_2, body_3_3, body_3_4, body_3_5, body_3_6, body_3_7, body_4_0, body_4_1, body_4_2, body_4_3, body_4_4, body_4_5, body_4_6, body_4_7, body_5_0, body_5_1, body_5_2, body_5_3, body_5_4, body_5_5, body_5_6, body_5_7, body_6_0, body_6_1, body_6_2, body_6_3, body_6_4, body_6_5, body_6_6, body_6_7` ## Legs (15 skins) `legs_0_0, legs_0_1, legs_0_2, legs_0_3, legs_0_4, legs_1_0, legs_1_1, legs_1_2, legs_1_3, legs_1_4, legs_2_0, legs_2_1, legs_2_2, legs_2_3, legs_2_4` ## Shoes (9 skins) `shoes_0_0, shoes_0_1, shoes_0_2, shoes_1_0, shoes_1_1, shoes_1_2, shoes_2_0, shoes_2_1, shoes_2_2` --- ## Notes - Skin names ending with `_none` are internal variants and cannot be used via the API. - Skin variants follow the pattern `{part}_{style}_{colour}` (e.g., `body_0_0`, `head_1_2`). - NPC skins apply a complete character appearance and override individual part selections. # Sounds and Songs This document lists all available sound effects and songs that can be used in game modes. --- ## Sound Effects Sound effects are short audio clips (e.g., footsteps, hits, ambient sounds). Use the `playSound`, or `broadcastSound` API methods. ### API Usage ```ts // Play a sound for a specific player api.playSound(playerId, soundName, volume, rate, posSettings?) // Broadcast a sound to all players (or all except one) api.broadcastSound(soundName, volume, rate, posSettings?, exceptPlayerId?) ``` **Parameters:** - `soundName`: One of the sound names listed below - `volume`: 0.0 to 1.0 - `rate`: Playback rate (1.0 = normal speed, 0.5 = half speed, 2.0 = double speed) - `posSettings` (optional): `{ playerIdOrPos: PlayerId | number[], maxHearDist?: number, refDistance?: number }` **Tip:** If you want a random similar sound, remove the number suffix from the sound name (e.g., use `"grass"` instead of `"grass1"`). ### Available Sounds (340 total) `bass` `bassattack` `bd` `bearRoar1` `bearRoar2` `bearRoar3` `bearRoar4` `bearRoar5` `beep` `bigDrumSwish1` `bigDrumSwish2` `bigDrumSwish3` `bow` `bucketEmpty1` `bucketEmpty2` `bucketEmpty3` `bucketFill1` `bucketFill2` `bucketFill3` `bullet_shell_bounce_general_07` `bullet_shell_bounce_general_08` `burp` `cannonFire1` `cannonFire2` `cannonFire3` `cashRegister` `catHiss1` `catHiss2` `catHiss3` `catHiss4` `catHurt1` `catHurt2` `catHurt3` `catMeow1` `catMeow2` `catMeow3` `catMeow4` `catMeow5` `caughtFish` `chestClose` `chestOpen` `cloth1` `cloth2` `cloth3` `cloth4` `cowHurt1` `cowMoo1` `cowMoo2` `cowMoo3` `crowdAmbience` `crowdCheer` `deerGrunt1` `deerHurt1` `dogBark1` `dogBark2` `dogBark3` `dogGrowl1` `dogGrowl2` `dogGrowl3` `dogHurt1` `dogHurt2` `doorClose` `doorClose2` `doorKnock` `doorOpen-bloxd1` `doorOpen-bloxd2` `drink` `drumSwish1` `drumSwish2` `eat1` `equip_leather1` `exp_collect` `exp_levelup` `fallsmall` `fireBurn` `firecracker1` `firecracker2` `firecracker3` `firecracker4` `futureStrangePulse` `game_start_countdown_01` `game_start_countdown_02` `game_start_countdown_03` `game_start_countdown_final` `glass1` `glass2` `glass3` `golemGrunt1` `golemGrunt2` `gorillaIdle1` `gorillaIdle2` `gorillaIdle3` `gorillaIdle4` `gorillaRoar1` `grass1` `grass2` `grass3` `grass4` `gravel1` `gravel2` `gravel3` `gravel4` `harp_pling` `hat` `hauntedHorrorImpact` `headshot_04` `headshot_06` `headshot_08` `headshot_11` `hit1` `hit2` `hit3` `hoeTill1` `hoeTill2` `hoeTill3` `hoeTill4` `horrorAccent1` `horrorFright` `horrorMaleDrone` `horseHurt1` `horseHurt2` `horseIdle1` `horseIdle2` `horseIdle3` `intensiveRainLoop` `knightGrunt1` `knightGrunt2` `knightGrunt3` `laugh1` `laugh2` `laugh3` `levelup` `lowDrum1` `lowDrum2` `lowDrum3` `magicAccent1` `magicAccent2` `magicAccent3` `magicAccent4` `metalDoorKnock` `ominousBellHit` `pickUp` `pigHurt1` `pigHurt2` `pigHurt3` `pigOink1` `pigOink2` `pigOink3` `pigOink4` `pigOink5` `pistol_cock_01` `pistol_cock_02` `pistol_cock_03` `pistol_cock_06` `pistol_magazine_load_01` `pistol_magazine_load_02` `pistol_magazine_load_03` `pistol_magazine_unload_01` `pistol_magazine_unload_02` `pistol_magazine_unload_03` `pistol_shot_01` `pistol_shot_02` `pistol_shot_03` `pistol_shot_04` `pistol_shot_05` `pulseFromTheDark` `reaverAttack1` `reaverAttack2` `reaverAttack3` `reaverGrunt1` `reaverGrunt2` `reaverGrunt3` `reel` `refereeWhistle` `rifle_cock_01` `rifle_cock_02` `rifle_magazine_load_01` `rifle_magazine_load_02` `rifle_magazine_load_03` `rifle_magazine_unload_01` `rifle_magazine_unload_02` `rifle_magazine_unload_04` `rifle_shot_01` `rifle_shot_02` `rifle_shot_03` `rifle_shot_04` `sand1` `sand2` `sand3` `sand4` `semiAuto_cock_01` `semiAuto_cock_02` `semiAuto_cock_03` `semiAuto_cock_04` `semiAuto_cock_05` `semiAuto_first_shot_01` `semiAuto_magazine_load_01` `semiAuto_magazine_load_02` `semiAuto_magazine_load_03` `semiAuto_magazine_load_04` `semiAuto_magazine_load_05` `semiAuto_magazine_unload_01` `semiAuto_magazine_unload_02` `semiAuto_magazine_unload_03` `semiAuto_magazine_unload_04` `semiAuto_shot_01` `semiAuto_shot_02` `semiAuto_shot_03` `semiAuto_shot_04` `semiAuto_shot_05` `semiAuto_shot_06` `semiAuto_shot_07` `semiAuto_shot_08` `semiAuto_tail_only_shot_01` `sheepBaa1` `sheepBaa2` `sheepBaa3` `sheepBaa4` `sheepHurt1` `shotgun_cock_01` `shotgun_cock_02` `shotgun_cock_03` `shotgun_cock_04` `shotgun_cock_05` `shotgun_load_bullet_01` `shotgun_load_bullet_02` `shotgun_load_bullet_03` `shotgun_load_bullet_04` `shotgun_load_bullet_05` `shotgun_load_bullet_06` `shotgun_load_bullet_07` `shotgun_load_bullet_08` `shotgun_shot_01` `shotgun_shot_02` `shotgun_shot_03` `shotgun_shot_04` `skeletonRattle1` `skeletonRattle2` `skeletonRattle3` `skeletonRattle4` `snare` `snow1` `snow2` `snow3` `snow4` `sonarBeep` `splash1` `stagGrunt1` `stagHurt1` `step_cloth1` `step_cloth2` `step_cloth3` `step_cloth4` `step_grass1` `step_grass2` `step_grass3` `step_grass4` `step_grass5` `step_gravel1` `step_gravel2` `step_gravel3` `step_gravel4` `step_sand2` `step_sand3` `step_sand4` `step_sand5` `step_snow1` `step_snow2` `step_snow3` `step_snow4` `step_stone1` `step_stone2` `step_stone3` `step_stone4` `step_stone5` `step_stone6` `step_wood1` `step_wood2` `step_wood3` `step_wood4` `step_wood5` `step_wood6` `stone1` `stone2` `stone3` `stone4` `submachine_cock_01` `submachine_cock_02` `submachine_cock_03` `submachine_cock_04` `submachine_first_shot_01` `submachine_magazine_load_01` `submachine_magazine_load_02` `submachine_magazine_load_03` `submachine_magazine_load_04` `submachine_magazine_unload_01` `submachine_magazine_unload_02` `submachine_magazine_unload_03` `submachine_shot_01` `submachine_shot_02` `submachine_shot_03` `submachine_shot_04` `submachine_shot_05` `submachine_shot_06` `submachine_shot_07` `submachine_shot_08` `submachine_shot_09` `submachine_tail_only_shot_01` `successfulBowHit` `suspenseRiser` `sweep6` `thunderRain` `trapdoorOpen` `trumpetFlare` `trumpetNote1` `trumpetNote2` `trumpetNote3` `warperGrunt1` `warperGrunt2` `warperGrunt3` `warperGrunt4` `warperGrunt5` `warperPhase1` `warperPhase2` `wood1` `wood2` `wood3` `wood4` `wraithGrunt1` `wraithGrunt2` `wraithHurt` `zapAccent1` `zapAccent2` `ZombieGrunt1` `ZombieGrunt2` `ZombieGrunt3` `ZombieHurt1` `ZombieHurt2` `ZombieHurt3` `ZombieHurt4` --- ## Music Music tracks are longer audio for background ambiance. Use the `setClientOption` API method with the `"music"` option. ### API Usage ```ts // Play a song for a specific player api.setClientOption(playerId, "music", "Adigold - Dreamless Sleep") // Stop the current song api.setClientOption(playerId, "music", null) ``` **Note:** Unlike sound effects, songs are played via client options, not the `playSound` API. Only one song plays at a time per player; setting a new song replaces the current one. ### Available Songs (44 total) | Song Name | Duration | |-----------|----------| | `Adigold - A Place To Be Free` | 2:11 | | `Adigold - Butterfly Effect` | 1:24 | | `Adigold - Dreamless Sleep` | 1:58 | | `Adigold - Frozen Pulse` | 1:39 | | `Adigold - Frozen Skies` | 2:45 | | `Adigold - Healing Thoughts` | 1:59 | | `Adigold - Here Forever` | 2:43 | | `Adigold - Just a Little Hope` | 1:48 | | `Adigold - Just Like Heaven` | 1:22 | | `Adigold - Memories Remain` | 2:06 | | `Adigold - Place To Be` | 2:36 | | `Adigold - The Riverside` | 2:28 | | `Adigold - The Wonder` | 2:09 | | `Adigold - Vetrar (Cut B)` | 1:30 | | `Awkward Comedy Quirky` | 0:29 | | `battle-ship-111902` | 1:26 | | `cdk-Silence-Await` | 3:18 | | `corsairs-studiokolomna-main-version-23542-02-33` | 2:34 | | `ghost-Reverie-small-theme` | 0:41 | | `happy` | 3:01 | | `Heroic-Demise-New` | 5:02 | | `I-am-the-Sea-The-Room-4` | 3:21 | | `Juhani Junkala [Retro Game Music Pack] Ending` | 0:44 | | `Juhani Junkala [Retro Game Music Pack] Level 1` | 1:14 | | `Juhani Junkala [Retro Game Music Pack] Level 2` | 1:12 | | `Juhani Junkala [Retro Game Music Pack] Level 3` | 1:21 | | `Juhani Junkala [Retro Game Music Pack] Title Screen` | 0:11 | | `LonePeakMusic-Highway-1` | 2:27 | | `Mojo Productions - Pirates` | 1:54 | | `Mojo Productions - Sneaky Jazz` | 1:43 | | `Mojo Productions - The Sneaky` | 1:50 | | `Mojo Productions - The Sneaky Jazz` | 2:20 | | `progress` | 2:34 | | `raise-the-sails-152124` | 1:44 | | `ramblinglibrarian-I-Have-Often-T` | 3:42 | | `Slow-Motion-Bensound` | 3:27 | | `snowflake-Ethereal-Space` | 1:16 | | `the-epic-adventure-131399` | 2:01 | | `TownTheme` | 1:37 | | `The Suspense Ambient` | 1:59 | | `Epic1` | 2:16 | | `Epic2` | 2:23 | | `Emotional Epic` | 1:52 | | `Enemy Marked` | 1:29 | # Sounds and Songs This document lists all available sound effects and songs that can be used in game modes. --- ## Sound Effects Sound effects are short audio clips (e.g., footsteps, hits, ambient sounds). Use the `playSound`, or `broadcastSound` API methods. ### API Usage ```ts // Play a sound for a specific player api.playSound(playerId, soundName, volume, rate, posSettings?) // Broadcast a sound to all players (or all except one) api.broadcastSound(soundName, volume, rate, posSettings?, exceptPlayerId?) ``` **Parameters:** - `soundName`: One of the sound names listed below - `volume`: 0.0 to 1.0 - `rate`: Playback rate (1.0 = normal speed, 0.5 = half speed, 2.0 = double speed) - `posSettings` (optional): `{ playerIdOrPos: PlayerId | number[], maxHearDist?: number, refDistance?: number }` **Tip:** If you want a random similar sound, remove the number suffix from the sound name (e.g., use `"grass"` instead of `"grass1"`). ### Available Sounds (340 total) `bass` `bassattack` `bd` `bearRoar1` `bearRoar2` `bearRoar3` `bearRoar4` `bearRoar5` `beep` `bigDrumSwish1` `bigDrumSwish2` `bigDrumSwish3` `bow` `bucketEmpty1` `bucketEmpty2` `bucketEmpty3` `bucketFill1` `bucketFill2` `bucketFill3` `bullet_shell_bounce_general_07` `bullet_shell_bounce_general_08` `burp` `cannonFire1` `cannonFire2` `cannonFire3` `cashRegister` `catHiss1` `catHiss2` `catHiss3` `catHiss4` `catHurt1` `catHurt2` `catHurt3` `catMeow1` `catMeow2` `catMeow3` `catMeow4` `catMeow5` `caughtFish` `chestClose` `chestOpen` `cloth1` `cloth2` `cloth3` `cloth4` `cowHurt1` `cowMoo1` `cowMoo2` `cowMoo3` `crowdAmbience` `crowdCheer` `deerGrunt1` `deerHurt1` `dogBark1` `dogBark2` `dogBark3` `dogGrowl1` `dogGrowl2` `dogGrowl3` `dogHurt1` `dogHurt2` `doorClose` `doorClose2` `doorKnock` `doorOpen-bloxd1` `doorOpen-bloxd2` `drink` `drumSwish1` `drumSwish2` `eat1` `equip_leather1` `exp_collect` `exp_levelup` `fallsmall` `fireBurn` `firecracker1` `firecracker2` `firecracker3` `firecracker4` `futureStrangePulse` `game_start_countdown_01` `game_start_countdown_02` `game_start_countdown_03` `game_start_countdown_final` `glass1` `glass2` `glass3` `golemGrunt1` `golemGrunt2` `gorillaIdle1` `gorillaIdle2` `gorillaIdle3` `gorillaIdle4` `gorillaRoar1` `grass1` `grass2` `grass3` `grass4` `gravel1` `gravel2` `gravel3` `gravel4` `harp_pling` `hat` `hauntedHorrorImpact` `headshot_04` `headshot_06` `headshot_08` `headshot_11` `hit1` `hit2` `hit3` `hoeTill1` `hoeTill2` `hoeTill3` `hoeTill4` `horrorAccent1` `horrorFright` `horrorMaleDrone` `horseHurt1` `horseHurt2` `horseIdle1` `horseIdle2` `horseIdle3` `intensiveRainLoop` `knightGrunt1` `knightGrunt2` `knightGrunt3` `laugh1` `laugh2` `laugh3` `levelup` `lowDrum1` `lowDrum2` `lowDrum3` `magicAccent1` `magicAccent2` `magicAccent3` `magicAccent4` `metalDoorKnock` `ominousBellHit` `pickUp` `pigHurt1` `pigHurt2` `pigHurt3` `pigOink1` `pigOink2` `pigOink3` `pigOink4` `pigOink5` `pistol_cock_01` `pistol_cock_02` `pistol_cock_03` `pistol_cock_06` `pistol_magazine_load_01` `pistol_magazine_load_02` `pistol_magazine_load_03` `pistol_magazine_unload_01` `pistol_magazine_unload_02` `pistol_magazine_unload_03` `pistol_shot_01` `pistol_shot_02` `pistol_shot_03` `pistol_shot_04` `pistol_shot_05` `pulseFromTheDark` `reaverAttack1` `reaverAttack2` `reaverAttack3` `reaverGrunt1` `reaverGrunt2` `reaverGrunt3` `reel` `refereeWhistle` `rifle_cock_01` `rifle_cock_02` `rifle_magazine_load_01` `rifle_magazine_load_02` `rifle_magazine_load_03` `rifle_magazine_unload_01` `rifle_magazine_unload_02` `rifle_magazine_unload_04` `rifle_shot_01` `rifle_shot_02` `rifle_shot_03` `rifle_shot_04` `sand1` `sand2` `sand3` `sand4` `semiAuto_cock_01` `semiAuto_cock_02` `semiAuto_cock_03` `semiAuto_cock_04` `semiAuto_cock_05` `semiAuto_first_shot_01` `semiAuto_magazine_load_01` `semiAuto_magazine_load_02` `semiAuto_magazine_load_03` `semiAuto_magazine_load_04` `semiAuto_magazine_load_05` `semiAuto_magazine_unload_01` `semiAuto_magazine_unload_02` `semiAuto_magazine_unload_03` `semiAuto_magazine_unload_04` `semiAuto_shot_01` `semiAuto_shot_02` `semiAuto_shot_03` `semiAuto_shot_04` `semiAuto_shot_05` `semiAuto_shot_06` `semiAuto_shot_07` `semiAuto_shot_08` `semiAuto_tail_only_shot_01` `sheepBaa1` `sheepBaa2` `sheepBaa3` `sheepBaa4` `sheepHurt1` `shotgun_cock_01` `shotgun_cock_02` `shotgun_cock_03` `shotgun_cock_04` `shotgun_cock_05` `shotgun_load_bullet_01` `shotgun_load_bullet_02` `shotgun_load_bullet_03` `shotgun_load_bullet_04` `shotgun_load_bullet_05` `shotgun_load_bullet_06` `shotgun_load_bullet_07` `shotgun_load_bullet_08` `shotgun_shot_01` `shotgun_shot_02` `shotgun_shot_03` `shotgun_shot_04` `skeletonRattle1` `skeletonRattle2` `skeletonRattle3` `skeletonRattle4` `snare` `snow1` `snow2` `snow3` `snow4` `sonarBeep` `splash1` `stagGrunt1` `stagHurt1` `step_cloth1` `step_cloth2` `step_cloth3` `step_cloth4` `step_grass1` `step_grass2` `step_grass3` `step_grass4` `step_grass5` `step_gravel1` `step_gravel2` `step_gravel3` `step_gravel4` `step_sand2` `step_sand3` `step_sand4` `step_sand5` `step_snow1` `step_snow2` `step_snow3` `step_snow4` `step_stone1` `step_stone2` `step_stone3` `step_stone4` `step_stone5` `step_stone6` `step_wood1` `step_wood2` `step_wood3` `step_wood4` `step_wood5` `step_wood6` `stone1` `stone2` `stone3` `stone4` `submachine_cock_01` `submachine_cock_02` `submachine_cock_03` `submachine_cock_04` `submachine_first_shot_01` `submachine_magazine_load_01` `submachine_magazine_load_02` `submachine_magazine_load_03` `submachine_magazine_load_04` `submachine_magazine_unload_01` `submachine_magazine_unload_02` `submachine_magazine_unload_03` `submachine_shot_01` `submachine_shot_02` `submachine_shot_03` `submachine_shot_04` `submachine_shot_05` `submachine_shot_06` `submachine_shot_07` `submachine_shot_08` `submachine_shot_09` `submachine_tail_only_shot_01` `successfulBowHit` `suspenseRiser` `sweep6` `thunderRain` `trapdoorOpen` `trumpetFlare` `trumpetNote1` `trumpetNote2` `trumpetNote3` `warperGrunt1` `warperGrunt2` `warperGrunt3` `warperGrunt4` `warperGrunt5` `warperPhase1` `warperPhase2` `wood1` `wood2` `wood3` `wood4` `wraithGrunt1` `wraithGrunt2` `wraithHurt` `zapAccent1` `zapAccent2` `ZombieGrunt1` `ZombieGrunt2` `ZombieGrunt3` `ZombieHurt1` `ZombieHurt2` `ZombieHurt3` `ZombieHurt4` --- ## Music Music tracks are longer audio for background ambiance. Use the `setClientOption` API method with the `"music"` option. ### API Usage ```ts // Play a song for a specific player api.setClientOption(playerId, "music", "Adigold - Dreamless Sleep") // Stop the current song api.setClientOption(playerId, "music", null) ``` **Note:** Unlike sound effects, songs are played via client options, not the `playSound` API. Only one song plays at a time per player; setting a new song replaces the current one. ### Available Songs (44 total) | Song Name | Duration | |-----------|----------| | `Adigold - A Place To Be Free` | 2:11 | | `Adigold - Butterfly Effect` | 1:24 | | `Adigold - Dreamless Sleep` | 1:58 | | `Adigold - Frozen Pulse` | 1:39 | | `Adigold - Frozen Skies` | 2:45 | | `Adigold - Healing Thoughts` | 1:59 | | `Adigold - Here Forever` | 2:43 | | `Adigold - Just a Little Hope` | 1:48 | | `Adigold - Just Like Heaven` | 1:22 | | `Adigold - Memories Remain` | 2:06 | | `Adigold - Place To Be` | 2:36 | | `Adigold - The Riverside` | 2:28 | | `Adigold - The Wonder` | 2:09 | | `Adigold - Vetrar (Cut B)` | 1:30 | | `Awkward Comedy Quirky` | 0:29 | | `battle-ship-111902` | 1:26 | | `cdk-Silence-Await` | 3:18 | | `corsairs-studiokolomna-main-version-23542-02-33` | 2:34 | | `ghost-Reverie-small-theme` | 0:41 | | `happy` | 3:01 | | `Heroic-Demise-New` | 5:02 | | `I-am-the-Sea-The-Room-4` | 3:21 | | `Juhani Junkala [Retro Game Music Pack] Ending` | 0:44 | | `Juhani Junkala [Retro Game Music Pack] Level 1` | 1:14 | | `Juhani Junkala [Retro Game Music Pack] Level 2` | 1:12 | | `Juhani Junkala [Retro Game Music Pack] Level 3` | 1:21 | | `Juhani Junkala [Retro Game Music Pack] Title Screen` | 0:11 | | `LonePeakMusic-Highway-1` | 2:27 | | `Mojo Productions - Pirates` | 1:54 | | `Mojo Productions - Sneaky Jazz` | 1:43 | | `Mojo Productions - The Sneaky` | 1:50 | | `Mojo Productions - The Sneaky Jazz` | 2:20 | | `progress` | 2:34 | | `raise-the-sails-152124` | 1:44 | | `ramblinglibrarian-I-Have-Often-T` | 3:42 | | `Slow-Motion-Bensound` | 3:27 | | `snowflake-Ethereal-Space` | 1:16 | | `the-epic-adventure-131399` | 2:01 | | `TownTheme` | 1:37 | | `The Suspense Ambient` | 1:59 | | `Epic1` | 2:16 | | `Epic2` | 2:23 | | `Emotional Epic` | 1:52 | | `Enemy Marked` | 1:29 | # Sounds and Songs This document lists all available sound effects and songs that can be used in game modes. --- ## Sound Effects Sound effects are short audio clips (e.g., footsteps, hits, ambient sounds). Use the `playSound`, or `broadcastSound` API methods. ### API Usage ```ts // Play a sound for a specific player api.playSound(playerId, soundName, volume, rate, posSettings?) // Broadcast a sound to all players (or all except one) api.broadcastSound(soundName, volume, rate, posSettings?, exceptPlayerId?) ``` **Parameters:** - `soundName`: One of the sound names listed below - `volume`: 0.0 to 1.0 - `rate`: Playback rate (1.0 = normal speed, 0.5 = half speed, 2.0 = double speed) - `posSettings` (optional): `{ playerIdOrPos: PlayerId | number[], maxHearDist?: number, refDistance?: number }` **Tip:** If you want a random similar sound, remove the number suffix from the sound name (e.g., use `"grass"` instead of `"grass1"`). ### Available Sounds (340 total) `bass` `bassattack` `bd` `bearRoar1` `bearRoar2` `bearRoar3` `bearRoar4` `bearRoar5` `beep` `bigDrumSwish1` `bigDrumSwish2` `bigDrumSwish3` `bow` `bucketEmpty1` `bucketEmpty2` `bucketEmpty3` `bucketFill1` `bucketFill2` `bucketFill3` `bullet_shell_bounce_general_07` `bullet_shell_bounce_general_08` `burp` `cannonFire1` `cannonFire2` `cannonFire3` `cashRegister` `catHiss1` `catHiss2` `catHiss3` `catHiss4` `catHurt1` `catHurt2` `catHurt3` `catMeow1` `catMeow2` `catMeow3` `catMeow4` `catMeow5` `caughtFish` `chestClose` `chestOpen` `cloth1` `cloth2` `cloth3` `cloth4` `cowHurt1` `cowMoo1` `cowMoo2` `cowMoo3` `crowdAmbience` `crowdCheer` `deerGrunt1` `deerHurt1` `dogBark1` `dogBark2` `dogBark3` `dogGrowl1` `dogGrowl2` `dogGrowl3` `dogHurt1` `dogHurt2` `doorClose` `doorClose2` `doorKnock` `doorOpen-bloxd1` `doorOpen-bloxd2` `drink` `drumSwish1` `drumSwish2` `eat1` `equip_leather1` `exp_collect` `exp_levelup` `fallsmall` `fireBurn` `firecracker1` `firecracker2` `firecracker3` `firecracker4` `futureStrangePulse` `game_start_countdown_01` `game_start_countdown_02` `game_start_countdown_03` `game_start_countdown_final` `glass1` `glass2` `glass3` `golemGrunt1` `golemGrunt2` `gorillaIdle1` `gorillaIdle2` `gorillaIdle3` `gorillaIdle4` `gorillaRoar1` `grass1` `grass2` `grass3` `grass4` `gravel1` `gravel2` `gravel3` `gravel4` `harp_pling` `hat` `hauntedHorrorImpact` `headshot_04` `headshot_06` `headshot_08` `headshot_11` `hit1` `hit2` `hit3` `hoeTill1` `hoeTill2` `hoeTill3` `hoeTill4` `horrorAccent1` `horrorFright` `horrorMaleDrone` `horseHurt1` `horseHurt2` `horseIdle1` `horseIdle2` `horseIdle3` `intensiveRainLoop` `knightGrunt1` `knightGrunt2` `knightGrunt3` `laugh1` `laugh2` `laugh3` `levelup` `lowDrum1` `lowDrum2` `lowDrum3` `magicAccent1` `magicAccent2` `magicAccent3` `magicAccent4` `metalDoorKnock` `ominousBellHit` `pickUp` `pigHurt1` `pigHurt2` `pigHurt3` `pigOink1` `pigOink2` `pigOink3` `pigOink4` `pigOink5` `pistol_cock_01` `pistol_cock_02` `pistol_cock_03` `pistol_cock_06` `pistol_magazine_load_01` `pistol_magazine_load_02` `pistol_magazine_load_03` `pistol_magazine_unload_01` `pistol_magazine_unload_02` `pistol_magazine_unload_03` `pistol_shot_01` `pistol_shot_02` `pistol_shot_03` `pistol_shot_04` `pistol_shot_05` `pulseFromTheDark` `reaverAttack1` `reaverAttack2` `reaverAttack3` `reaverGrunt1` `reaverGrunt2` `reaverGrunt3` `reel` `refereeWhistle` `rifle_cock_01` `rifle_cock_02` `rifle_magazine_load_01` `rifle_magazine_load_02` `rifle_magazine_load_03` `rifle_magazine_unload_01` `rifle_magazine_unload_02` `rifle_magazine_unload_04` `rifle_shot_01` `rifle_shot_02` `rifle_shot_03` `rifle_shot_04` `sand1` `sand2` `sand3` `sand4` `semiAuto_cock_01` `semiAuto_cock_02` `semiAuto_cock_03` `semiAuto_cock_04` `semiAuto_cock_05` `semiAuto_first_shot_01` `semiAuto_magazine_load_01` `semiAuto_magazine_load_02` `semiAuto_magazine_load_03` `semiAuto_magazine_load_04` `semiAuto_magazine_load_05` `semiAuto_magazine_unload_01` `semiAuto_magazine_unload_02` `semiAuto_magazine_unload_03` `semiAuto_magazine_unload_04` `semiAuto_shot_01` `semiAuto_shot_02` `semiAuto_shot_03` `semiAuto_shot_04` `semiAuto_shot_05` `semiAuto_shot_06` `semiAuto_shot_07` `semiAuto_shot_08` `semiAuto_tail_only_shot_01` `sheepBaa1` `sheepBaa2` `sheepBaa3` `sheepBaa4` `sheepHurt1` `shotgun_cock_01` `shotgun_cock_02` `shotgun_cock_03` `shotgun_cock_04` `shotgun_cock_05` `shotgun_load_bullet_01` `shotgun_load_bullet_02` `shotgun_load_bullet_03` `shotgun_load_bullet_04` `shotgun_load_bullet_05` `shotgun_load_bullet_06` `shotgun_load_bullet_07` `shotgun_load_bullet_08` `shotgun_shot_01` `shotgun_shot_02` `shotgun_shot_03` `shotgun_shot_04` `skeletonRattle1` `skeletonRattle2` `skeletonRattle3` `skeletonRattle4` `snare` `snow1` `snow2` `snow3` `snow4` `sonarBeep` `splash1` `stagGrunt1` `stagHurt1` `step_cloth1` `step_cloth2` `step_cloth3` `step_cloth4` `step_grass1` `step_grass2` `step_grass3` `step_grass4` `step_grass5` `step_gravel1` `step_gravel2` `step_gravel3` `step_gravel4` `step_sand2` `step_sand3` `step_sand4` `step_sand5` `step_snow1` `step_snow2` `step_snow3` `step_snow4` `step_stone1` `step_stone2` `step_stone3` `step_stone4` `step_stone5` `step_stone6` `step_wood1` `step_wood2` `step_wood3` `step_wood4` `step_wood5` `step_wood6` `stone1` `stone2` `stone3` `stone4` `submachine_cock_01` `submachine_cock_02` `submachine_cock_03` `submachine_cock_04` `submachine_first_shot_01` `submachine_magazine_load_01` `submachine_magazine_load_02` `submachine_magazine_load_03` `submachine_magazine_load_04` `submachine_magazine_unload_01` `submachine_magazine_unload_02` `submachine_magazine_unload_03` `submachine_shot_01` `submachine_shot_02` `submachine_shot_03` `submachine_shot_04` `submachine_shot_05` `submachine_shot_06` `submachine_shot_07` `submachine_shot_08` `submachine_shot_09` `submachine_tail_only_shot_01` `successfulBowHit` `suspenseRiser` `sweep6` `thunderRain` `trapdoorOpen` `trumpetFlare` `trumpetNote1` `trumpetNote2` `trumpetNote3` `warperGrunt1` `warperGrunt2` `warperGrunt3` `warperGrunt4` `warperGrunt5` `warperPhase1` `warperPhase2` `wood1` `wood2` `wood3` `wood4` `wraithGrunt1` `wraithGrunt2` `wraithHurt` `zapAccent1` `zapAccent2` `ZombieGrunt1` `ZombieGrunt2` `ZombieGrunt3` `ZombieHurt1` `ZombieHurt2` `ZombieHurt3` `ZombieHurt4` --- ## Music Music tracks are longer audio for background ambiance. Use the `setClientOption` API method with the `"music"` option. ### API Usage ```ts // Play a song for a specific player api.setClientOption(playerId, "music", "Adigold - Dreamless Sleep") // Stop the current song api.setClientOption(playerId, "music", null) ``` **Note:** Unlike sound effects, songs are played via client options, not the `playSound` API. Only one song plays at a time per player; setting a new song replaces the current one. ### Available Songs (44 total) | Song Name | Duration | |-----------|----------| | `Adigold - A Place To Be Free` | 2:11 | | `Adigold - Butterfly Effect` | 1:24 | | `Adigold - Dreamless Sleep` | 1:58 | | `Adigold - Frozen Pulse` | 1:39 | | `Adigold - Frozen Skies` | 2:45 | | `Adigold - Healing Thoughts` | 1:59 | | `Adigold - Here Forever` | 2:43 | | `Adigold - Just a Little Hope` | 1:48 | | `Adigold - Just Like Heaven` | 1:22 | | `Adigold - Memories Remain` | 2:06 | | `Adigold - Place To Be` | 2:36 | | `Adigold - The Riverside` | 2:28 | | `Adigold - The Wonder` | 2:09 | | `Adigold - Vetrar (Cut B)` | 1:30 | | `Awkward Comedy Quirky` | 0:29 | | `battle-ship-111902` | 1:26 | | `cdk-Silence-Await` | 3:18 | | `corsairs-studiokolomna-main-version-23542-02-33` | 2:34 | | `ghost-Reverie-small-theme` | 0:41 | | `happy` | 3:01 | | `Heroic-Demise-New` | 5:02 | | `I-am-the-Sea-The-Room-4` | 3:21 | | `Juhani Junkala [Retro Game Music Pack] Ending` | 0:44 | | `Juhani Junkala [Retro Game Music Pack] Level 1` | 1:14 | | `Juhani Junkala [Retro Game Music Pack] Level 2` | 1:12 | | `Juhani Junkala [Retro Game Music Pack] Level 3` | 1:21 | | `Juhani Junkala [Retro Game Music Pack] Title Screen` | 0:11 | | `LonePeakMusic-Highway-1` | 2:27 | | `Mojo Productions - Pirates` | 1:54 | | `Mojo Productions - Sneaky Jazz` | 1:43 | | `Mojo Productions - The Sneaky` | 1:50 | | `Mojo Productions - The Sneaky Jazz` | 2:20 | | `progress` | 2:34 | | `raise-the-sails-152124` | 1:44 | | `ramblinglibrarian-I-Have-Often-T` | 3:42 | | `Slow-Motion-Bensound` | 3:27 | | `snowflake-Ethereal-Space` | 1:16 | | `the-epic-adventure-131399` | 2:01 | | `TownTheme` | 1:37 | | `The Suspense Ambient` | 1:59 | | `Epic1` | 2:16 | | `Epic2` | 2:23 | | `Emotional Epic` | 1:52 | | `Enemy Marked` | 1:29 |