22declare(strict_types=1);
24namespace pocketmine\world\particle;
45 protected ?
int $entityId =
null;
46 protected bool $invisible =
false;
48 public function __construct(
49 protected string $text,
50 protected string $title =
""
53 public function getText() :
string{
57 public function setText(
string $text) :
void{
61 public function getTitle() :
string{
65 public function setTitle(
string $title) :
void{
66 $this->title = $title;
69 public function isInvisible() :
bool{
70 return $this->invisible;
73 public function setInvisible(
bool $value =
true) :
void{
74 $this->invisible = $value;
80 if($this->entityId ===
null){
86 if(!$this->invisible){
87 $name = $this->title . ($this->text !==
"" ?
"\n" . $this->text :
"");
90 1 << EntityMetadataFlags::NO_AI
93 EntityMetadataProperties::FLAGS =>
new LongMetadataProperty($actorFlags),
94 EntityMetadataProperties::SCALE =>
new FloatMetadataProperty(0.01),
95 EntityMetadataProperties::BOUNDING_BOX_WIDTH =>
new FloatMetadataProperty(0.0),
96 EntityMetadataProperties::BOUNDING_BOX_HEIGHT =>
new FloatMetadataProperty(0.0),
97 EntityMetadataProperties::NAMETAG =>
new StringMetadataProperty($name),
98 EntityMetadataProperties::VARIANT =>
new IntMetadataProperty(TypeConverter::getInstance()->getBlockTranslator()->internalIdToNetworkId(VanillaBlocks::AIR()->getStateId())),
99 EntityMetadataProperties::ALWAYS_SHOW_NAMETAG =>
new ByteMetadataProperty(1),
104 EntityIds::FALLING_BLOCK,
113 new PropertySyncData([], []),
static create(int $actorUniqueId, int $actorRuntimeId, string $type, Vector3 $position, ?Vector3 $motion, float $pitch, float $yaw, float $headYaw, float $bodyYaw, array $attributes, array $metadata, PropertySyncData $syncedProperties, array $links,)
static create(int $actorUniqueId)