1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Solved Snowball breaks block

Discussion in 'Plugin Help' started by Sowgro, Aug 6, 2020.

  1. Sowgro

    Sowgro Creeper

    Messages:
    4
    Does anyone know how I could make a plugin do this?
     
  2. Zdhea

    Zdhea Spider

    Messages:
    13
    yea
    PHP:
    public function onHit(ProjectileHitBlockEvent $event){
            
    $en $event->getEntity();
            
    $block $event->getBlockHit();
             if(
    $en instanceof Snowball){
                 
    $x $block->getX();
                 
    $y $block->getY();
                 
    $z $block->getZ();

                
    $en->getLevel()->setBlock(new Vector3($x,$y,$z),Block::get(0));
             }
        }
     
  3. Sowgro

    Sowgro Creeper

    Messages:
    4
    Thank you I appreciate it
     
  4. GodWeedZao

    GodWeedZao Zombie Pigman

    Messages:
    401
    GitHub:
    godweedzao
    it isnt breaking blocks, its setting block to air.
     
  5. Primus

    Primus Zombie Pigman

    Messages:
    749
    Where's the difference?
     
    Diduhless and minijaham like this.
  6. GodWeedZao

    GodWeedZao Zombie Pigman

    Messages:
    401
    GitHub:
    godweedzao
    i dont know what do you mean by Wheres the diffrence, really you dont know diffrence between breaking blocks, set block in minecraft!? dont replay for these mockery sentences.
     
  7. Taco

    Taco Spider Jockey

    Messages:
    41
    GitHub:
    taconoburrito
    picky picky picky
     
  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.