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

Solved SignChangeEvent

Comments in 'Plugin Development' started by FlamingGenius, Oct 13, 2015.

  1. PocketKiller
    Offline

    PocketKiller Notable Member

    Joined:
    Jul 20, 2015
    Posts:
    741
    No.
    It won't work i tested it :p it accepts a vector3/tile object
  2. TryoneLegendZzz
    Offline

    TryoneLegendZzz Active Member

    Joined:
    May 31, 2015
    Posts:
    201
    Minecraft User:
    SavionLegendZzz
    that would work too
  3. Syntaxious
    Offline

    Syntaxious New Member

    Joined:
    Sep 15, 2015
    Posts:
    19
    Minecraft User:
    Syntaxious
    Accidentally replies to the wrong post, ignore my post :)
  4. FlamingGenius
    Offline

    FlamingGenius Active Member

    Joined:
    Sep 23, 2015
    Posts:
    173
    Minecraft User:
    FlamingGenius
    Please do not post anything else unless it is a solution to the problem
    Taha_The_Hacker likes this.
  5. TryoneLegendZzz
    Offline

    TryoneLegendZzz Active Member

    Joined:
    May 31, 2015
    Posts:
    201
    Minecraft User:
    SavionLegendZzz
    PHP:
    public function signChange(SignChangeEvent $ev){
    $sign $ev->getPlayer()->getLevel()->getTile($ev->getBlock);
    $text $sign->getText();
    if(
    $sign instanceof Sign){
    //if you tap a chest it crashes btw
    so idk if this will work(below)
    if(
    $sign instanceof Vector3){
    if(
    $text[0] === "Lottery"){
    $ev->setText("/*text*/");

    }
    }
    }
    }
  6. TryoneLegendZzz
    Offline

    TryoneLegendZzz Active Member

    Joined:
    May 31, 2015
    Posts:
    201
    Minecraft User:
    SavionLegendZzz
    lul edit
  7. FlamingGenius
    Offline

    FlamingGenius Active Member

    Joined:
    Sep 23, 2015
    Posts:
    173
    Minecraft User:
    FlamingGenius
    Stop posting incorrect answers
    Taha_The_Hacker likes this.
  8. HotFireyDeath
    Offline

    HotFireyDeath Notable Member Plugin Developer

    Joined:
    Mar 19, 2015
    Posts:
    328
    Plugins:
    1
    Minecraft User:
    HotFireyDeath
    Did you implement Listener?
    I always do that when I use events ._.

    Also, if you do implement Listener, use pocketmine\event\Event;
  9. FlamingGenius
    Offline

    FlamingGenius Active Member

    Joined:
    Sep 23, 2015
    Posts:
    173
    Minecraft User:
    FlamingGenius
    Would not implementing it cause the signs not to work?
  10. HotFireyDeath
    Offline

    HotFireyDeath Notable Member Plugin Developer

    Joined:
    Mar 19, 2015
    Posts:
    328
    Plugins:
    1
    Minecraft User:
    HotFireyDeath
    From what I've always thought, implementing Listener allows to listen to events. If you don't implement Listener, event related context wouldn't work (say, PlayerJoinEvent).

    Try implementing and see if it gives you a result.
    Legoboy0215 and FlamingGenius like this.
  11. FlamingGenius
    Offline

    FlamingGenius Active Member

    Joined:
    Sep 23, 2015
    Posts:
    173
    Minecraft User:
    FlamingGenius
    Still nothin
    HotFireyDeath likes this.
  12. HotFireyDeath
    Offline

    HotFireyDeath Notable Member Plugin Developer

    Joined:
    Mar 19, 2015
    Posts:
    328
    Plugins:
    1
    Minecraft User:
    HotFireyDeath
    FlamingGenius likes this.
  13. FlamingGenius
    Offline

    FlamingGenius Active Member

    Joined:
    Sep 23, 2015
    Posts:
    173
    Minecraft User:
    FlamingGenius
    HotFireyDeath likes this.
  14. Legoboy0215
    Offline

    Legoboy0215 Notable Member

    Joined:
    Nov 1, 2014
    Posts:
    1,724
    Minecraft User:
    Legoboy0215
    DON'T use ID 323 if you see that. Simply use instanceof Sign.
  15. FlamingGenius
    Offline

    FlamingGenius Active Member

    Joined:
    Sep 23, 2015
    Posts:
    173
    Minecraft User:
    FlamingGenius
    O
    duh 323 is an item not a block :p i know what im doing my friend :D
  16. Legoboy0215
    Offline

    Legoboy0215 Notable Member

    Joined:
    Nov 1, 2014
    Posts:
    1,724
    Minecraft User:
    Legoboy0215
    Just a suggestion ;)
    FlamingGenius likes this.
  17. FlamingGenius
    Offline

    FlamingGenius Active Member

    Joined:
    Sep 23, 2015
    Posts:
    173
    Minecraft User:
    FlamingGenius
    I really do appreciate that tho :D
    HotFireyDeath and Legoboy0215 like this.
  18. zombie_Power
    Offline

    zombie_Power Active Member

    Joined:
    Sep 7, 2015
    Posts:
    239
    Minecraft User:
    Zombie_Power
    If you want to submit this code, it won't be accepted. There is already a Casino/lottery plugin [sorry forgot the name]
  19. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    If you ever need to check if it is of a certain type, you would check if it is a pocketmine\tile\Sign instead.
    TryoneLegendZzz likes this.

Share This Page

Advertisement