Solved Custom join visual Effect?

Discussion in 'Plugin Development' started by SinestroWhite, Apr 17, 2015.

Thread Status:
Not open for further replies.
  1. Offline

    SinestroWhite

    Hello,
    Can someone tell me how to add custom join visual effect, I tried my best but it didn't work! :C
    Here's a copy:
    Main:
    Code:java
    1.  
    2. public void OnEnable(){
    3. new PlayerJoinListener(this);
    4. getServer().getPluginManager().registerEvents(this, this);
    5. }


    PlayerJoinListener:
    Code:java
    1.  
    2. public class PlayerJoinListener implements Listener{
    3.  
    4. public PlayerJoinListener(Main plugin) {
    5. plugin.getServer().getPluginManager().registerEvents(this, plugin);
    6. }
    7.  
    8. @EventHandler
    9. public void onPlayerJoin(PlayerJoinEvent event) {
    10. Player player = event.getPlayer();
    11. for(int i = 0; i < 100; i++) {
    12. player.getWorld().playEffect(player.getLocation(), Effect.MOBSPAWNER_FLAMES, 10);
    13. }
    14. }
    15. }

    EDIT by Timtower: added syntax tags
     
  2. Online

    timtower Administrator Administrator Moderator

  3. Offline

    dlange

  4. Offline

    SinestroWhite

    @timtower you are right but... I joined after I had pressed F5 and the weren't anythig!
     
  5. Online

    timtower Administrator Administrator Moderator

  6. Offline

    SinestroWhite

    @timtower Yes, I even tried to move it under onCommand() method and it worked

    @dlange What you mean "fried"?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 12, 2016
  7. Offline

    MexMaster

    @SinestroWhite
    Java is CaSe-SeNsItIvE!
    The method OnEnable() has to be onEnable()!
     
    dlange and CodePlaysMinecraft like this.
  8. Offline

    dlange

    @SinestroWhite Fired, not fried... It means is the event being called successfully
     
  9. Offline

    nj2miami

    @SinestroWhite, @MexMaster called it out to your attention. This needs to read onEnable() NOT OnEnable()

    This will never get called and therefore never register:
     
  10. Offline

    SinestroWhite

    @nj2miami, @MaxMaster I saw your comments and I fixed it but the player join event still doesn't work!

    @dlange Yes, it is.

    EDIT:Actually @nj2miami, @MaxMaster you were right, it worked, thanks for help, I mark this topic as solved
     
    Last edited: Apr 18, 2015
Thread Status:
Not open for further replies.

Share This Page