Hello, my code to remove entites do not work CODE: PHP: public function removeKADefender($player){ $this->getServer()->removeEntities(); }}}
And you don't try to verify it yourself when it is not working? How many times I've been saying, code is not like items you just put into your inventory to use it. It is like wands in Harry Potter; you have to do something to use someone else's code... So far you have just been telling us it "do not work" but no elaboration. Ever read the README of this forum? And I wonder where exactly is that ClearLag plugin you found that uses that nonexistent method? What you need to know is just that that method doesn't exist.
here: https://github.com/LegendOfMCPE/ClearLagg/blob/master/src/ClearLagg/ClearLaggCommand.php look to line 30
Although I think all hope is lost here is some explanation: $this->getPlugin() is referring to a method that returns the Plugin Main object. That contains the method removeEntities(). Why do you expect the Server object to magically have that function?
Because getPlugin() is defined by ClearLagg. Mind reading? You have successfully inspired me to create this forum. Great contribution. https://forums.pmmp.io/forums/dev-facepalm/
This thread is not even about removing all entities. It is just about how to properly copy code from another plugin, which is totally not constructive to plugin development. Moved to forum.
Sorry, but you should learn OOP, general programming, and PHP first and then come back. Please note that that is not a task that can be done in a few hours.