back to the title's point. all you have todo to make $sender global(class properties) is PHP: $this->sender = $sender; if you want you can add PHP: public $sender; right under the class part where you extend PluginBase. example because am nice PHP: <?phpnamespace name\space;use pocketmine\plugin\PluginBase;class YourClass extends PluginBase{public $sender; # ;Ppublic function onEnable(){}}
How many times do I have to say that... Class properties are not global. If something is global, it is always the same wherever you reference it from. In this case, it's only stored in this instance, so if you have another instance e.g. if server is reloaded, it is no longer stored.