Player glow?

Discussion in 'Plugin Development' started by guitargun, Feb 13, 2015.

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

    guitargun

    I was wondering if a player could have a glow of a item Enchantment or like a charged creeper.
    I did some searching but the best answer I could find is to have custom texture packs which make armor invisible, this is something I can't work with.

    Is this possible or do I have to go back to the effect library.
     
  2. @guitargun You want the player themselves to have a glow? I don't think that would be possible with a plugin.
     
  3. Offline

    guitargun

    indeed I want my players to have a glow.
     
  4. Maybe you could get the players location and on PlayerMoveEvent, create a glow stone block, get the players location, and update the glow stones location. Maybe you could mess with packets and try to make the glow stone invisible to players.
     
  5. Offline

    Skionz

  6. Offline

    _Filip

    invisible charged creeper without ai that is teleported to the player on the PlayerMoveEvent
     
  7. Offline

    Justinian6

    no no no... If you want a glow try getting the players location in a synchronous timer and change the set the light there to be a different level...

    However, there may not be a method because Bukkit's developers think that light is handled client side. Incorrect, it's handled by the server and loaded by the player in the chunks. If you can't find the method try using Packets.

    Or you could spawn flame particles around them...
     
  8. Offline

    guitargun

    @_Filip I managed to do this:
    [​IMG]

    not perfect yet but that will change.
    also I notice that my countdown etc is not working smooth. it sometimes lags a bit. you have any tips for it?
     
  9. Offline

    xTrollxDudex

    He wants a charged creeper glow, not lighting glow.
     
  10. Offline

    1Rogue

    Don't use bukkit's scheduler.
     
  11. Offline

    guitargun

    What should I use? A quick search only brought me to the bukkit scheduler.

    edit:
    should I use that other timer thingy instead of the bukkit scheduler for all of my schedulers I currently have?
    please note that those schedulers can range from over 10 minutes to less than a second
     
    Last edited: Feb 15, 2015
  12. Offline

    1Rogue

    If you'd like, you can borrow my scheduler class: https://github.com/CodeLanx/Codelan.../com/codelanx/codelanxlib/util/Scheduler.java
     
  13. Offline

    guitargun

    @1Rogue it works now but sometimes there is a bit of lag in the timer or the timer just stops guess I have to dig into it. also on line 103 of the git you send it shows me error of not finding the variable. I commented it out and I use to cancel the scheduler like this:

    Code:
     
        public void timer() {
        scheduler = Scheduler.runAsyncTaskRepeat(
                    new Runnable() {
                        public void run() {
                                for (UUID p : players.keySet()) {
                                    Player player = Bukkit.getPlayer(p);
                            if (!countdown) {
                                minutes = time / 60;
                                int seconds = time - minutes * 60;
                                    BarAPI.setMessage(player, ChatColor.BLUE
                                            + "Blue: " + blueteamkills
                                            + ChatColor.GRAY
                                            + "    Game starts in: " + minutes
                                            + ":" + seconds + ChatColor.RED
                                            + "    Red: " + redteamkills, 1);
                                time--;
                                if (time == 0) {
                                    countdown = true;
                                }
                            } else {
                                minutes = time / 60;
                                int seconds = time - minutes * 60;
    
                                    BarAPI.setMessage(player, ChatColor.BLUE
                                            + "Blue: " + blueteamkills
                                            + ChatColor.GREEN + "    Game time: "
                                            + minutes + ":" + seconds
                                            + ChatColor.RED + "    Red: "
                                            + redteamkills, 1);
                                }
                                time++;
                                players.get(p).setGold(players.get(p).getGold() + 3);
    
    
                            if (minutes == type.getMaxtime()) {
                                String team;
                                if(blueteamkills > redteamkills){
                                    team = "Blue";
                                }else if(redteamkills > blueteamkills){
                                    team = "Red";
                                }else{
                                    team = "Tied";
                                }
                                endgame("Time", team);
                            }
                                }
                        }
                    }, 1L, 1L);
        }
    
    then the cancel method:
    Code:
       
        public void endgame(String type, String team) {
            scheduler.cancel(true);
            for (UUID p : players.keySet()) {
                Player player = Bukkit.getPlayer(p);
                player.sendMessage(ChatColor.AQUA + "[Arena] " + ChatColor.GOLD
                        + "Match has ended. Type of win: " + type
                        + ". Team that won: " + team + ".");
                plugin.fw.loadinv(player);
                Damageable dam = player;
                dam.setMaxHealth(20);
                player.setHealth(dam.getMaxHealth());
                Bukkit.dispatchCommand(Bukkit.getServer().getConsoleSender(),
                        "warp spawn " + player.getName());
                plugin.mov.playertoarena.remove(p);
            }
    
            players.clear();
            plugin.mov.reloadmap(arena);
        }
    
    only the first long can't be 0 because it isn't working any tips on this problem?
     
    Last edited: Feb 16, 2015
Thread Status:
Not open for further replies.

Share This Page