Or do i have to spawn an invisible tile behind it to detect it? (I do have direct access to the FTP object and to its coordinates) And if so, how to spawn an invisible sign/tile?
No, FTPs cant be clicked thats why you need to do it with a block, but I am recommending you to do it with the PlayerInteract method, check on the event not the block, check the positon and yaw of the player, as example when the player's x is less than the FTPs x and his z is less than FTPs z then his Yaw needs to be between 0 and 90.
Clicking And @MyNameIsTriXz thats much too complicated If i could spawn an invisble sign, it would be perfect!
FloatingTextParticle is an entity with a nametag. From the very beginning, you can only click (some) entities, not the nametag. Why don't you just detect if the player bounding box collides with the nametag?
Would spawning an invisible falling sand block work for you? If you just want it to run commands when you tap it you can make a Slapper falling sand entity then set its blockId to 0 using /slapper edit <id> blockid 0
Spawn an NBT entity, like jojoe77777 said, I am recommending you to use a falling sand block, and then just dont do $entity->spawnToAll(); , then you have an invisible entity
Ok, I will copy some of your code in my ServerCore... Am I allowed to do that (OffTopic: Oh no i'm starting to make classes, i hate me)
No. I meant "walking into". That is, if the player's body bounding box intersects with your text's bounding box. As for the size of the bounding box, you have to calculate it yourself.
Sure. Please don't post an answer until you have tested it. If you don't spawn the entity to the client, they won't know that it exists, so they can't interact with it.
I am almost finished, I gonna release an SUPER-advanced FTP plugin soon (No level issues, clickable FTPs)
Spoiler Code: PHP: <?php//THIS CLASS IS ALMOST COMPLETLY TAKEN FROM SLAPPER!namespace robske_110\ServerCore;use pocketmine\network\protocol\AddEntityPacket;use pocketmine\network\Network;use pocketmine\Player;use pocketmine\entity\Entity;use pocketmine\nbt\tag\Byte;use pocketmine\nbt\tag\Compound;use pocketmine\nbt\tag\Double;use pocketmine\nbt\tag\Enum;use pocketmine\nbt\tag\Float;use pocketmine\nbt\tag\Int;use pocketmine\nbt\tag\Short;use pocketmine\nbt\tag\String;class SlapperFallingSand extends Entity implements ServerCoreEntity{ const NETWORK_ID = 66; public function getName() { return $this->getDataProperty(2); } public function spawnTo(Player $player) { $pk = new AddEntityPacket(); $pk->eid = $this->getId(); $pk->type = self::NETWORK_ID; $pk->x = $this->x; $pk->y = $this->y; $pk->z = $this->z; $pk->yaw = $this->yaw; $pk->pitch = $this->pitch; $pk->metadata = [ 2 => [4, "WTF"], 3 => [0, $this->getDataProperty(3)], 15 => [0, 1] ]; if (isset($this->namedtag->BlockID)) { $pk->metadata[20] = [2, $this->namedtag->BlockID->getValue()]; } else { $pk->metadata[20] = [2, 1]; } $player->dataPacket($pk); parent::spawnTo($player); }}interface ServerCoreEntity{}class FallingSand extends Main{ protected $Entity; protected $AssignedFTPuniqueID; public function __construct($AssignedFTPuniqueID, $level, $coordX, $coordY, $coordZ) { $nbt = $this->makeNBT(0, 0, $coordX, $coordY, $coordZ, $AssignedFTPuniqueID); $slapperEntity = Entity::createEntity("SlapperFallingSand", $this->getServer()->getLevelByName($level)->getChunk($coordX >> 4, $coordZ >> 4), $nbt); $slapperEntity->spawnToAll(); $this->Entity = $slapperEntity; $this->AssignedFTPuniqueID = $AssignedFTPuniqueID; } public function kill(){ $this->Entity->kill(); } private function makeNBT($yaw, $pitch, $x, $y, $z, $AssignedFTPuniqueID) { $nbt = new Compound; $nbt->Pos = new Enum("Pos", [ new Double("", $x), new Double("", $y), new Double("", $z) ]); $nbt->Rotation = new Enum("Rotation", [ new Float("", $yaw), new Float("", $pitch) ]); $nbt->Health = new Short("Health", 1); $nbt->Invulnerable = new Byte("Invulnerable", 1); $nbt->AssignedFTP = new Int("AssignedFTP", $AssignedFTPuniqueID); $nbt->RealServerCoreEnt = new String("RealServerCoreEnt", "RealyAnServerCoreEnt"); $nbt->BlockID = new Int("BlockID", 0); #FallingSand Block ID $nbt->CustomNameVisible = new Byte("CustomNameVisible", 0); return $nbt; }} What I've done so far
Use constant references rather than the constant values. In this way, even if the value changes in MCPE's side, you don't ohave to update the plugin.
Tell that @jojoe77777 he is the owner of the SlapperFallingSand class, however i will update it for me