cChestEntity
Index: Articles Classes Hooks Quick navigation: cArrowEntity cBeaconEntity cBlockArea cBlockEntity cBlockEntityWithItems cBlockInfo cBoundingBox cBrewingstandEntity cChatColor cChestEntity cChunkDesc cClientHandle cCommandBlockEntity cCompositeChat cCraftingGrid cCraftingRecipe cCryptoHash cCuboid cDispenserEntity cDropperEntity cDropSpenserEntity cEnchantments cEntity cEntityEffect cExpBottleEntity cFile cFireChargeEntity cFireworkEntity cFloater cFlowerPotEntity cFurnaceEntity cGhastFireballEntity cHangingEntity cHopperEntity cIniFile cInventory cItem cItemFrame cItemGrid cItems cJson cJukeboxEntity cLineBlockTracer cLuaWindow cMap cMapManager cMobHeadEntity cMobSpawnerEntity cMojangAPI cMonster cNetwork cNoteEntity cObjective cPainting cPawn cPickup cPlayer cPlugin cPluginLua cPluginManager cProjectileEntity cRankManager cRoot cScoreboard cServer cServerHandle cSignEntity cSplashPotionEntity cStatManager cStringCompression cTCPLink cTeam cThrownEggEntity cThrownEnderPearlEntity cThrownSnowballEntity cTNTEntity cTracer cUDPEndpoint cUrlClient cUrlParser cWebAdmin cWindow cWitherSkullEntity cWorld HTTPFormData HTTPRequest HTTPTemplateRequest ItemCategory lxp sqlite3 TakeDamageInfo tolua Vector3d Vector3f Vector3i Globals | ContentscChestEntity classA chest entity is a cBlockEntityWithItems descendant that represents a chest in the world. Note that doublechests consist of two separate cChestEntity objects, they do not collaborate in any way. To manipulate a chest already in the game, you need to use cWorld's callback mechanism with either DoWithChestAt() or ForEachChestInChunk() function. See the code example below InheritanceThis class inherits from the following parent classes: Constants
FunctionsFunctions inherited from cBlockEntityWithItems
Functions inherited from cBlockEntity
Code exampleThe following example code sets the top-left item of each chest in the same chunk as Player to 64 * diamond:-- Player is a cPlayer object instance local World = Player:GetWorld(); World:ForEachChestInChunk(Player:GetChunkX(), Player:GetChunkZ(), function (ChestEntity) ChestEntity:SetSlot(0, 0, cItem(E_ITEM_DIAMOND, 64)); end ); |