Skip to content

ItemFrame ​

class · pocketmine\block\ItemFrame · source

Extends Flowable
Implements AnyFacing

Constants ​

ROTATIONS ​

php
public const ROTATIONS = 8

Properties ​

$framedItem protected ​

php
protected ?\pocketmine\item\Item $framedItem

$hasMap protected ​

php
protected bool $hasMap

$itemDropChance protected ​

php
protected float $itemDropChance

$itemRotation protected ​

php
protected int $itemRotation

Methods ​

describeBlockOnlyState() protected ​

php
protected function describeBlockOnlyState(\pocketmine\data\runtime\RuntimeDataDescriber $w) : void

getDropsForCompatibleTool() ​

php
public function getDropsForCompatibleTool(\pocketmine\item\Item $item) : array

getFramedItem() ​

php
public function getFramedItem() : ?\pocketmine\item\Item

getItemDropChance() ​

php
public function getItemDropChance() : float

getItemRotation() ​

php
public function getItemRotation() : int

getPickedItem() ​

php
public function getPickedItem(bool $addUserData = false) : \pocketmine\item\Item

hasMap() ​

php
public function hasMap() : bool

onAttack() ​

php
public function onAttack(\pocketmine\item\Item $item, int $face, ?\pocketmine\player\Player $player = null) : bool

onInteract() ​

php
public function onInteract(\pocketmine\item\Item $item, int $face, \pocketmine\math\Vector3 $clickVector, ?\pocketmine\player\Player $player = null, array &$returnedItems = []) : bool

onNearbyBlockChange() ​

php
public function onNearbyBlockChange() : void

place() ​

php
public function place(\pocketmine\world\BlockTransaction $tx, \pocketmine\item\Item $item, \pocketmine\block\Block $blockReplace, \pocketmine\block\Block $blockClicked, int $face, \pocketmine\math\Vector3 $clickVector, ?\pocketmine\player\Player $player = null) : bool

readStateFromWorld() ​

php
public function readStateFromWorld() : \pocketmine\block\Block

setFramedItem() ​

php
public function setFramedItem(?\pocketmine\item\Item $item) : self

setHasMap() ​

php
public function setHasMap(bool $hasMap) : self

This can be set irrespective of whether the frame actually contains a map or not. When set, the frame stretches to the edges of the block without leaving space around the edges.

setItemDropChance() ​

php
public function setItemDropChance(float $itemDropChance) : self

setItemRotation() ​

php
public function setItemRotation(int $itemRotation) : self

writeStateToWorld() ​

php
public function writeStateToWorld() : void

VanillaMine is a fork of PocketMine-MP, maintained by Luxury Nodes. Not affiliated with the PMMP team or Mojang.