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

Solved Spawn fake explosion (no damage, no block breaking)

Comments in 'Plugin Development' started by thebigsmileXD, Dec 29, 2015.

  1. thebigsmileXD
    Offline

    thebigsmileXD Banned

    Joined:
    May 19, 2015
    Posts:
    845
    Plugins:
    1
    Minecraft User:
    XenialDan
    How do i spawn an explosion that you hear, where you see particles but doesn't damage anyone/anything around and causes no knockback?
    Just.. Sound and particle.
  2. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Try sending an ExplodePacket with empty array records.
  3. thebigsmileXD
    Offline

    thebigsmileXD Banned

    Joined:
    May 19, 2015
    Posts:
    845
    Plugins:
    1
    Minecraft User:
    XenialDan
    This way?
    PHP:
    $pk = new ExplodePacket();
            
    $pk->$itementity->x;
            
    $pk->$itementity->y;
            
    $pk->$itementity->z;
            
    $pk->radius 0;
            
    $pk->records = [];
            
    $itementity->getLevel()->addChunkPacket($itementity->>> 4$itementity->>> 4$pk);
    ($itementity is an Item Entity xD)
  4. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Why not test it?
    Skullex, applqpak and iDirtPlayzMC like this.
  5. thebigsmileXD
    Offline

    thebigsmileXD Banned

    Joined:
    May 19, 2015
    Posts:
    845
    Plugins:
    1
    Minecraft User:
    XenialDan
    Seems to do nothing
  6. thebigsmileXD
    Offline

    thebigsmileXD Banned

    Joined:
    May 19, 2015
    Posts:
    845
    Plugins:
    1
    Minecraft User:
    XenialDan
    PHP:
            $pk = new ExplodePacket();
            
    $pk->$itementity->x;
            
    $pk->$itementity->y;
            
    $pk->$itementity->z;
            
    $pk->radius 0;
            
    $pk->records = [];
            
    $itementity->getLevel()->addChunkPacket($itementity->>> 4$itementity->>> 4$pk);
  7. thebigsmileXD
    Offline

    thebigsmileXD Banned

    Joined:
    May 19, 2015
    Posts:
    845
    Plugins:
    1
    Minecraft User:
    XenialDan
    PHP:

            $pk 
    = new ExplodePacket();
            
    $pk->$itementity->x;
            
    $pk->$itementity->y;
            
    $pk->$itementity->z;
            
    $pk->radius 10;
            
    $pk->records = [new Vector3($itementity->x$itementity->0.5$itementity->z)];
            
    Server::broadcastPacket($itementity->getLevel()->getChunkPlayers($itementity->>> 4$itementity->>> 4), $pk->setChannel(Network::CHANNEL_BLOCKS));
           
  8. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Increase the radius?
    Also, channels are now no longer used in PocketMine.
  9. thebigsmileXD
    Offline

    thebigsmileXD Banned

    Joined:
    May 19, 2015
    Posts:
    845
    Plugins:
    1
    Minecraft User:
    XenialDan
    Yea. Radius 0 gets cancelled.
    And it works now, thanks
  10. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Not cancelled, probably the scale is too small :)
  11. thebigsmileXD
    Offline

    thebigsmileXD Banned

    Joined:
    May 19, 2015
    Posts:
    845
    Plugins:
    1
    Minecraft User:
    XenialDan
    explodeB() gets cancelled if the value is smaller than 0.1
  12. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    That's explodeA not explodeB ;)
    That's PocketMine internals, not related to how MCPE handles it.
  13. JackboyPlay
    Offline

    JackboyPlay Active Member

    Joined:
    Apr 25, 2015
    Posts:
    507
    Minecraft User:
    JackboyPlay
    AndrewBit likes this.
  14. thebigsmileXD
    Offline

    thebigsmileXD Banned

    Joined:
    May 19, 2015
    Posts:
    845
    Plugins:
    1
    Minecraft User:
    XenialDan
    Well, now comes the part where it goes to the performance.

    I think packets are faster.

Share This Page

Advertisement