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

What's wrong?

Comments in 'Plugin Development' started by KubixQ, Jan 17, 2016.

Thread Status:
Not open for further replies.
  1. KubixQ
    Offline

    KubixQ Active Member

    Joined:
    Sep 13, 2015
    Posts:
    85
    Minecraft User:
    KubixQ
    PHP:
    public function onBlockPlace (BlockPlaceEvent $e){

    if(
    $event->getBlock()->getID() == "121")
    //Write later..
        
    }

    }
    What's bad?
    (Crash is in the #4 line ( } )
  2. Lambo
    Offline

    Lambo Notable Member Plugin Developer

    Joined:
    Sep 14, 2013
    Posts:
    431
    Plugins:
    4
    Minecraft User:
    Lambo
    Last edited: Jan 17, 2016
    PEMapModder likes this.
  3. Vaivez66
    Offline

    Vaivez66 Notable Member Plugin Developer

    Joined:
    Jun 10, 2015
    Posts:
    402
    Plugins:
    2
    PEMapModder and Lambo like this.
  4. KubixQ
    Offline

    KubixQ Active Member

    Joined:
    Sep 13, 2015
    Posts:
    85
    Minecraft User:
    KubixQ
    I actually have that:
    PHP:
    public function onBlockPlace (BlockPlaceEvent $e){

    if(
    $event->getBlock()->getId() == "121")
    //Write later..
        
    }

    }
    What's bad?
  5. Vaivez66
    Offline

    Vaivez66 Notable Member Plugin Developer

    Joined:
    Jun 10, 2015
    Posts:
    402
    Plugins:
    2
    Remove "" in your number, it's Integer
  6. CookieSteve
    Offline

    CookieSteve Active Member

    Joined:
    Apr 22, 2014
    Posts:
    132
    Minecraft User:
    iStrqfeChris
    PHP:
    public function onBlockPlace (BlockPlaceEvent $e){

    if(
    $event->getBlock()->getID() == "121")
    {
    //Write later..
        
    }

    }
    I believe this should Work
    KubixQ likes this.
  7. KubixQ
    Offline

    KubixQ Active Member

    Joined:
    Sep 13, 2015
    Posts:
    85
    Minecraft User:
    KubixQ
    Yep, thanks.
  8. Vaivez66
    Offline

    Vaivez66 Notable Member Plugin Developer

    Joined:
    Jun 10, 2015
    Posts:
    402
    Plugins:
    2
    I didn't notice that you forgot "{" in your code :D
  9. CraftYourBukkit
    Offline

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
    PHP:
    public function onBlockPlace (BlockPlaceEvent $e){

    if(
    $event->getBlock()->getID() === 121)
    {
    //Write later..
        
    }

    }
    Even better:3
Thread Status:
Not open for further replies.

Share This Page

Advertisement