PocketMine-MP 5.21.2 git-a6534ecbbbcf369264567d27e5ed70f7f5be9816
Loading...
Searching...
No Matches
pocketmine\item Namespace Reference

Classes

class  Apple
 
class  Armor
 
class  ArmorMaterial
 
class  ArmorTypeInfo
 
class  Arrow
 
class  Axe
 
class  BakedPotato
 
class  Bamboo
 
class  Banner
 
class  Beetroot
 
class  BeetrootSeeds
 
class  BeetrootSoup
 
class  BlazeRod
 
class  Boat
 
class  Book
 
class  Bow
 
class  Bowl
 
class  Bread
 
class  Bucket
 
class  Carrot
 
class  ChorusFruit
 
class  Clock
 
class  Clownfish
 
class  Coal
 
class  CocoaBeans
 
class  Compass
 
interface  ConsumableItem
 
class  CookedChicken
 
class  CookedFish
 
class  CookedMutton
 
class  CookedPorkchop
 
class  CookedRabbit
 
class  CookedSalmon
 
class  Cookie
 
class  CoralFan
 
class  DriedKelp
 
class  Durable
 
class  Dye
 
class  Egg
 
class  EnchantedBook
 
class  EndCrystal
 
class  EnderPearl
 
class  ExperienceBottle
 
class  Fertilizer
 
class  FireCharge
 
class  FishingRod
 
class  FlintSteel
 
class  Food
 
interface  FoodSourceItem
 
class  GlassBottle
 
class  GlowBerries
 
class  GoatHorn
 
class  GoldenApple
 
class  GoldenAppleEnchanted
 
class  GoldenCarrot
 
class  Hoe
 
class  HoneyBottle
 
class  Item
 
class  ItemBlock
 
class  ItemBlockWallOrFloor
 
class  ItemCooldownTags
 
class  ItemIdentifier
 
class  ItemTypeIds
 
class  LegacyStringToItemParser
 
class  LegacyStringToItemParserException
 
class  LiquidBucket
 
class  Medicine
 
class  Melon
 
class  MelonSeeds
 
class  MilkBucket
 
class  Minecart
 
class  MushroomStew
 
class  NameTag
 
class  PaintingItem
 
class  Pickaxe
 
class  PitcherPod
 
class  PoisonousPotato
 
class  Potato
 
class  Potion
 
class  ProjectileItem
 
class  Pufferfish
 
class  PumpkinPie
 
class  PumpkinSeeds
 
class  RabbitStew
 
class  RawBeef
 
class  RawChicken
 
class  RawFish
 
class  RawMutton
 
class  RawPorkchop
 
class  RawRabbit
 
class  RawSalmon
 
class  Record
 
class  Redstone
 
interface  Releasable
 
class  RottenFlesh
 
class  Shears
 
class  Shovel
 
class  Snowball
 
class  SpawnEgg
 
class  SpiderEye
 
class  SplashPotion
 
class  Spyglass
 
class  Steak
 
class  Stick
 
class  StringItem
 
class  StringToItemParser
 
class  SuspiciousStew
 
class  SweetBerries
 
class  Sword
 
class  TieredTool
 
class  Tool
 
class  TorchflowerSeeds
 
class  Totem
 
class  TurtleHelmet
 
class  VanillaArmorMaterials
 
class  VanillaItems
 
class  WheatSeeds
 
class  WritableBook
 
class  WritableBookBase
 
class  WritableBookPage
 
class  WrittenBook
 

Enumerations

enum  BoatType { getWoodType }
 
enum  GoatHornType { DREAM }
 
enum  ItemUseResult { SUCCESS }
 
enum  MedicineType { getMetadata }
 
enum  PotionType { getMetadata }
 
enum  SuspiciousStewType { getEffects }
 
enum  ToolTier { meta }
 

