Block drop change example

Discussion in 'Development' started by FloGamerMC, Feb 8, 2020.

  1. FloGamerMC

    FloGamerMC Creeper

    Messages:
    5
    GitHub:
    FloGamerMC
    Can somebody give me a example how to change the block drop please.
     
    Last edited: Feb 8, 2020
  2. Invy55

    Invy55 Creeper

    Messages:
    2
    GitHub:
    invy55
    Try detecting a BlockBreakEvent and then setting drop with $event->setDrops.
    Check here for more informations.
     
  3. FloGamerMC

    FloGamerMC Creeper

    Messages:
    5
    GitHub:
    FloGamerMC
    Thanks but can you give me a example please
     
  4. Asanino

    Asanino Spider

    Messages:
    11
    PHP:
    public function onBreak(BlockBreakEvent $e){

    $block $e->getBlock();

    if(
    $block->getID() === WishBlockID){
    $event->setDrops(array(WishDrops));

    }


    More info here
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.