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

Run command then activate other event

Comments in 'Plugin Development' started by MikkiMCPE, May 25, 2016.

  1. MikkiMCPE
    Offline

    MikkiMCPE Active Member

    Joined:
    May 16, 2015
    Posts:
    125
    Minecraft User:
    MikkiMC
    how to activate other event [for example (PlayerMoveEvent)] when we run command event?

    for example illustration :
    /stuck
    after player type /stuck, onCommand function will call PlayerMoveEvent

    thanks

    EDITED :
    Its look like to enable and disable event with command
    Last edited: May 25, 2016
  2. Jazzwhistle
    Offline

    Jazzwhistle Notable Member

    Joined:
    Dec 27, 2014
    Posts:
    364
    Minecraft User:
    Awzaw
    Can you explain in more detail what you are trying to do?
  3. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    PHP:
    PluginManager::callEvent(Event $event)
    Example
    PHP:
    /** @var Player $player */
    /** @var PluginBase $this */
    $this->getServer()->getPluginManager()->callEvent($e = new PlayerMoveEvent($player$player->getLocation(), $player->getLocation()->add(1)));
    MikkiMCPE and Jazzwhistle like this.
  4. Jazzwhistle
    Offline

    Jazzwhistle Notable Member

    Joined:
    Dec 27, 2014
    Posts:
    364
    Minecraft User:
    Awzaw
    I think he wants to deactivate player movement, and then activate it again, but I could be wrong. Firing a PlayerMoveEvent sounds much more fun anyway, I'll have to try it
  5. MikkiMCPE
    Offline

    MikkiMCPE Active Member

    Joined:
    May 16, 2015
    Posts:
    125
    Minecraft User:
    MikkiMC
    /powerfull <particleName> = enable PlayerMoveEvent and i was add addParticle() there, so when player type /powerfull <particleName>, will appear some particle near him.
  6. MikkiMCPE
    Offline

    MikkiMCPE Active Member

    Joined:
    May 16, 2015
    Posts:
    125
    Minecraft User:
    MikkiMC
    okay! thanks for a clue.. my brain work again :D
  7. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    Create new function which handles the particle emit and call it whenever you want. Functions are just like skills for any living being, learn once use it forever.
    I recommend you to read this post
    MikkiMCPE likes this.
  8. AndrewBit
    Offline

    AndrewBit Notable Member

    Joined:
    Jun 18, 2015
    Posts:
    435
    Minecraft User:
    AndrewBit4
    MikkiMCPE likes this.

Share This Page

Advertisement