How can i let players tap a sign and give them the prefix in the sign? i use tap to do. i just want them to have the prefix listed on the sign which is (Citizen). How can i set this command without giving them permission to /setprefix?
Use the PlayerInteractEvent. If the player taps a sign that is made by a OP and it contains some certain words it will execute a command sent by the console. Ex: [Prefix] Test If the sign contains that and that sign is made by a OP it will give you the rank. InteractEvent example: PHP: public function signTapPrefix(PlayerInteractEvent $event): void{ $jugador = $event->getPlayer(); $tile = $event->getBlock()->getLevel()->getTile(new Vector3($event->getBlock()->getFloorX(), $event->getBlock()->getFloorY(), $event->getBlock()->getFloorZ())); if($tile instanceof Sign){ if(TextFormat::clean($tile->getText()[0], true) === "[PREFIX]"//otherwise you can set whatever text you want){ $event->setCancelled(true); if(($tile->getText()[1]) === "Test"){ // do the ConsoleCommand stuff here and give the player that prefix } } } } Make that only OP can make that sign: PHP: public function onBlockPlace(BlockPlaceEvent $event): void{ $player = $event->getPlayer(); $tile = $event->getBlock()->getLevel()->getTile(new Vector3($event->getBlock()->getFloorX(), $event->getBlock()->getFloorY(), $event->getBlock()->getFloorZ())); if($tile instanceof Sign){ if(TextFormat::clean($tile->getText()[0], true) === "[PREFIX]" //it has to be same as the set in the Event){ if(!$player->hasPermission("prefix.sign.set" //set whatever perm you want)){ $player->sendMessage("You don't have permission"); return; } } } } I hope that this helped. If you have any other questions you can ask me.
Hello! could you give your discord tag so we can talk there? i'm having some problems on some stuffs.. thanks!