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

storm

Comments in 'Plugin Development' started by TheMaks, Oct 28, 2015.

  1. TheMaks
    Offline

    TheMaks Active Member

    Joined:
    Jul 19, 2015
    Posts:
    58
    Minecraft User:
    TheMaks
    How to create thunder or storm ?
    Help please.
    Say this function or class , pls :)
  2. zombie_Power
    Offline

    zombie_Power Active Member

    Joined:
    Sep 7, 2015
    Posts:
    239
    Minecraft User:
    Zombie_Power
    for thunder
    PHP:
    LevelEventPacket::EVENT_START_THUNDER;
    for storm, try
    PHP:
    LevelEventPacket::EVENT_START_RAIN;
    Last edited: Oct 28, 2015
  3. TheMaks
    Offline

    TheMaks Active Member

    Joined:
    Jul 19, 2015
    Posts:
    58
    Minecraft User:
    TheMaks
    Thanks :)
    What use pocketmine... ?
  4. zombie_Power
    Offline

    zombie_Power Active Member

    Joined:
    Sep 7, 2015
    Posts:
    239
    Minecraft User:
    Zombie_Power
    PHP:
    use pocketmine\network\protocol\LevelEventPacket;
  5. TheMaks
    Offline

    TheMaks Active Member

    Joined:
    Jul 19, 2015
    Posts:
    58
    Minecraft User:
    TheMaks
    Don't work :/
    PHP:
    public function Move(PlayerMoveEvent $event){
       
    $p $event->getPlayer();
       
    $x $p->getX(); $z $p->getZ(); $y $p->getY();
       
    $pk = new LevelEventPacket();
       
    $pk->$x;
       
    $pk->$y;
       
    $pk->$z;
       
    $pk->evid LevelEventPacket::EVENT_START_THUNDER;
       
    $p->dataPacket($pk);
      }
  6. zombie_Power
    Offline

    zombie_Power Active Member

    Joined:
    Sep 7, 2015
    Posts:
    239
    Minecraft User:
    Zombie_Power
    did rain work?
  7. Jelly9912
    Offline

    Jelly9912 Active Member

    Joined:
    Aug 8, 2015
    Posts:
    118
    Minecraft User:
    Jelly9912
    This is for snow:
    (Main)
    PHP:
    public function onEnable(){
    $this->pk = new AddEntityPacket ();
            
    $this->pk->type 81;
            
    $this->pk->metadata = [
                    
    Entity::DATA_FLAGS => [
                            
    Entity::DATA_TYPE_BYTE,
                            
    0
                    
    ],
                    
    Entity::DATA_SHOW_NAMETAG => [
                            
    Entity::DATA_TYPE_BYTE,
                            
    0
                    
    ],
                    
    Entity::DATA_AIR => [
                            
    Entity::DATA_TYPE_SHORT,
                            
    10
                    
    ]
            ];
            
    $this->getServer ()->getScheduler ()->scheduleRepeatingTask ( new SnowTask $this ), );
        
            new 
    OutEventListener $this );
            
    $this->getServer ()->getPluginManager ()->registerEvents $this$this );
        }

    public function 
    onPlayerJoinEvent(PlayerJoinEvent $event) {
            
    $player $event->getPlayer ();
            
    $pk = new LevelEventPacket ();
            
    $pk->evid 3001;
            
    $pk->data 10000;
            
    $player->dataPacket $pk );
        } 
    (Task)
    PHP:
    class SnowTask extends PluginTask {
        function 
    __construct(Snow $owner) {
            
    parent::__construct $owner );
        }
        public function 
    onRun($currentTick) {
            
    /**
            *
            * @var $owner Snow
            */
            
    $owner $this->getOwner ();
            
    $owner->Snow ();
        }
    You can change this on rain
  8. TheMaks
    Offline

    TheMaks Active Member

    Joined:
    Jul 19, 2015
    Posts:
    58
    Minecraft User:
    TheMaks
    Dont work
    PHP:
    public function Move(PlayerMoveEvent $event){
       
    $p $event->getPlayer();
       
    $x $p->getX(); $z $p->getZ(); $y $p->getY();
       
    $pk = new LevelEventPacket();
       
    $pk->$x;
       
    $pk->$y;
       
    $pk->$z;
       
    $pk->evid LevelEventPacket::EVENT_START_THUNDER;
       
    $p->dataPacket($pk);
      }
  9. Praxthisnovcht
    Offline

    Praxthisnovcht Notable Member Plugin Developer

    Joined:
    Mar 10, 2014
    Posts:
    699
    Plugins:
    4
    Minecraft User:
    PraxHellTag
    watch your private messages
  10. da123rrell
    Offline

    da123rrell Active Member

    Joined:
    Feb 11, 2015
    Posts:
    136
    Minecraft User:
    da123rrell
    If everyone knows how to make these, then why isnt there any weather plugins yet?
  11. zombie_Power
    Offline

    zombie_Power Active Member

    Joined:
    Sep 7, 2015
    Posts:
    239
    Minecraft User:
    Zombie_Power
    Weather is not properly implemented into pocketmine. There will be much more possibilities, when it is ;)
    da123rrell likes this.
  12. Praxthisnovcht
    Offline

    Praxthisnovcht Notable Member Plugin Developer

    Joined:
    Mar 10, 2014
    Posts:
    699
    Plugins:
    4
    Minecraft User:
    PraxHellTag
    There are already plugins like SnowHalatation by Hmm
  13. da123rrell
    Offline

    da123rrell Active Member

    Joined:
    Feb 11, 2015
    Posts:
    136
    Minecraft User:
    da123rrell
    Good point :d
  14. Praxthisnovcht
    Offline

    Praxthisnovcht Notable Member Plugin Developer

    Joined:
    Mar 10, 2014
    Posts:
    699
    Plugins:
    4
    Minecraft User:
    PraxHellTag
    zombie_Power likes this.
  15. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Weathers should be done in PocketMine instead of with plugins. Sending a level event packet isn't a proper way to implement weather.
    Legoboy0215 likes this.
  16. Legoboy0215
    Offline

    Legoboy0215 Notable Member

    Joined:
    Nov 1, 2014
    Posts:
    1,724
    Minecraft User:
    Legoboy0215
    When someone uses packets, everyone is interested. When another uses FTP (Floating Text Particle), everyone uses it too :p
  17. Praxthisnovcht
    Offline

    Praxthisnovcht Notable Member Plugin Developer

    Joined:
    Mar 10, 2014
    Posts:
    699
    Plugins:
    4
    Minecraft User:
    PraxHellTag
    Therefore it is not a good way?
    if in the meantime it is the only solution?
  18. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    For example, other plugins don't know what weather it is.
    And it doesn't get saved.
    Praxthisnovcht likes this.
  19. Praxthisnovcht
    Offline

    Praxthisnovcht Notable Member Plugin Developer

    Joined:
    Mar 10, 2014
    Posts:
    699
    Plugins:
    4
    Minecraft User:
    PraxHellTag
    thank you for the example.
  20. Ritch
    Offline

    Ritch Active Member

    Joined:
    Oct 4, 2015
    Posts:
    184
    Minecraft User:
    anonymous
    Please Give me Plugin ?

Share This Page

Advertisement