Inherits pocketmine\block\Block.
Inherited by pocketmine\block\Barrel, pocketmine\block\Bedrock, pocketmine\block\BlueIce, pocketmine\block\BoneBlock, pocketmine\block\Bookshelf, pocketmine\block\BuddingAmethyst, pocketmine\block\CartographyTable, pocketmine\block\CarvedPumpkin, pocketmine\block\ChemistryTable, pocketmine\block\ChiseledBookshelf, pocketmine\block\Clay, pocketmine\block\Coal, pocketmine\block\CoalOre, pocketmine\block\Concrete, pocketmine\block\ConcretePowder, pocketmine\block\Copper, pocketmine\block\CopperOre, pocketmine\block\CoralBlock, pocketmine\block\CraftingTable, pocketmine\block\DiamondOre, pocketmine\block\Dirt, pocketmine\block\DriedKelp, pocketmine\block\Element, pocketmine\block\EmeraldOre, pocketmine\block\EndPortalFrame, pocketmine\block\FletchingTable, pocketmine\block\Furnace, pocketmine\block\GildedBlackstone, pocketmine\block\GlazedTerracotta, pocketmine\block\GlowingObsidian, pocketmine\block\GoldOre, pocketmine\block\Grass, pocketmine\block\Gravel, pocketmine\block\HardenedClay, pocketmine\block\HayBale, pocketmine\block\InfestedStone, pocketmine\block\IronOre, pocketmine\block\Jukebox, pocketmine\block\LapisOre, pocketmine\block\Loom, pocketmine\block\Magma, pocketmine\block\Melon, pocketmine\block\MushroomStem, pocketmine\block\Mycelium, pocketmine\block\NetherGoldOre, pocketmine\block\NetherQuartzOre, pocketmine\block\NetherReactor, pocketmine\block\Netherrack, pocketmine\block\Note, pocketmine\block\PackedIce, pocketmine\block\Planks, pocketmine\block\Podzol, pocketmine\block\Pumpkin, pocketmine\block\RedMushroomBlock, pocketmine\block\Redstone, pocketmine\block\RedstoneLamp, pocketmine\block\RedstoneOre, pocketmine\block\Reserved6, pocketmine\block\Sand, pocketmine\block\Sculk, pocketmine\block\ShulkerBox, pocketmine\block\SimplePillar, pocketmine\block\SmithingTable, pocketmine\block\Snow, pocketmine\block\SoulSand, pocketmine\block\Sponge, pocketmine\block\TNT, pocketmine\block\Wood, and pocketmine\block\Wool.
|
| __clone () |
|
| __toString () |
|
| addVelocityToEntity (Entity $entity) |
|
| asItem () |
|
| blocksDirectSkyLight () |
|
| burnsForever () |
|
| calculateIntercept (Vector3 $pos1, Vector3 $pos2) |
|
| canBeFlowedInto () |
|
| canBePlaced () |
|
| canBePlacedAt (Block $blockReplace, Vector3 $clickVector, int $face, bool $isClickedBlock) |
|
| canBeReplaced () |
|
| canClimb () |
|
| collidesWithBB (AxisAlignedBB $bb) |
|
| describeBlockItemState (RuntimeDataDescriber $w) |
|
| generateStatePermutations () |
|
| getAffectedBlocks () |
|
| getAllSides () |
|
| getBreakInfo () |
|
| getCollisionBoxes () |
|
| getDrops (Item $item) |
|
| getDropsForCompatibleTool (Item $item) |
|
| getDropsForIncompatibleTool (Item $item) |
|
| getEnchantmentTags () |
|
| getFlameEncouragement () |
|
| getFlammability () |
|
| getFrictionFactor () |
|
| getFuelTime () |
|
| getHorizontalSides () |
|
| getIdInfo () |
|
| getLightFilter () |
|
| getLightLevel () |
|
| getMaxStackSize () |
|
| getModelPositionOffset () |
|
| getName () |
|
| getPickedItem (bool $addUserData=false) |
|
| getPosition () |
|
| getSide (int $side, int $step=1) |
|
| getSilkTouchDrops (Item $item) |
|
| getStateId () |
|
| getSupportType (int $facing) |
|
| getTypeId () |
|
| getTypeTags () |
|
| getXpDropForTool (Item $item) |
|
| hasEntityCollision () |
|
| hasSameTypeId (Block $other) |
|
| hasTypeTag (string $tag) |
|
| isAffectedBySilkTouch () |
|
| isFireProofAsItem () |
|
| isFlammable () |
|
| isFullCube () |
|
| isSameState (Block $other) |
|
| isSolid () |
|
| isTransparent () |
|
| onAttack (Item $item, int $face, ?Player $player=null) |
|
| onBreak (Item $item, ?Player $player=null, array &$returnedItems=[]) |
|
| onEntityInside (Entity $entity) |
|
| onEntityLand (Entity $entity) |
|
| onIncinerate () |
|
| onInteract (Item $item, int $face, Vector3 $clickVector, ?Player $player=null, array &$returnedItems=[]) |
|
| onNearbyBlockChange () |
|
| onPostPlace () |
|
| onProjectileHit (Projectile $projectile, RayTraceResult $hitResult) |
|
| onRandomTick () |
|
| onScheduledUpdate () |
|
| place (BlockTransaction $tx, Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, ?Player $player=null) |
|
| position (World $world, int $x, int $y, int $z) |
|
| readStateFromWorld () |
|
| ticksRandomly () |
|
| writeStateToWorld () |
|
Opaque blocks do not allow light to pass through. They are usually collidable full-cube blocks. Most blocks in Minecraft fall into this category.
Definition at line 30 of file Opaque.php.
◆ __clone()
pocketmine\block\Block::__clone |
( |
| ) |
|
|
inherited |
◆ __toString()
pocketmine\block\Block::__toString |
( |
| ) |
|
|
inherited |
◆ addVelocityToEntity()
pocketmine\block\Block::addVelocityToEntity |
( |
Entity |
$entity | ) |
|
|
inherited |
Returns a direction vector describing which way an entity intersecting this block should be pushed. This is used by liquids to push entities in liquid currents.
The returned vector is summed with vectors from every other block the entity is intersecting, and normalized to produce a final direction vector.
WARNING: This will not be called if Block::hasEntityCollision()
does not return true!
Reimplemented in pocketmine\block\Liquid.
Definition at line 880 of file Block.php.
◆ asItem()
pocketmine\block\Block::asItem |
( |
| ) |
|
|
inherited |
Returns the block as an item. Block-only state such as facing, powered/unpowered, open/closed, etc., is discarded. Block-item state such as colour, wood type, etc. is preserved. Complex state properties stored in the tile data (e.g. inventory) are discarded.
Reimplemented in pocketmine\block\Bamboo, pocketmine\block\BambooSapling, pocketmine\block\BaseBanner, pocketmine\block\BaseSign, pocketmine\block\Beetroot, pocketmine\block\BigDripleafStem, pocketmine\block\Carrot, pocketmine\block\CaveVines, pocketmine\block\CocoaBlock, pocketmine\block\DoublePitcherCrop, pocketmine\block\FillableCauldron, pocketmine\block\FloorCoralFan, pocketmine\block\MelonStem, pocketmine\block\PitcherCrop, pocketmine\block\Potato, pocketmine\block\PumpkinStem, pocketmine\block\RedstoneWire, pocketmine\block\SweetBerryBush, pocketmine\block\TorchflowerCrop, pocketmine\block\Tripwire, pocketmine\block\WallCoralFan, and pocketmine\block\Wheat.
Definition at line 222 of file Block.php.
◆ blocksDirectSkyLight()
pocketmine\block\Block::blocksDirectSkyLight |
( |
| ) |
|
|
inherited |
Returns whether this block blocks direct sky light from passing through it. This is independent from the light filter value, which is used during propagation.
In most cases, this is the same as isTransparent(); however, some special cases exist such as leaves and cobwebs, which don't have any additional effect on light propagation, but don't allow direct sky light to pass through.
Reimplemented in pocketmine\block\Cobweb, and pocketmine\block\Leaves.
Definition at line 571 of file Block.php.
◆ burnsForever()
pocketmine\block\Block::burnsForever |
( |
| ) |
|
|
inherited |
◆ calculateIntercept()
pocketmine\block\Block::calculateIntercept |
( |
Vector3 |
$pos1, |
|
|
Vector3 |
$pos2 |
|
) |
| |
|
inherited |
Performs a ray trace along the line between the two positions using the block's collision boxes. Returns the intersection point closest to pos1, or null if no intersection occurred.
Definition at line 959 of file Block.php.
◆ canBeFlowedInto()
pocketmine\block\Block::canBeFlowedInto |
( |
| ) |
|
|
inherited |
◆ canBePlaced()
pocketmine\block\Block::canBePlaced |
( |
| ) |
|
|
inherited |
◆ canBePlacedAt()
pocketmine\block\Block::canBePlacedAt |
( |
Block |
$blockReplace, |
|
|
Vector3 |
$clickVector, |
|
|
int |
$face, |
|
|
bool |
$isClickedBlock |
|
) |
| |
|
inherited |
◆ canBeReplaced()
pocketmine\block\Block::canBeReplaced |
( |
| ) |
|
|
inherited |
◆ canClimb()
pocketmine\block\Block::canClimb |
( |
| ) |
|
|
inherited |
◆ collidesWithBB()
◆ describeBlockItemState()
Describes properties of this block which apply to both the block and item form of the block. Examples of suitable properties include colour, skull type, and any other information which IS kept when the block is mined or block-picked.
The method implementation must NOT use conditional logic to determine which properties are written. It must always write the same properties in the same order, regardless of the current state of the block.
Reimplemented in pocketmine\block\AmethystCluster, pocketmine\block\Anvil, pocketmine\block\Dirt, pocketmine\block\Froglight, pocketmine\block\Light, pocketmine\block\MobHead, pocketmine\block\RedMushroomBlock, pocketmine\block\Sponge, pocketmine\block\TNT, pocketmine\block\UnknownBlock, and pocketmine\block\Wood.
Definition at line 299 of file Block.php.
Referenced by pocketmine\block\Block\__construct().
◆ describeBlockOnlyState()
Describes properties of this block which apply only to the block form of the block. Examples of suitable properties include facing, open/closed, powered/unpowered, on/off, and any other information which IS NOT kept when the block is mined or block-picked.
The method implementation must NOT use conditional logic to determine which properties are written. It must always write the same properties in the same order, regardless of the current state of the block.
Reimplemented in pocketmine\block\Anvil, pocketmine\block\Bamboo, pocketmine\block\BambooSapling, pocketmine\block\Barrel, pocketmine\block\Bed, pocketmine\block\Bedrock, pocketmine\block\Bell, pocketmine\block\BigDripleafHead, pocketmine\block\BrewingStand, pocketmine\block\Button, pocketmine\block\Cake, pocketmine\block\Candle, pocketmine\block\CaveVines, pocketmine\block\ChiseledBookshelf, pocketmine\block\CocoaBlock, pocketmine\block\DaylightSensor, pocketmine\block\DetectorRail, pocketmine\block\Door, pocketmine\block\DoublePitcherCrop, pocketmine\block\DoublePlant, pocketmine\block\EndPortalFrame, pocketmine\block\Farmland, pocketmine\block\FenceGate, pocketmine\block\FillableCauldron, pocketmine\block\FloorCoralFan, pocketmine\block\Furnace, pocketmine\block\GlowLichen, pocketmine\block\Hopper, pocketmine\block\ItemFrame, pocketmine\block\Lantern, pocketmine\block\Leaves, pocketmine\block\Lectern, pocketmine\block\Lever, pocketmine\block\Liquid, pocketmine\block\MobHead, pocketmine\block\NetherPortal, pocketmine\block\PinkPetals, pocketmine\block\Rail, pocketmine\block\RedstoneComparator, pocketmine\block\RedstoneLamp, pocketmine\block\RedstoneRepeater, pocketmine\block\RedstoneTorch, pocketmine\block\Sapling, pocketmine\block\SeaPickle, pocketmine\block\ShulkerBox, pocketmine\block\SimplePressurePlate, pocketmine\block\Slab, pocketmine\block\SmallDripleaf, pocketmine\block\SnowLayer, pocketmine\block\Stair, pocketmine\block\Stem, pocketmine\block\StraightOnlyRail, pocketmine\block\TNT, pocketmine\block\Torch, pocketmine\block\TorchflowerCrop, pocketmine\block\Trapdoor, pocketmine\block\Tripwire, pocketmine\block\TripwireHook, pocketmine\block\Vine, pocketmine\block\Wall, and pocketmine\block\WallCoralFan.
Definition at line 311 of file Block.php.
Referenced by pocketmine\block\Block\__construct().
◆ generateStatePermutations()
pocketmine\block\Block::generateStatePermutations |
( |
| ) |
|
|
inherited |
Generates copies of this Block in all possible state permutations. Every possible combination of known properties (e.g. facing, open/closed, powered/unpowered, on/off) will be generated.
@phpstan-return \Generator<int, Block, void, void>
Definition at line 322 of file Block.php.
◆ getAdjacentSupportType()
pocketmine\block\Block::getAdjacentSupportType |
( |
int |
$facing | ) |
|
|
protectedinherited |
◆ getAffectedBlocks()
pocketmine\block\Block::getAffectedBlocks |
( |
| ) |
|
|
inherited |
◆ getAllSides()
pocketmine\block\Block::getAllSides |
( |
| ) |
|
|
inherited |
Returns the six blocks around this block.
- Returns
- Block[]|\Generator @phpstan-return \Generator<int, Block, void, void>
Definition at line 807 of file Block.php.
◆ getBreakInfo()
pocketmine\block\Block::getBreakInfo |
( |
| ) |
|
|
inherited |
Returns an object containing information about the destruction requirements of this block.
Definition at line 456 of file Block.php.
◆ getCollisionBoxes()
pocketmine\block\Block::getCollisionBoxes |
( |
| ) |
|
|
finalinherited |
Returns an array of collision bounding boxes for this block. These are used for:
- entity movement collision checks (to ensure entities can't clip through blocks)
- projectile flight paths
- block placement (to ensure the player can't place blocks inside itself or another entity)
- anti-cheat checks in plugins
- Returns
- AxisAlignedBB[]
Definition at line 909 of file Block.php.
◆ getDrops()
pocketmine\block\Block::getDrops |
( |
Item |
$item | ) |
|
|
inherited |
◆ getDropsForCompatibleTool()
pocketmine\block\Block::getDropsForCompatibleTool |
( |
Item |
$item | ) |
|
|
inherited |
Returns an array of Items to be dropped when the block is broken using the correct tool type.
- Returns
- Item[]
Reimplemented in pocketmine\block\AmethystCluster, pocketmine\block\BaseBanner, pocketmine\block\BaseCoral, pocketmine\block\BaseFire, pocketmine\block\Beetroot, pocketmine\block\BlueIce, pocketmine\block\Bookshelf, pocketmine\block\BrownMushroomBlock, pocketmine\block\BuddingAmethyst, pocketmine\block\Cake, pocketmine\block\CakeWithCandle, pocketmine\block\Candle, pocketmine\block\Carrot, pocketmine\block\CaveVines, pocketmine\block\ChiseledBookshelf, pocketmine\block\ChorusPlant, pocketmine\block\Clay, pocketmine\block\CoalOre, pocketmine\block\Cobweb, pocketmine\block\CocoaBlock, pocketmine\block\CopperOre, pocketmine\block\CoralBlock, pocketmine\block\DiamondOre, pocketmine\block\DoublePitcherCrop, pocketmine\block\EmeraldOre, pocketmine\block\EnderChest, pocketmine\block\Farmland, pocketmine\block\FlowerPot, pocketmine\block\GildedBlackstone, pocketmine\block\Glass, pocketmine\block\GlassPane, pocketmine\block\Glowstone, pocketmine\block\GoldOre, pocketmine\block\Grass, pocketmine\block\GrassPath, pocketmine\block\Gravel, pocketmine\block\Ice, pocketmine\block\InfestedStone, pocketmine\block\IronOre, pocketmine\block\ItemFrame, pocketmine\block\Jukebox, pocketmine\block\LapisOre, pocketmine\block\Leaves, pocketmine\block\Liquid, pocketmine\block\Melon, pocketmine\block\MonsterSpawner, pocketmine\block\MushroomStem, pocketmine\block\Mycelium, pocketmine\block\NetherGoldOre, pocketmine\block\NetherQuartzOre, pocketmine\block\NetherReactor, pocketmine\block\NetherVines, pocketmine\block\NetherWartPlant, pocketmine\block\PackedIce, pocketmine\block\PinkPetals, pocketmine\block\Podzol, pocketmine\block\Potato, pocketmine\block\RedMushroomBlock, pocketmine\block\RedstoneOre, pocketmine\block\Sculk, pocketmine\block\SeaLantern, pocketmine\block\SeaPickle, pocketmine\block\ShulkerBox, pocketmine\block\Slab, pocketmine\block\SmallDripleaf, pocketmine\block\Snow, pocketmine\block\SnowLayer, pocketmine\block\Stem, pocketmine\block\SweetBerryBush, and pocketmine\block\Wheat.
Definition at line 643 of file Block.php.
Referenced by pocketmine\block\HangingRoots\getDropsForIncompatibleTool().
◆ getDropsForIncompatibleTool()
pocketmine\block\Block::getDropsForIncompatibleTool |
( |
Item |
$item | ) |
|
|
inherited |
◆ getEnchantmentTags()
pocketmine\block\Block::getEnchantmentTags |
( |
| ) |
|
|
inherited |
Returns tags that represent the type of item being enchanted and are used to determine what enchantments can be applied to the item of this block during in-game enchanting (enchanting table, anvil, fishing, etc.).
- See also
- ItemEnchantmentTags
-
ItemEnchantmentTagRegistry
-
AvailableEnchantmentRegistry
- Returns
- string[]
Definition at line 469 of file Block.php.
◆ getFlameEncouragement()
pocketmine\block\Block::getFlameEncouragement |
( |
| ) |
|
|
inherited |
Returns the chance that the block will catch fire from nearby fire sources. Higher values lead to faster catching fire.
Reimplemented in pocketmine\block\BaseBigDripleaf, pocketmine\block\Bookshelf, pocketmine\block\Carpet, pocketmine\block\Coal, pocketmine\block\DeadBush, pocketmine\block\DoublePlant, pocketmine\block\DriedKelp, pocketmine\block\FenceGate, pocketmine\block\Flower, pocketmine\block\GlowLichen, pocketmine\block\HayBale, pocketmine\block\Leaves, pocketmine\block\MangroveRoots, pocketmine\block\PinkPetals, pocketmine\block\Planks, pocketmine\block\SmallDripleaf, pocketmine\block\TNT, pocketmine\block\Vine, pocketmine\block\WitherRose, pocketmine\block\Wood, pocketmine\block\WoodenFence, pocketmine\block\WoodenSlab, pocketmine\block\WoodenStairs, and pocketmine\block\Wool.
Definition at line 731 of file Block.php.
◆ getFlammability()
pocketmine\block\Block::getFlammability |
( |
| ) |
|
|
inherited |
Returns the base flammability of this block. Higher values lead to the block burning away more quickly.
Reimplemented in pocketmine\block\BaseBigDripleaf, pocketmine\block\Bookshelf, pocketmine\block\Carpet, pocketmine\block\Coal, pocketmine\block\DeadBush, pocketmine\block\DoublePlant, pocketmine\block\DriedKelp, pocketmine\block\FenceGate, pocketmine\block\Flower, pocketmine\block\GlowLichen, pocketmine\block\HayBale, pocketmine\block\Leaves, pocketmine\block\Lectern, pocketmine\block\MangroveRoots, pocketmine\block\PinkPetals, pocketmine\block\Planks, pocketmine\block\SmallDripleaf, pocketmine\block\TNT, pocketmine\block\Vine, pocketmine\block\WitherRose, pocketmine\block\Wood, pocketmine\block\WoodenFence, pocketmine\block\WoodenSlab, pocketmine\block\WoodenStairs, and pocketmine\block\Wool.
Definition at line 738 of file Block.php.
◆ getFrictionFactor()
pocketmine\block\Block::getFrictionFactor |
( |
| ) |
|
|
inherited |
◆ getFuelTime()
pocketmine\block\Block::getFuelTime |
( |
| ) |
|
|
inherited |
Returns the time in ticks which the block will fuel a furnace for.
Reimplemented in pocketmine\block\Barrel, pocketmine\block\BaseSign, pocketmine\block\Bookshelf, pocketmine\block\CartographyTable, pocketmine\block\Chest, pocketmine\block\Coal, pocketmine\block\CraftingTable, pocketmine\block\DaylightSensor, pocketmine\block\DriedKelp, pocketmine\block\FenceGate, pocketmine\block\FletchingTable, pocketmine\block\Jukebox, pocketmine\block\Note, pocketmine\block\Planks, pocketmine\block\Sapling, pocketmine\block\SmithingTable, pocketmine\block\Wood, pocketmine\block\WoodenButton, pocketmine\block\WoodenDoor, pocketmine\block\WoodenFence, pocketmine\block\WoodenPressurePlate, pocketmine\block\WoodenSlab, pocketmine\block\WoodenStairs, and pocketmine\block\WoodenTrapdoor.
Definition at line 712 of file Block.php.
◆ getHorizontalSides()
pocketmine\block\Block::getHorizontalSides |
( |
| ) |
|
|
inherited |
Returns the 4 blocks on the horizontal axes around the block (north, south, east, west)
- Returns
- Block[]|\Generator @phpstan-return \Generator<int, Block, void, void>
Definition at line 788 of file Block.php.
◆ getIdInfo()
pocketmine\block\Block::getIdInfo |
( |
| ) |
|
|
inherited |
Returns an object containing information about how to identify and store this block type, such as type ID and tile type (if any).
Definition at line 136 of file Block.php.
◆ getLightFilter()
pocketmine\block\Block::getLightFilter |
( |
| ) |
|
|
inherited |
◆ getLightLevel()
pocketmine\block\Block::getLightLevel |
( |
| ) |
|
|
inherited |
Returns the amount of light emitted by this block.
- Returns
- int 0-15
Reimplemented in pocketmine\block\AmethystCluster, pocketmine\block\Beacon, pocketmine\block\BrownMushroom, pocketmine\block\Candle, pocketmine\block\CaveVines, pocketmine\block\DragonEgg, pocketmine\block\EnderChest, pocketmine\block\EndPortalFrame, pocketmine\block\EndRod, pocketmine\block\Froglight, pocketmine\block\Furnace, pocketmine\block\GlowingObsidian, pocketmine\block\GlowLichen, pocketmine\block\Glowstone, pocketmine\block\Lantern, pocketmine\block\Lava, pocketmine\block\LavaCauldron, pocketmine\block\Light, pocketmine\block\LitPumpkin, pocketmine\block\Magma, pocketmine\block\NetherPortal, pocketmine\block\RedstoneLamp, pocketmine\block\RedstoneOre, pocketmine\block\RedstoneTorch, pocketmine\block\SeaLantern, pocketmine\block\SeaPickle, pocketmine\block\SoulFire, and pocketmine\block\Torch.
Definition at line 550 of file Block.php.
◆ getMaxStackSize()
pocketmine\block\Block::getMaxStackSize |
( |
| ) |
|
|
inherited |
◆ getModelPositionOffset()
pocketmine\block\Block::getModelPositionOffset |
( |
| ) |
|
|
inherited |
Returns an additional fractional vector to shift the block model's position by based on the current position. Used to randomize position of things like bamboo canes and tall grass.
Reimplemented in pocketmine\block\Bamboo.
Definition at line 926 of file Block.php.
◆ getName()
pocketmine\block\Block::getName |
( |
| ) |
|
|
inherited |
Returns the printable English name of the block.
Definition at line 143 of file Block.php.
◆ getPickedItem()
pocketmine\block\Block::getPickedItem |
( |
bool |
$addUserData = false | ) |
|
|
inherited |
Returns the item that players will equip when middle-clicking on this block. If addUserData is true, additional data may be added, such as banner patterns, chest contents, etc.
Reimplemented in pocketmine\block\BaseBanner, pocketmine\block\CakeWithCandle, pocketmine\block\Farmland, pocketmine\block\FlowerPot, pocketmine\block\ItemFrame, pocketmine\block\RedMushroomBlock, and pocketmine\block\ShulkerBox.
Definition at line 694 of file Block.php.
References pocketmine\item\Item\setCustomBlockData(), and pocketmine\item\Item\setLore().
◆ getPosition()
pocketmine\block\Block::getPosition |
( |
| ) |
|
|
finalinherited |
◆ getSide()
pocketmine\block\Block::getSide |
( |
int |
$side, |
|
|
int |
$step = 1 |
|
) |
| |
|
inherited |
◆ getSilkTouchDrops()
pocketmine\block\Block::getSilkTouchDrops |
( |
Item |
$item | ) |
|
|
inherited |
◆ getStateId()
pocketmine\block\Block::getStateId |
( |
| ) |
|
|
inherited |
◆ getSupportType()
pocketmine\block\Block::getSupportType |
( |
int |
$facing | ) |
|
|
inherited |
Returns the type of support that the block can provide on the given face. This is used to determine whether blocks placed on the given face can be supported by this block.
Reimplemented in pocketmine\block\AmethystCluster, pocketmine\block\Anvil, pocketmine\block\Bamboo, pocketmine\block\BaseBanner, pocketmine\block\BaseBigDripleaf, pocketmine\block\BaseCake, pocketmine\block\BaseCoral, pocketmine\block\BaseSign, pocketmine\block\Bed, pocketmine\block\Bell, pocketmine\block\BrewingStand, pocketmine\block\Cactus, pocketmine\block\Candle, pocketmine\block\Cauldron, pocketmine\block\CaveVines, pocketmine\block\Chain, pocketmine\block\Chest, pocketmine\block\DaylightSensor, pocketmine\block\Door, pocketmine\block\DragonEgg, pocketmine\block\EnchantingTable, pocketmine\block\EnderChest, pocketmine\block\Fence, pocketmine\block\FenceGate, pocketmine\block\FillableCauldron, pocketmine\block\Flowable, pocketmine\block\GlowLichen, pocketmine\block\Hopper, pocketmine\block\Ladder, pocketmine\block\Lantern, pocketmine\block\Leaves, pocketmine\block\Lectern, pocketmine\block\Liquid, pocketmine\block\MonsterSpawner, pocketmine\block\NetherPortal, pocketmine\block\NetherVines, pocketmine\block\PressurePlate, pocketmine\block\SeaPickle, pocketmine\block\ShulkerBox, pocketmine\block\Slab, pocketmine\block\SmallDripleaf, pocketmine\block\SnowLayer, pocketmine\block\Stair, pocketmine\block\Stonecutter, pocketmine\block\Thin, pocketmine\block\Trapdoor, and pocketmine\block\Wall.
Definition at line 941 of file Block.php.
◆ getTypeId()
pocketmine\block\Block::getTypeId |
( |
| ) |
|
|
inherited |
◆ getTypeTags()
pocketmine\block\Block::getTypeTags |
( |
| ) |
|
|
inherited |
◆ getXpDropAmount()
pocketmine\block\Block::getXpDropAmount |
( |
| ) |
|
|
protectedinherited |
◆ getXpDropForTool()
pocketmine\block\Block::getXpDropForTool |
( |
Item |
$item | ) |
|
|
inherited |
Returns how much XP will be dropped by breaking this block with the given item.
Definition at line 668 of file Block.php.
◆ hasEntityCollision()
pocketmine\block\Block::hasEntityCollision |
( |
| ) |
|
|
inherited |
Returns whether the block has actions to be executed when an entity enters its cell (full cube space).
- See also
- Block::onEntityInside()
Reimplemented in pocketmine\block\BaseFire, pocketmine\block\BigDripleafHead, pocketmine\block\Cactus, pocketmine\block\CaveVines, pocketmine\block\Cobweb, pocketmine\block\Ladder, pocketmine\block\LavaCauldron, pocketmine\block\Liquid, pocketmine\block\Magma, pocketmine\block\NetherVines, pocketmine\block\PressurePlate, pocketmine\block\SweetBerryBush, pocketmine\block\Vine, pocketmine\block\WaterCauldron, pocketmine\block\WitherRose, and pocketmine\block\WoodenButton.
Definition at line 854 of file Block.php.
◆ hasSameTypeId()
pocketmine\block\Block::hasSameTypeId |
( |
Block |
$other | ) |
|
|
inherited |
◆ hasTypeTag()
pocketmine\block\Block::hasTypeTag |
( |
string |
$tag | ) |
|
|
inherited |
Returns whether this block type has the given type tag. Type tags are used as a dynamic way to tag blocks as having certain properties, allowing type checks which are more dynamic than hardcoding a bunch of IDs or a bunch of instanceof checks.
For example, grass blocks, dirt, farmland, podzol and mycelium are all dirt-like blocks, and support the placement of blocks like flowers, so they have a common tag which allows them to be identified as such.
Definition at line 212 of file Block.php.
◆ isAffectedBySilkTouch()
pocketmine\block\Block::isAffectedBySilkTouch |
( |
| ) |
|
|
inherited |
Returns whether Silk Touch enchanted tools will cause this block to drop as itself.
Reimplemented in pocketmine\block\AmethystCluster, pocketmine\block\BaseCoral, pocketmine\block\BlueIce, pocketmine\block\Bookshelf, pocketmine\block\CaveVines, pocketmine\block\ChiseledBookshelf, pocketmine\block\Clay, pocketmine\block\CoalOre, pocketmine\block\Cobweb, pocketmine\block\CopperOre, pocketmine\block\CoralBlock, pocketmine\block\DeadBush, pocketmine\block\DiamondOre, pocketmine\block\EmeraldOre, pocketmine\block\EnderChest, pocketmine\block\GildedBlackstone, pocketmine\block\Glass, pocketmine\block\GlassPane, pocketmine\block\Glowstone, pocketmine\block\GoldOre, pocketmine\block\Grass, pocketmine\block\GrassPath, pocketmine\block\Gravel, pocketmine\block\Ice, pocketmine\block\InfestedStone, pocketmine\block\IronOre, pocketmine\block\LapisOre, pocketmine\block\Leaves, pocketmine\block\Melon, pocketmine\block\MushroomStem, pocketmine\block\Mycelium, pocketmine\block\NetherGoldOre, pocketmine\block\NetherQuartzOre, pocketmine\block\NetherVines, pocketmine\block\PackedIce, pocketmine\block\Podzol, pocketmine\block\RedMushroomBlock, pocketmine\block\RedstoneOre, pocketmine\block\Sculk, pocketmine\block\SeaLantern, and pocketmine\block\Snow.
Definition at line 686 of file Block.php.
◆ isFireProofAsItem()
pocketmine\block\Block::isFireProofAsItem |
( |
| ) |
|
|
inherited |
◆ isFlammable()
pocketmine\block\Block::isFlammable |
( |
| ) |
|
|
inherited |
Returns whether this block can catch fire.
Definition at line 752 of file Block.php.
◆ isFullCube()
pocketmine\block\Block::isFullCube |
( |
| ) |
|
|
inherited |
◆ isSameState()
pocketmine\block\Block::isSameState |
( |
Block |
$other | ) |
|
|
inherited |
Returns whether the given block has the same type and properties as this block.
Note: Tile data (e.g. sign text, chest contents) are not compared here.
Definition at line 193 of file Block.php.
◆ isSolid()
pocketmine\block\Opaque::isSolid |
( |
| ) |
|
- Deprecated:
- TL;DR: Don't use this function. Its results are confusing and inconsistent.
No one is sure what the meaning of this property actually is. It's borrowed from Minecraft Java Edition, and is used by various blocks for support checks.
Things like signs and banners are considered "solid" despite having no collision box, and things like skulls and flower pots are considered non-solid despite obviously being "solid" in the conventional, real-world sense.
Reimplemented from pocketmine\block\Block.
Definition at line 32 of file Opaque.php.
◆ isTransparent()
pocketmine\block\Block::isTransparent |
( |
| ) |
|
|
inherited |
◆ onAttack()
pocketmine\block\Block::onAttack |
( |
Item |
$item, |
|
|
int |
$face, |
|
|
?Player |
$player = null |
|
) |
| |
|
inherited |
◆ onBreak()
pocketmine\block\Block::onBreak |
( |
Item |
$item, |
|
|
?Player |
$player = null , |
|
|
array & |
$returnedItems = [] |
|
) |
| |
|
inherited |
◆ onEntityInside()
pocketmine\block\Block::onEntityInside |
( |
Entity |
$entity | ) |
|
|
inherited |
Called when an entity's bounding box clips inside this block's cell. Note that the entity may not be intersecting with the collision box or bounding box.
WARNING: This will not be called if Block::hasEntityCollision()
returns false.
- Returns
- bool Whether the block is still the same after the intersection. If it changed (e.g. due to an explosive being ignited), this should return false.
Reimplemented in pocketmine\block\BaseFire, pocketmine\block\BigDripleafHead, pocketmine\block\Cactus, pocketmine\block\CaveVines, pocketmine\block\Cobweb, pocketmine\block\Ladder, pocketmine\block\Lava, pocketmine\block\LavaCauldron, pocketmine\block\Magma, pocketmine\block\NetherPortal, pocketmine\block\NetherVines, pocketmine\block\PressurePlate, pocketmine\block\SweetBerryBush, pocketmine\block\Vine, pocketmine\block\Water, pocketmine\block\WaterCauldron, and pocketmine\block\WitherRose.
Definition at line 867 of file Block.php.
◆ onEntityLand()
pocketmine\block\Block::onEntityLand |
( |
Entity |
$entity | ) |
|
|
inherited |
◆ onIncinerate()
pocketmine\block\Block::onIncinerate |
( |
| ) |
|
|
inherited |
◆ onInteract()
pocketmine\block\Block::onInteract |
( |
Item |
$item, |
|
|
int |
$face, |
|
|
Vector3 |
$clickVector, |
|
|
?Player |
$player = null , |
|
|
array & |
$returnedItems = [] |
|
) |
| |
|
inherited |
Do actions when interacted by Item. Returns if it has done anything
- Parameters
-
Vector3 | $clickVector | Exact position where the click occurred, relative to the block's integer position |
Item[] | &$returnedItems | Items to be added to the target's inventory (or dropped, if the inventory is full) |
Reimplemented in pocketmine\block\Anvil, pocketmine\block\Bamboo, pocketmine\block\BambooSapling, pocketmine\block\Barrel, pocketmine\block\BaseBigDripleaf, pocketmine\block\BaseCake, pocketmine\block\BaseSign, pocketmine\block\Bed, pocketmine\block\Bell, pocketmine\block\BrewingStand, pocketmine\block\Button, pocketmine\block\Cake, pocketmine\block\CakeWithCandle, pocketmine\block\CartographyTable, pocketmine\block\Cauldron, pocketmine\block\CaveVines, pocketmine\block\ChemistryTable, pocketmine\block\Chest, pocketmine\block\ChiseledBookshelf, pocketmine\block\CocoaBlock, pocketmine\block\CraftingTable, pocketmine\block\Crops, pocketmine\block\DaylightSensor, pocketmine\block\Dirt, pocketmine\block\Door, pocketmine\block\DoublePitcherCrop, pocketmine\block\DragonEgg, pocketmine\block\EnchantingTable, pocketmine\block\EnderChest, pocketmine\block\FenceGate, pocketmine\block\FlowerPot, pocketmine\block\Furnace, pocketmine\block\GlowLichen, pocketmine\block\Grass, pocketmine\block\Hopper, pocketmine\block\ItemFrame, pocketmine\block\Jukebox, pocketmine\block\LavaCauldron, pocketmine\block\Lectern, pocketmine\block\Lever, pocketmine\block\Light, pocketmine\block\Loom, pocketmine\block\NetherVines, pocketmine\block\PinkPetals, pocketmine\block\PitcherCrop, pocketmine\block\PotionCauldron, pocketmine\block\Pumpkin, pocketmine\block\RedstoneComparator, pocketmine\block\RedstoneOre, pocketmine\block\RedstoneRepeater, pocketmine\block\Sapling, pocketmine\block\SeaPickle, pocketmine\block\ShulkerBox, pocketmine\block\SmallDripleaf, pocketmine\block\SmithingTable, pocketmine\block\Stonecutter, pocketmine\block\Sugarcane, pocketmine\block\SweetBerryBush, pocketmine\block\TNT, pocketmine\block\TorchflowerCrop, pocketmine\block\Trapdoor, pocketmine\block\WaterCauldron, and pocketmine\block\Wood.
Definition at line 522 of file Block.php.
◆ onNearbyBlockChange()
pocketmine\block\Block::onNearbyBlockChange |
( |
| ) |
|
|
inherited |
Called when this block or a block immediately adjacent to it changes state.
Reimplemented in pocketmine\block\AmethystCluster, pocketmine\block\BaseBanner, pocketmine\block\BaseBigDripleaf, pocketmine\block\BaseCoral, pocketmine\block\BaseRail, pocketmine\block\BaseSign, pocketmine\block\Bed, pocketmine\block\Bell, pocketmine\block\Button, pocketmine\block\Cauldron, pocketmine\block\CocoaBlock, pocketmine\block\ConcretePowder, pocketmine\block\CoralBlock, pocketmine\block\Door, pocketmine\block\DoublePlant, pocketmine\block\Farmland, pocketmine\block\FenceGate, pocketmine\block\Fire, pocketmine\block\FrostedIce, pocketmine\block\GlowLichen, pocketmine\block\GrassPath, pocketmine\block\ItemFrame, pocketmine\block\Ladder, pocketmine\block\Lantern, pocketmine\block\Leaves, pocketmine\block\Lever, pocketmine\block\Liquid, pocketmine\block\PotionCauldron, pocketmine\block\RedMushroom, pocketmine\block\RedstoneOre, pocketmine\block\SmallDripleaf, pocketmine\block\SoulFire, pocketmine\block\Stem, pocketmine\block\Torch, pocketmine\block\Vine, pocketmine\block\Wall, pocketmine\block\WallCoralFan, and pocketmine\block\WaterCauldron.
Definition at line 490 of file Block.php.
◆ onPostPlace()
pocketmine\block\Block::onPostPlace |
( |
| ) |
|
|
inherited |
◆ onProjectileHit()
◆ onRandomTick()
pocketmine\block\Block::onRandomTick |
( |
| ) |
|
|
inherited |
Called when this block is randomly updated due to chunk ticking. WARNING: This will not be called if Block::ticksRandomly()
does not return true!
Reimplemented in pocketmine\block\Bamboo, pocketmine\block\BambooSapling, pocketmine\block\BuddingAmethyst, pocketmine\block\Cactus, pocketmine\block\CaveVines, pocketmine\block\ChorusFlower, pocketmine\block\CocoaBlock, pocketmine\block\Crops, pocketmine\block\DoublePitcherCrop, pocketmine\block\Farmland, pocketmine\block\Fire, pocketmine\block\FrostedIce, pocketmine\block\Grass, pocketmine\block\Ice, pocketmine\block\Leaves, pocketmine\block\Mycelium, pocketmine\block\NetherVines, pocketmine\block\NetherWartPlant, pocketmine\block\PitcherCrop, pocketmine\block\RedstoneOre, pocketmine\block\Sapling, pocketmine\block\SnowLayer, pocketmine\block\Stem, pocketmine\block\Sugarcane, pocketmine\block\SweetBerryBush, pocketmine\block\TorchflowerCrop, and pocketmine\block\Vine.
Definition at line 505 of file Block.php.
◆ onScheduledUpdate()
pocketmine\block\Block::onScheduledUpdate |
( |
| ) |
|
|
inherited |
Called when this block is updated by the delayed blockupdate scheduler in the world.
Reimplemented in pocketmine\block\BaseCoral, pocketmine\block\BigDripleafHead, pocketmine\block\BrewingStand, pocketmine\block\Button, pocketmine\block\CoralBlock, pocketmine\block\DaylightSensor, pocketmine\block\Fire, pocketmine\block\FrostedIce, pocketmine\block\Furnace, pocketmine\block\Hopper, pocketmine\block\Lectern, pocketmine\block\Liquid, pocketmine\block\MonsterSpawner, and pocketmine\block\PressurePlate.
Definition at line 512 of file Block.php.
◆ place()
Generates a block transaction to set all blocks affected by placing this block. Usually this is just the block itself, but may be multiple blocks in some cases (such as doors).
- Parameters
-
BlockTransaction | $tx | Blocks to be set should be added to this transaction (do not modify thr world directly) |
Item | $item | Item used to place the block |
Block | $blockReplace | Block expected to be replaced |
Block | $blockClicked | Block that was clicked using the item |
int | $face | Face of the clicked block which was clicked |
Vector3 | $clickVector | Exact position inside the clicked block where the click occurred, relative to the block's position |
Player | null | $player | Player who placed the block, or null if it was not a player |
- Returns
- bool whether the placement should go ahead
Reimplemented in pocketmine\block\AmethystCluster, pocketmine\block\Anvil, pocketmine\block\Barrel, pocketmine\block\BaseBanner, pocketmine\block\BaseBigDripleaf, pocketmine\block\BaseRail, pocketmine\block\BaseSign, pocketmine\block\Bed, pocketmine\block\Bell, pocketmine\block\Button, pocketmine\block\Candle, pocketmine\block\CaveVines, pocketmine\block\CocoaBlock, pocketmine\block\Door, pocketmine\block\DoublePlant, pocketmine\block\EndRod, pocketmine\block\FenceGate, pocketmine\block\FloorBanner, pocketmine\block\FloorCoralFan, pocketmine\block\FloorSign, pocketmine\block\GlowLichen, pocketmine\block\Hopper, pocketmine\block\ItemFrame, pocketmine\block\Ladder, pocketmine\block\Lantern, pocketmine\block\Leaves, pocketmine\block\Lever, pocketmine\block\LightningRod, pocketmine\block\MobHead, pocketmine\block\NetherVines, pocketmine\block\PinkPetals, pocketmine\block\RedMushroom, pocketmine\block\RedstoneComparator, pocketmine\block\RedstoneRepeater, pocketmine\block\SeaPickle, pocketmine\block\ShulkerBox, pocketmine\block\Slab, pocketmine\block\SmallDripleaf, pocketmine\block\SnowLayer, pocketmine\block\Stair, pocketmine\block\Sugarcane, pocketmine\block\Torch, pocketmine\block\Trapdoor, pocketmine\block\TripwireHook, pocketmine\block\Vine, pocketmine\block\WallBanner, pocketmine\block\WallCoralFan, and pocketmine\block\WallSign.
Definition at line 440 of file Block.php.
◆ position()
pocketmine\block\Block::position |
( |
World |
$world, |
|
|
int |
$x, |
|
|
int |
$y, |
|
|
int |
$z |
|
) |
| |
|
finalinherited |
◆ readStateFromWorld()
pocketmine\block\Block::readStateFromWorld |
( |
| ) |
|
|
inherited |
Called when this block is created, set, or has a neighbouring block update, to re-detect dynamic properties which are not saved in the blockstate ID. If any such properties are updated, don't forget to clear things like AABB caches if necessary.
A replacement block may be returned. This is useful if the block type changed due to reading of world data (e.g. data from a block entity).
Reimplemented in pocketmine\block\BaseBanner, pocketmine\block\BaseSign, pocketmine\block\Bed, pocketmine\block\Door, pocketmine\block\Fence, pocketmine\block\FlowerPot, pocketmine\block\ItemFrame, pocketmine\block\Jukebox, pocketmine\block\Lectern, pocketmine\block\Liquid, pocketmine\block\MobHead, pocketmine\block\Note, pocketmine\block\PotionCauldron, pocketmine\block\RedstoneComparator, pocketmine\block\RedstoneWire, pocketmine\block\ShulkerBox, pocketmine\block\Stair, pocketmine\block\Thin, and pocketmine\block\WaterCauldron.
Definition at line 366 of file Block.php.
◆ recalculateCollisionBoxes()
pocketmine\block\Block::recalculateCollisionBoxes |
( |
| ) |
|
|
protectedinherited |
- Returns
- AxisAlignedBB[]
Reimplemented in pocketmine\block\AmethystCluster, pocketmine\block\Anvil, pocketmine\block\Bamboo, pocketmine\block\BaseBanner, pocketmine\block\BaseCoral, pocketmine\block\BaseSign, pocketmine\block\Bed, pocketmine\block\Bell, pocketmine\block\BigDripleafHead, pocketmine\block\BigDripleafStem, pocketmine\block\BrewingStand, pocketmine\block\Cactus, pocketmine\block\Cake, pocketmine\block\CakeWithCandle, pocketmine\block\Candle, pocketmine\block\Carpet, pocketmine\block\Cauldron, pocketmine\block\CaveVines, pocketmine\block\Chain, pocketmine\block\Chest, pocketmine\block\ChorusFlower, pocketmine\block\ChorusPlant, pocketmine\block\CocoaBlock, pocketmine\block\DaylightSensor, pocketmine\block\Door, pocketmine\block\DoublePitcherCrop, pocketmine\block\EnchantingTable, pocketmine\block\EnderChest, pocketmine\block\EndPortalFrame, pocketmine\block\EndRod, pocketmine\block\Farmland, pocketmine\block\Fence, pocketmine\block\FenceGate, pocketmine\block\FillableCauldron, pocketmine\block\Flowable, pocketmine\block\FlowerPot, pocketmine\block\GlowLichen, pocketmine\block\GrassPath, pocketmine\block\Hopper, pocketmine\block\Ladder, pocketmine\block\Lantern, pocketmine\block\Lectern, pocketmine\block\LightningRod, pocketmine\block\Liquid, pocketmine\block\MobHead, pocketmine\block\NetherPortal, pocketmine\block\NetherVines, pocketmine\block\PitcherCrop, pocketmine\block\PressurePlate, pocketmine\block\RedstoneComparator, pocketmine\block\RedstoneRepeater, pocketmine\block\SeaPickle, pocketmine\block\Slab, pocketmine\block\SmallDripleaf, pocketmine\block\SnowLayer, pocketmine\block\SoulSand, pocketmine\block\Stair, pocketmine\block\Stonecutter, pocketmine\block\Thin, pocketmine\block\Trapdoor, pocketmine\block\Vine, pocketmine\block\Wall, and pocketmine\block\WaterLily.
Definition at line 933 of file Block.php.
◆ ticksRandomly()
pocketmine\block\Block::ticksRandomly |
( |
| ) |
|
|
inherited |
Returns whether random block updates will be done on this block.
Reimplemented in pocketmine\block\Bamboo, pocketmine\block\BambooSapling, pocketmine\block\BuddingAmethyst, pocketmine\block\Cactus, pocketmine\block\CaveVines, pocketmine\block\ChorusFlower, pocketmine\block\CocoaBlock, pocketmine\block\Crops, pocketmine\block\DoublePitcherCrop, pocketmine\block\Farmland, pocketmine\block\Fire, pocketmine\block\Grass, pocketmine\block\Ice, pocketmine\block\Leaves, pocketmine\block\Mycelium, pocketmine\block\NetherVines, pocketmine\block\NetherWartPlant, pocketmine\block\PitcherCrop, pocketmine\block\RedMushroom, pocketmine\block\RedstoneOre, pocketmine\block\Sapling, pocketmine\block\SnowLayer, pocketmine\block\Stem, pocketmine\block\Sugarcane, pocketmine\block\SweetBerryBush, pocketmine\block\TorchflowerCrop, and pocketmine\block\Vine.
Definition at line 497 of file Block.php.
◆ writeStateToWorld()
pocketmine\block\Block::writeStateToWorld |
( |
| ) |
|
|
inherited |
Writes information about the block into the world. This writes the blockstate ID into the chunk, and creates and/or removes tiles as necessary.
Note: Do not call this directly. Pass the block to World::setBlock()
instead.
Reimplemented in pocketmine\block\BaseBanner, pocketmine\block\BaseSign, pocketmine\block\Bed, pocketmine\block\Cauldron, pocketmine\block\FlowerPot, pocketmine\block\ItemFrame, pocketmine\block\Jukebox, pocketmine\block\LavaCauldron, pocketmine\block\Lectern, pocketmine\block\MobHead, pocketmine\block\Note, pocketmine\block\PotionCauldron, pocketmine\block\RedstoneComparator, pocketmine\block\ShulkerBox, and pocketmine\block\WaterCauldron.
Definition at line 376 of file Block.php.
◆ $collisionBoxes
array pocketmine\block\Block::$collisionBoxes = null |
|
protectedinherited |
◆ $fallbackName
string pocketmine\block\Block::$fallbackName |
|
protectedinherited |
◆ $idInfo
◆ $position
Position pocketmine\block\Block::$position |
|
protectedinherited |
◆ $typeInfo
◆ EMPTY_STATE_ID
const pocketmine\block\Block::EMPTY_STATE_ID = (BlockTypeIds::AIR << self::INTERNAL_STATE_DATA_BITS) | (-7482769108513497636 & self::INTERNAL_STATE_DATA_MASK) |
|
inherited |
◆ INTERNAL_STATE_DATA_BITS
const pocketmine\block\Block::INTERNAL_STATE_DATA_BITS = 11 |
|
inherited |
◆ INTERNAL_STATE_DATA_MASK
const pocketmine\block\Block::INTERNAL_STATE_DATA_MASK = ~(~0 << self::INTERNAL_STATE_DATA_BITS) |
|
inherited |
The documentation for this class was generated from the following file: