ItemCategory


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

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.
IsHorseArmor
ItemTypenumber
boolean
(STATIC) Returns true if the specified item type is any kind of a horse armor.
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)
IsVillagerFood
ItemTypenumber
boolean
(STATIC) Returns true if the specified item type is any kind of a pickable food by a villager (potato, carrot, wheat, bread and any kind of seeds).

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 by APIDump on 2024-07-12 00:49:19, Build ID 63, Commit 5f4d2f004bc41bc44d0df7376e48cbb5567db1be