cChestEntity
Index: Articles Classes Hooks Quick navigation: BannerPattern BossBarColor BossBarDivisionType cArrowEntity cBeaconEntity cBedEntity cBlockArea cBlockEntity cBlockEntityWithItems cBlockInfo cBoat cBoundingBox cBrewingstandEntity cChatColor cChestEntity cChunkDesc cClientHandle cColor cCommandBlockEntity cCompositeChat cCraftingGrid cCraftingRecipe cCryptoHash cCuboid cDispenserEntity cDropperEntity cDropSpenserEntity cEnchantments cEnderCrystal cEntity cEntityEffect cExpBottleEntity cExpOrb cFallingBlock cFile cFireChargeEntity cFireworkEntity cFloater cFlowerPotEntity cFurnaceEntity cGhastFireballEntity cHangingEntity cHopperEntity cIniFile cInventory cItem cItemFrame cItemGrid cItems cJson cJukeboxEntity cLeashKnot 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 cStringCompression cTCPLink cTeam cThrownEggEntity cThrownEnderPearlEntity cThrownSnowballEntity cTNTEntity cUDPEndpoint cUrlClient cUrlParser CustomStatistic cUUID cWebAdmin cWindow cWitherSkullEntity cWorld EffectID HTTPFormData HTTPRequest HTTPTemplateRequest ItemCategory lxp SmokeDirection sqlite3 StatisticsManager 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 ); |