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

Constant of block "Blue wool"? For event.

Comments in 'Plugin Development' started by Valeron, Nov 11, 2015.

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

    Valeron New Member

    Joined:
    Aug 26, 2015
    Posts:
    111
    Minecraft User:
    DarkSpive
    public function onBlockBreakRed(BlockBreakEvent $event){
    if($event->getBlock()->getId() == 35){

    How to use meta of id35 in code?
    I gonna add blue wool.
    I add yet conversation because nobody wants answer
  2. Kvetinac97
    Offline

    Kvetinac97 Active Member Plugin Developer

    Joined:
    Nov 17, 2014
    Posts:
    276
    Plugins:
    1
    Minecraft User:
    Kvetinac97
    PHP:
    if ($ev->getItem() === Item::get(Item::WOOL,$meta,$cnt)){
    where Item is an item instance. If you don't need to check count, use this
    PHP:
    if ($ev->getItem()->getId() == Item::WOOL and $ev->getItem()->getDamage() == $damage){
    + please DON'T repeat threads.
    Valeron and Taha_The_Hacker like this.
Thread Status:
Not open for further replies.

Share This Page

Advertisement