Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

What happened to player block break/place events?

Comments in 'Plugin Development' started by Andrey Nazarchuk, May 14, 2015.

  1. Andrey Nazarchuk
    Offline

    Andrey Nazarchuk Active Member

    Joined:
    Dec 30, 2013
    Posts:
    332
    Minecraft User:
    digita1eclipse
    Hello (again, sorry :p:oops:)

    Aparently,
    Code:
    event\player\BlockBreakEvent
    event\player\BlockPlaceEvent
    
    What should I use instead of these events? I need to protect my lobby...
    Thanks!
  2. TigerHix
    Offline

    TigerHix Active Member

    Joined:
    May 11, 2015
    Posts:
    61
    Minecraft User:
    TigerHix
    Don't understand the question.. o_O
    Andrey Nazarchuk likes this.
  3. Andrey Nazarchuk
    Offline

    Andrey Nazarchuk Active Member

    Joined:
    Dec 30, 2013
    Posts:
    332
    Minecraft User:
    digita1eclipse
    event\player\BlockBreakEvent
    and
    event\player\BlockPlaceEvent
    do not work anymore, what can I use instead of them?
  4. TigerHix
    Offline

    TigerHix Active Member

    Joined:
    May 11, 2015
    Posts:
    61
    Minecraft User:
    TigerHix
    They should work fine. Did you register your events? Please show us the code.
  5. Andrey Nazarchuk
    Offline

    Andrey Nazarchuk Active Member

    Joined:
    Dec 30, 2013
    Posts:
    332
    Minecraft User:
    digita1eclipse
    Code:
    use pocketmine\event\player\BlockBreakEvent;
    use pocketmine\event\player\BlockPlaceEvent;
    
    I looked on docs.pocketmine.net, and these events are gone!
    What am I supposed to use instead of them?
  6. Andrey Nazarchuk
    Offline

    Andrey Nazarchuk Active Member

    Joined:
    Dec 30, 2013
    Posts:
    332
    Minecraft User:
    digita1eclipse
    Code:
    16:18:01 [CRITICAL] ReflectionException: "Class pocketmine\event\player\BlockBreakEvent does not exist" (EXCEPTION) in "/src/pocketmine/plugin/PluginManager" at line 721
    16:18:01 [DEBUG] #0 /SkyWarsPE/src/SkyWarsPE/Main(70): pocketmine\plugin\PluginManager->registerEvents(SkyWarsPE\Main object, SkyWarsPE\Main object)
    16:18:01 [DEBUG] #1 /src/pocketmine/plugin/PluginBase(86): SkyWarsPE\Main->onEnable()
    16:18:01 [DEBUG] #2 /DevTools_v1.10.0.phar/src/FolderPluginLoader/FolderPluginLoader(125): pocketmine\plugin\PluginBase->setEnabled(boolean 1)
    16:18:01 [DEBUG] #3 /src/pocketmine/plugin/PluginManager(559): FolderPluginLoader\FolderPluginLoader->enablePlugin(SkyWarsPE\Main object)
    16:18:01 [DEBUG] #4 /src/pocketmine/Server(1884): pocketmine\plugin\PluginManager->enablePlugin(SkyWarsPE\Main object)
    16:18:01 [DEBUG] #5 /src/pocketmine/Server(1870): pocketmine\Server->enablePlugin(SkyWarsPE\Main object)
    16:18:01 [DEBUG] #6 /src/pocketmine/Server(1746): pocketmine\Server->enablePlugins(integer 1)
    16:18:01 [DEBUG] #7 /src/pocketmine/PocketMine(463): pocketmine\Server->__construct(pocketmine\CompatibleClassLoader object, pocketmine\utils\MainLogger object, string phar://C:/Users/Andrey/Downloads/PocketMine-MP/PocketMine-MP.phar/, string C:\Users\Andrey\Downloads\PocketMine-MP\, string C:\Users\Andrey\Downloads\PocketMine-MP\plugins\)
    16:18:01 [DEBUG] #8 (1): require(string phar://C:/Users/Andrey/Downloads/PocketMine-MP/PocketMine-MP.phar/src/pocketmine/PocketMine.php)
    
  7. xiaoq
    Offline

    xiaoq Active Member

    Joined:
    Dec 23, 2014
    Posts:
    232
    Minecraft User:
    xiaoq
    PEMapModder, LDX and Andrey Nazarchuk like this.
  8. Andrey Nazarchuk
    Offline

    Andrey Nazarchuk Active Member

    Joined:
    Dec 30, 2013
    Posts:
    332
    Minecraft User:
    digita1eclipse
  9. TigerHix
    Offline

    TigerHix Active Member

    Joined:
    May 11, 2015
    Posts:
    61
    Minecraft User:
    TigerHix
    Block events are under the block folder :p

    Use pocketmine\event\block\BlockBreakEvent and pocketmine\event\block\BlockPlaceEvent instead.

    EDIT: Oops.. Ninja'd by @xiaoq
    PEMapModder, Falk, LDX and 1 other person like this.
  10. Andrey Nazarchuk
    Offline

    Andrey Nazarchuk Active Member

    Joined:
    Dec 30, 2013
    Posts:
    332
    Minecraft User:
    digita1eclipse
    Thanks!
    TigerHix likes this.
  11. TigerHix
    Offline

    TigerHix Active Member

    Joined:
    May 11, 2015
    Posts:
    61
    Minecraft User:
    TigerHix
    No other code needs to be changed. You were just having incorrect use statements. ;)
    Andrey Nazarchuk likes this.
  12. Andrey Nazarchuk
    Offline

    Andrey Nazarchuk Active Member

    Joined:
    Dec 30, 2013
    Posts:
    332
    Minecraft User:
    digita1eclipse

Share This Page

Advertisement