Functions

 addEnchantment (EnchantmentInstance $enchantment)
 
 getEnchantment (Enchantment $enchantment)
 
 getEnchantmentLevel (Enchantment $enchantment)
 
 getEnchantments ()
 
 hasEnchantment (Enchantment $enchantment, int $level=-1)
 
 hasEnchantments ()
 
 removeEnchantment (Enchantment $enchantment, int $level=-1)
 
 removeEnchantments ()
 

Variables

trait ItemEnchantmentHandlingTrait
 

Detailed Description

All the Item classes

Enumeration Type Documentation

◆ BoatType

enum pocketmine::item::BoatType

Definition at line 28 of file BoatType.php.

◆ GoatHornType

enum pocketmine::item::GoatHornType

Definition at line 26 of file GoatHornType.php.

◆ ItemUseResult

enum pocketmine::item::ItemUseResult

Definition at line 26 of file ItemUseResult.php.

◆ MedicineType

Enumerator
getMetadata 

@phpstan-return array{0: string, 1: Effect}

@phpstan-return TMetadata

Definition at line 29 of file MedicineType.php.

◆ PotionType

@phpstan-type TMetadata array{0: string, 1: \Closure() : list<EffectInstance>}

Enumerator
getMetadata 

@phpstan-return array{0: string, 1: Effect}

@phpstan-return TMetadata

Definition at line 33 of file PotionType.php.

◆ SuspiciousStewType

Enumerator
getEffects 
Returns
EffectInstance[] @phpstan-return list<EffectInstance>

Definition at line 29 of file SuspiciousStewType.php.

◆ ToolTier

@phpstan-type TMetadata array{0: int, 1: int, 2: int, 3: int, 4: int}

Enumerator
meta 

This function exists only to permit the use of named arguments and to make the code easier to read in PhpStorm. @phpstan-return TMetadata

Definition at line 29 of file ToolTier.php.

Function Documentation

◆ addEnchantment()

pocketmine\item\addEnchantment ( EnchantmentInstance $enchantment)
Returns
$this

Definition at line 75 of file ItemEnchantmentHandlingTrait.php.

◆ getEnchantment()

pocketmine\item\getEnchantment ( Enchantment $enchantment)

Definition at line 48 of file ItemEnchantmentHandlingTrait.php.

◆ getEnchantmentLevel()

pocketmine\item\getEnchantmentLevel ( Enchantment $enchantment)

Returns the level of the enchantment on this item with the specified ID, or 0 if the item does not have the enchantment.

Definition at line 91 of file ItemEnchantmentHandlingTrait.php.

◆ getEnchantments()

pocketmine\item\getEnchantments ( )
Returns
EnchantmentInstance[]

Definition at line 83 of file ItemEnchantmentHandlingTrait.php.

Referenced by pocketmine\item\Armor\getEnchantmentProtectionFactor().

+ Here is the caller graph for this function:

◆ hasEnchantment()

pocketmine\item\hasEnchantment ( Enchantment $enchantment,
int $level = -1 )

Definition at line 43 of file ItemEnchantmentHandlingTrait.php.

◆ hasEnchantments()

pocketmine\item\hasEnchantments ( )

Definition at line 39 of file ItemEnchantmentHandlingTrait.php.

◆ removeEnchantment()

pocketmine\item\removeEnchantment ( Enchantment $enchantment,
int $level = -1 )
Returns
$this

Definition at line 55 of file ItemEnchantmentHandlingTrait.php.

◆ removeEnchantments()

pocketmine\item\removeEnchantments ( )
Returns
$this

Definition at line 67 of file ItemEnchantmentHandlingTrait.php.

Variable Documentation

◆ ItemEnchantmentHandlingTrait

trait pocketmine::item\ItemEnchantmentHandlingTrait
Initial value:
{
protected array $enchantments = []

This trait encapsulates all enchantment handling needed for itemstacks. The primary purpose of this trait is providing scope isolation for the methods it contains.

Definition at line 35 of file ItemEnchantmentHandlingTrait.php.