PHP: <?phpnamespace georgianYT;use pocketmine\plugin\PluginBase;use pocketmine\scheduler\PluginTask;use pocketmine\event\Listener;use pocketmine\entity\Effect;use pocketmine\event\entity\EntityTeleportEvent;use pocketmine\event\player\PlayerInteractEvent;use pocketmine\command\CommandSender;use pocketmine\command\Command;use pocketmine\event\entity\EntityDamageEvent;use pocketmine\event\entity\EntityDamageByEntityEvent;use pocketmine\event\inventory\InventoryTransactionEvent;use pocketmine\event\inventory\InventoryPickupArrowEvent;use pocketmine\event\player\PlayerItemHeldEvent;use pocketmine\Player;use pocketmine\Server;use pocketmine\utils\TextFormat as TF;use pocketmine\item\Item;use pocketmine\network\protocol\AddPlayerPacket;use pocketmine\network\protocol\AddEntityPacket;use pocketmine\network\protocol\RemovePlayerPacket;use pocketmine\network\protocol\RemoveEntityPacket;use pocketmine\utils\UUID;use pocketmine\entity\Entity;use pocketmine\event\player\PlayerCommandPreprocessEvent;use pocketmine\inventory\PlayerInventory;class Main extends PluginBase implements Listener{ public function onEnable(){ $this->getServer()->getPluginManager()->registerEvents($this, $this); } public function onItemHeld(PlayerItemHeldEvent $event){ if($event->getItem()->getId() == 352){ $event->getPlayer()->sendPopup("§cRedSword"); } } public function onEntityDamageByEntity(EntityDamageEvent $event){ if ($event instanceof EntityDamageByEntityEvent) { $entity = $event->getEntity(); $player = $event->getDamager(); if ($entity instanceof Player and $player instanceof Player) { $item = $player->getInventory()->getItemInHand()->getID(); $rand= rand(1, 10); if ($item == 352) { $event->setDamage(16.0); } } } }}
You should use code blocks (in the little plus icon on the formatting bar) for PHP, or people won't bother to read it.
If you are not patient enough to wait for another person's help, feel free to look at the helpful changelog that dktapps spent his time on writing: https://github.com/pmmp/PocketMine-MP/releases and correct it yourself. If you are not capable of doing that, then be patient and wait for someone to help you.
To get a quick reply it's always best to post as much information as possible ... What errors do you see? Which version of PMMP Pocketmine are you using?
It would be helpful if we knew the version of PocketMine-MP you are running on. You might have missed it in @Awzaw 's post. Hopefully, this will catch your eye. Code: ~~ MANDATORY ~~ > PLEASE SUPPLY YOUR POCKETMINE-MP VERSION. > SIMPLY RUN `/VERSION` IN CONSOLE AND PROVIDE THE OUTPUT. > IF NOT PROVIDED, WE CANNOT MAKE THE APPROPRIATE CHANGES > FOR THE VERSION YOU ARE ON. ~~ MANDATORY ~~ If you require this in another language, simply head over to https://translate.google.com/ and select your desired language of translation. - Aericio, Founder of PleaseRead Inc. PleaseRead Inc. is a non-profit corporation that specializes in providing courtesy services, free of charge, in order to help people, like you, read. It is our mission to educate as many people as possible to efficiently read text and stop wasting people's times by providing the necessary information required. While PleaseRead Inc. is a free-of-charge service, courtesy of Aericio, we welcome donations to our company via our Patreon Link. We are also looking for extra volunteer staff for our company. If you are interested, please email me at aericio@***.com and we will send you an application form. (psst, this is a joke. patreon goes to pmmp.)
To quota a wise person, "last" is not a version... and I didn't ask for a description of the errors, I asked to see the actual errors; to get help you'll need to put in a little effort yourself too: copy/paste the PocketMine-MP version you get when starting the server, and the errors from console - into nice spoliers/code blocks.