ItemCategory


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

Contents


ItemCategory class

This class contains static functions for determining item categories. All of the functions are called directly on the class table, unlike most other object, which require an instance first.


Functions

NameParametersReturn valueNotes
IsArmor
ItemTypenumber
boolean
(STATIC) Returns true if the specified item type is any kind of an armor.
IsAxe
ItemTypenumber
boolean
(STATIC) Returns true if the specified item type is any kind of an axe.
IsBoots
ItemTypenumber
boolean
(STATIC) Returns true if the specified item type is any kind of boots.
IsChestPlate
ItemTypenumber
boolean
(STATIC) Returns true if the specified item type is any kind of a chestplate.
IsHelmet
ItemTypenumber
boolean
(STATIC) Returns true if the specified item type is any kind of a helmet.
IsHoe
ItemTypenumber
boolean
(STATIC) Returns true if the specified item type is any kind of a hoe.
IsLeggings
ItemTypenumber
boolean
(STATIC) Returns true if the specified item type is any kind of a leggings.
IsMinecart
ItemTypenumber
boolean
(STATIC) Returns true if the specified item type is any kind of a minecart.
IsPickaxe
ItemTypenumber
boolean
(STATIC) Returns true if the specified item type is any kind of a pickaxe.
IsShovel
ItemTypenumber
boolean
(STATIC) Returns true if the specified item type is any kind of a shovel.
IsSword
ItemTypenumber
boolean
(STATIC) Returns true if the specified item type is any kind of a sword.
IsTool
ItemTypenumber
boolean
(STATIC) Returns true if the specified item type is any kind of a tool (axe, hoe, pickaxe, shovel or FIXME: sword)

Code example

The following code snippet checks if the player holds a shovel.
-- a_Player is a cPlayer object, possibly received as a hook param
local HeldItem = a_Player:GetEquippedItem()
if (ItemCategory.IsShovel(HeldItem.m_ItemType)) then
	-- It's a shovel
end
Generated on 2017-02-20 13:00:36, Build ID Unknown, Commit approx: 9cb1ad546f09066cd9949fd0e4fa7fd2e54dd519