[LIB] GhostFactory - Make players look like ghosts

Discussion in 'Resources' started by lenis0012, May 24, 2013.

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

    Skyost

    Try my example here :)
    Source are hosted here.
     
  2. Offline

    FunnyGopher

    Comphenix
    Okay, so this is a general question about the code. Why, in your version of the code, did you exclude the Listener from the Manager? I've never seen, nor have I ever thought of, implementing a Listener with a custom object. I think it's a great idea having the object control it's players by itself and was confused as to why you left it out.
     
  3. Offline

    Comphenix

    I don't think every player should necessarily be added to the ghost team. I could imagine a game where only certain players are able to see the ghosts (ghost busters?), and must assist all the other players that can't.

    If the ghost manager added all the players by itself, you would have to either modify it or tell it which players to exclude, either with a a name or a generic predicate. I wanted it to be a drop-in solution, and not force people to modify the manager itself. So I kept the "add player" part outside its scope.
     
  4. Offline

    lenis0012

    Aha.

    Maybe an addGhostBuster? :p

    I updated it,

    I added ghost buster and auto show support.

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

    themadman300

    Amazing plugin, but tiny issue. I can get this plugin to work to make it so ghosts can see invisible ghosts partly transparent however, I want ghosts to be partly transparent to ALL PLAYERS who can see it. How would I go around doing this? So far, I can see it's not possible.
     
  6. Offline

    lenis0012

    I would use Comphenix 's version
     
  7. Offline

    NLGamingBross

    This is good for MiniGames THANKS MAN! Like This
     
  8. Offline

    themadman300

    It still doesn't make ghosts visible to every player on the server, regardless of whether they are ghosts or not.
     
  9. Offline

    lenis0012

    his updated version does. and i edited my post. the current code should work
     
  10. Offline

    Conarnar

    Code:
    2013-08-26 15:53:04 [WARNING] [InvisibilityCounter] Task #2 for InvisibilityCounter v1.0 generated an exception
    java.lang.NullPointerException
        at com.lenis0012.bukkit.factories.GhostFactory$1.run(GhostFactory.java:76)
        at org.bukkit.craftbukkit.v1_6_R2.scheduler.CraftTask.run(CraftTask.java:53)
        at org.bukkit.craftbukkit.v1_6_R2.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:345)
        at net.minecraft.server.v1_6_R2.MinecraftServer.t(MinecraftServer.java:522)
        at net.minecraft.server.v1_6_R2.DedicatedServer.t(DedicatedServer.java:226)
        at net.minecraft.server.v1_6_R2.MinecraftServer.s(MinecraftServer.java:486)
        at net.minecraft.server.v1_6_R2.MinecraftServer.run(MinecraftServer.java:419)
        at net.minecraft.server.v1_6_R2.ThreadServerApplication.run(SourceFile:582)
    You should add a null check here.
    Code:java
    1. public void run() {
    2. for(String user : players) {
    3. Player player = Bukkit.getPlayer(user);
    4. if(player != null && !player.hasPotionEffect(PotionEffectType.INVISIBILITY))
    5. player.addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, Integer.MAX_VALUE, 15));
    6. }
    7. }


    Also I keep getting "End of Stream" while the console is spammed with the exception message. Even when I add the null check I still get "End of Stream"
     
  11. Offline

    Techy4198

    Conarnar you didn't add a proper null check.
    replace
    Code:
    if(player != null && !player.hasPotionEffect(PotionEffectType.INVISIBILITY)){
    with
    Code:
    if(player != null){
      if(!player.hasPotionEffect(PotionEffectType.INVISIBILITY)){
     
  12. Offline

    Conarnar

    Techy4198 Same thing since the double and (&&) only continues checking if the first one returns true.
     
  13. Offline

    Techy4198

    nope. idk who told you that, but it certainly aint true. not in the version of java I have anyway.
     
  14. Offline

    Conarnar

  15. Offline

    Techy4198

  16. Aha, that's exactly what I was using this for (Ghost Busters).
     
  17. Offline

    djyee

    It looks like a ghost going on player does not appear
    What's wrong with this code?
    Code:java
    1. @EventHandler
    2. public void onPlayerUse(PlayerInteractEvent event){
    3. Player p = event.getPlayer();
    4.  
    5. if(p.getItemInHand().getType() == Material.EYE_OF_ENDER){
    6. p.playEffect(p.getLocation(), Effect.GHAST_SHRIEK, 500000000);
    7. p.sendMessage (ChatColor.GREEN + "Hayalet Modu Aktif!");
    8. p.playEffect(p.getLocation(), Effect.MOBSPAWNER_FLAMES, 500000000);
    9. if(!p.hasPotionEffect(PotionEffectType.INVISIBILITY))
    10. p.addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, Integer.MAX_VALUE, 20));
    11.  
    12. ItemStack item2 = new ItemStack(Material.ENDER_PEARL, 1);
    13. PlayerInventory pi = p.getInventory();
    14. pi.setItem(1, item2);
    15. event.setCancelled(true);
    16.  
    17.  
    18. }
    19. else if(p.getItemInHand().getType() == Material.ENDER_PEARL){
    20. p.playEffect(p.getLocation(), Effect.GHAST_SHRIEK, 500000000);
    21. p.playEffect(p.getLocation(), Effect.MOBSPAWNER_FLAMES, 500000000);
    22. p.sendMessage (ChatColor.GREEN + "Hayalet Modu Pasif!");
    23. event.setCancelled(true);
    24. ItemStack item1 = new ItemStack(Material.EYE_OF_ENDER, 1);
    25. PlayerInventory pi = p.getInventory();
    26. pi.setItem(1, item1);
    27. p.removePotionEffect(PotionEffectType.INVISIBILITY);
    28. }
    29. }
    30.  
    31.  
     
  18. Offline

    Speaw


    Sen bırak bu işleri :)
     
  19. Offline

    Rprrr

    Just wanted to let you guys know that there's a small mistake in Comphenix' class. The mistake is in the createGetTeam() function: when the team is not nullafter calling "ghostTeam = board.getTeam(GHOST_TEAM_NAME);", in his class the team members won't see other players as ghosts. This is because the line "ghostTeam.setCanSeeFriendlyInvisibles(true);" will not be reached when ghostTeam is not null and the boolean is not set to true by default when the team is created. Anyway, this can be fixed easily, and I've done so in the following class:
    Code:java
    1. package me.rprrr.lobby.util.ghostmanager; //Made by Comphenix, based on lenis0012's GhostFactory
    2.  
    3. import java.util.HashSet;
    4. import java.util.Iterator;
    5. import java.util.Set;
    6.  
    7. import org.bukkit.Bukkit;
    8. import org.bukkit.OfflinePlayer;
    9. import org.bukkit.entity.Player;
    10. import org.bukkit.plugin.Plugin;
    11. import org.bukkit.potion.PotionEffect;
    12. import org.bukkit.potion.PotionEffectType;
    13. import org.bukkit.scheduler.BukkitTask;
    14. import org.bukkit.scoreboard.Scoreboard;
    15. import org.bukkit.scoreboard.Team;
    16.  
    17. public class GhostManager {
    18. /**
    19.   * Team of ghosts and people who can see ghosts.
    20.   */
    21. private static final String GHOST_TEAM_NAME = "Ghosts";
    22. private static final long UPDATE_DELAY = 20L;
    23.  
    24. // No players in the ghost factory
    25. private static final OfflinePlayer[] EMPTY_PLAYERS = new OfflinePlayer[0];
    26. private Team ghostTeam;
    27.  
    28. // Task that must be cleaned up
    29. private BukkitTask task;
    30. private boolean closed;
    31.  
    32. // Players that are actually ghosts
    33. private Set<String> ghosts = new HashSet<String>();
    34.  
    35. public GhostManager(Plugin plugin) {
    36. // Initialize
    37. createTask(plugin);
    38. createGetTeam();
    39. }
    40.  
    41. private void createGetTeam() {
    42. Scoreboard board = Bukkit.getServer().getScoreboardManager().getMainScoreboard();
    43.  
    44. ghostTeam = board.getTeam(GHOST_TEAM_NAME);
    45.  
    46. // Create a new ghost team if needed
    47. if (ghostTeam == null) {
    48. ghostTeam = board.registerNewTeam(GHOST_TEAM_NAME);
    49. //The line used to be here...
    50. }
    51.  
    52. ghostTeam.setCanSeeFriendlyInvisibles(true); //...and here's where I (Rprrr) put it.
    53. }
    54.  
    55. private void createTask(Plugin plugin) {
    56. task = Bukkit.getScheduler().runTaskTimer(plugin, new Runnable() {
    57. @Override
    58. public void run() {
    59. for (OfflinePlayer member : getMembers()) {
    60. Player player = member.getPlayer();
    61.  
    62. if (player != null) {
    63. // Update invisibility effect
    64. setGhost(player, isGhost(player));
    65. } else {
    66. ghosts.remove(member.getName());
    67. ghostTeam.removePlayer(member);
    68. }
    69. }
    70. }
    71. }, UPDATE_DELAY, UPDATE_DELAY);
    72. }
    73.  
    74. /**
    75.   * Remove all existing player members and ghosts.
    76.   */
    77. public void clearMembers() {
    78. if (ghostTeam != null) {
    79. for (OfflinePlayer player : getMembers()) {
    80. ghostTeam.removePlayer(player);
    81. }
    82. }
    83. }
    84.  
    85. /**
    86.   * Add the given player to this ghost manager. This ensures that it can see ghosts, and later become one.
    87.   * @param player - the player to add to the ghost manager.
    88.   */
    89. public void addPlayer(Player player) {
    90. validateState();
    91. if (!ghostTeam.hasPlayer(player)) {
    92. ghostTeam.addPlayer(player);
    93. //player.addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, Integer.MAX_VALUE, 15));
    94. }
    95. }
    96.  
    97. /**
    98.   * Determine if the given player is tracked by this ghost manager and is a ghost.
    99.   * @param player - the player to test.
    100.   * @return TRUE if it is, FALSE otherwise.
    101.   */
    102. public boolean isGhost(Player player) {
    103. return player != null && hasPlayer(player) && ghosts.contains(player.getName());
    104. }
    105.  
    106. /**
    107.   * Determine if the current player is tracked by this ghost manager, or is a ghost.
    108.   * @param player - the player to check.
    109.   * @return TRUE if it is, FALSE otherwise.
    110.   */
    111. public boolean hasPlayer(Player player) {
    112. validateState();
    113. return ghostTeam.hasPlayer(player);
    114. }
    115.  
    116. /**
    117.   * Set wheter or not a given player is a ghost.
    118.   * @param player - the player to set as a ghost.
    119.   * @param isGhost - TRUE to make the given player into a ghost, FALSE otherwise.
    120.   */
    121. public void setGhost(Player player, boolean isGhost) {
    122. // Make sure the player is tracked by this manager
    123. if (!hasPlayer(player))
    124. addPlayer(player);
    125.  
    126. if (isGhost) {
    127. ghosts.add(player.getName());
    128. player.addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, Integer.MAX_VALUE, 15));
    129. } else if (!isGhost) {
    130. ghosts.remove(player.getName());
    131. player.removePotionEffect(PotionEffectType.INVISIBILITY);
    132. }
    133. }
    134.  
    135. /**
    136.   * Remove the given player from the manager, turning it back into the living and making it unable to see ghosts.
    137.   * @param player - the player to remove from the ghost manager.
    138.   */
    139. public void removePlayer(Player player) {
    140. validateState();
    141. if (ghostTeam.removePlayer(player)) {
    142. player.removePotionEffect(PotionEffectType.INVISIBILITY);
    143. }
    144. }
    145.  
    146. /**
    147.   * Retrieve every ghost currently tracked by this manager.
    148.   * @return Every tracked ghost.
    149.   */
    150. public OfflinePlayer[] getGhosts() {
    151. validateState();
    152. Set<OfflinePlayer> players = new HashSet<OfflinePlayer>(ghostTeam.getPlayers());
    153.  
    154. // Remove all non-ghost players
    155. for (Iterator<OfflinePlayer> it = players.iterator(); it.hasNext(); ) {
    156. if (!ghosts.contains(it.next().getName())) {
    157. it.remove();
    158. }
    159. }
    160. return toArray(players);
    161. }
    162.  
    163. /**
    164.   * Retrieve every ghost and every player that can see ghosts.
    165.   * @return Every ghost or every observer.
    166.   */
    167. public OfflinePlayer[] getMembers() {
    168. validateState();
    169. return toArray(ghostTeam.getPlayers());
    170. }
    171.  
    172. private OfflinePlayer[] toArray(Set<OfflinePlayer> players) {
    173. if (players != null) {
    174. return players.toArray(new OfflinePlayer[0]);
    175. } else {
    176. return EMPTY_PLAYERS;
    177. }
    178. }
    179.  
    180. public void close() {
    181. if (!closed) {
    182. task.cancel();
    183. ghostTeam.unregister();
    184. closed = true;
    185. }
    186. }
    187.  
    188. public boolean isClosed() {
    189. return closed;
    190. }
    191.  
    192. private void validateState() {
    193. if (closed) {
    194. throw new IllegalStateException("Ghost factory has closed. Cannot reuse instances.");
    195. }
    196. }
    197. }
     
    Skyost likes this.
  20. Offline

    Comphenix

    Ah, thanks for fixing that bug.

    I've updated my version on GitHub to include your fix. :)
     
    Skyost likes this.
  21. Offline

    Rprrr

  22. Offline

    lenis0012

    Comphenix mind if i put a link to your version on this post?
     
  23. Offline

    Comphenix

    Sure, go ahead. :)
     
  24. Offline

    djyee

    yooo örenip baskalarina anlatacam :D
    bilmemek ayip deildir örenmemek ayiptir...
     
  25. Offline

    Speaw

    Sen direk potion effect vermissin olay bu degil :)
     
  26. Offline

    djyee

    biliyorum :) daha önce direk potion effect vererek kendimi yari görunur yapmistim fakat sonra tekrar deneyince olmamisti cok garibime gitti buda :D neyse bu öretici konuyu bos verdim su an işime yaramiyo istesem yaparim :) kisaca urasmiycam :D
     
  27. Offline

    lenis0012

    This is most likely not working on 1.7
    I still need to edit the post to use Comphenix's version.
     
  28. Offline

    Minecrafter_NL

    Hello all.
    i gave this a quick try but it makes the player invisible and you cant see him.
    nobody can see him.

    My classes here \/

    main:
    Code:java
    1. package nl.MD5Dev.Ghost;
    2.  
    3. import org.bukkit.ChatColor;
    4. import org.bukkit.command.Command;
    5. import org.bukkit.command.CommandSender;
    6. import org.bukkit.entity.Player;
    7. import org.bukkit.plugin.java.JavaPlugin;
    8.  
    9. public class Main extends JavaPlugin {
    10. public GhostFactory ghostFactory;
    11.  
    12. @Override
    13. public void onEnable(){
    14. this.ghostFactory = new GhostFactory(this, true);
    15. ghostFactory.create();
    16. }
    17.  
    18. @Override
    19. public void onDisable(){
    20.  
    21. }
    22.  
    23. @Override
    24. public boolean onCommand(CommandSender sender, Command cmd,
    25. String commandLabel, String[] args) {
    26. Player player = (Player) sender;
    27. if (commandLabel.equalsIgnoreCase("ghostmode")){
    28. if (args[0].equalsIgnoreCase("enable")){
    29. player.sendMessage(ChatColor.GREEN + "You are now a ghost!");
    30. ghostFactory.addGhost(player);
    31. } else if (args[0].equalsIgnoreCase("disable")){
    32. ghostFactory.removeGhost(player);
    33. } else {
    34. player.sendMessage(ChatColor.RED + "Invalid arguments, use the command like this:");
    35. player.sendMessage(ChatColor.RED + "/GhostMode <enable:disable>");
    36. }
    37. }
    38. return true;
    39.  
    40. }
    41. }
    42.  



    GhostFactory:

    Code:java
    1. package nl.MD5Dev.Ghost;
    2.  
    3. import java.lang.reflect.Field;
    4. import java.lang.reflect.Method;
    5. import java.util.ArrayList;
    6. import java.util.List;
    7.  
    8. import org.bukkit.Bukkit;
    9. import org.bukkit.entity.Player;
    10. import org.bukkit.event.EventHandler;
    11. import org.bukkit.event.EventPriority;
    12. import org.bukkit.event.Listener;
    13. import org.bukkit.event.player.PlayerJoinEvent;
    14. import org.bukkit.event.player.PlayerQuitEvent;
    15. import org.bukkit.plugin.Plugin;
    16. import org.bukkit.plugin.PluginManager;
    17. import org.bukkit.potion.PotionEffect;
    18. import org.bukkit.potion.PotionEffectType;
    19.  
    20. /**
    21. * GhostFactory
    22. * Make players look like ghosts
    23. *
    24. * Requirements:
    25. * - MC 1.5+
    26. *
    27. * @author lenis0012
    28. */
    29. public class GhostFactory {
    30. private static final String MC_VERSION;
    31.  
    32. static {
    33. String version = "";
    34. if(!checkVersion(version)) {
    35. StringBuilder builder = new StringBuilder();
    36. for(int a = 0; a < 10; a++) {
    37. for(int b = 0; b < 10; b++) {
    38. for(int c = 0; c < 10; c++) {
    39. builder.setLength(0);
    40. builder.append('v').append(a).append('_').append(b).append("_R").append(c).append('.');
    41. version = builder.toString();
    42. if(checkVersion(version))
    43. a = b = c = 10;
    44. }
    45. }
    46. }
    47. }
    48.  
    49. MC_VERSION = version;
    50. }
    51.  
    52. private static final String NMS_ROOT = "net.minecraft.server." + MC_VERSION;
    53.  
    54. private static boolean checkVersion(String version) {
    55. try {
    56. Class.forName("net.minecraft.server." + version + "World");
    57. return true;
    58. return false;
    59. }
    60. }
    61.  
    62. private List<String> players = new ArrayList<String>();
    63. private boolean created = false;
    64. private boolean show;
    65.  
    66. public GhostFactory(Plugin plugin, boolean show) {
    67. this.show = show;
    68. PluginManager pm = Bukkit.getPluginManager();
    69. pm.registerEvents(new GhostListener(this), plugin);
    70. Bukkit.getScheduler().runTaskTimer(plugin, new Runnable() {
    71. @Override
    72. public void run() {
    73. for(String user : players) {
    74. Player player = Bukkit.getPlayer(user);
    75. if(!player.hasPotionEffect(PotionEffectType.INVISIBILITY))
    76. player.addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, Integer.MAX_VALUE, 15));
    77. }
    78. }
    79. }, 5L, 5L);
    80. }
    81.  
    82. public void create() {
    83. if(created)
    84. return;
    85.  
    86. this.update(0);
    87. this.created = true;
    88. }
    89.  
    90. public void remove() {
    91. if(!created)
    92. return;
    93.  
    94. this.update(1);
    95. this.created = false;
    96. }
    97.  
    98. public boolean isCreated() {
    99. return this.created;
    100. }
    101.  
    102. public void addGhost(Player player) {
    103. if(!show)
    104. this.addGhostBuster(player);
    105. player.addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, Integer.MAX_VALUE, 15));
    106. }
    107.  
    108. public void removeGhost(Player player) {
    109. if(!show)
    110. this.removeGhostBuster(player);
    111. player.removePotionEffect(PotionEffectType.INVISIBILITY);
    112. }
    113.  
    114. public boolean addGhostBuster(Player player) {
    115. if(players.add(player.getName())) {
    116. this.update(3);
    117. return true;
    118. } else
    119. return false;
    120. }
    121.  
    122. public boolean removeGhostBuster(Player player) {
    123. if(players.remove(player.getName())) {
    124. this.update(4);
    125. return true;
    126. } else
    127. return false;
    128. }
    129.  
    130. public boolean isGhostBuster(Player player) {
    131. return players.contains(player.getName());
    132. }
    133.  
    134. public boolean isGhost(Player player) {
    135. return player.hasPotionEffect(PotionEffectType.INVISIBILITY);
    136. }
    137.  
    138. public String[] getGhostBusters() {
    139. return players.toArray(new String[0]);
    140. }
    141.  
    142. public void clearGhostBusters() {
    143. players.clear();
    144. }
    145.  
    146. private void update(int action) {
    147. Object packet = this.createPacket("Packet209SetScoreboardTeam");
    148. this.setValue(packet, "a", "ghosts");
    149. this.setValue(packet, "f", action);
    150. this.setValue(packet, "b", "Ghosts");
    151. this.setValue(packet, "c", "");
    152. this.setValue(packet, "d", "");
    153. this.setValue(packet, "g", 2);
    154. this.setValue(packet, "e", players);
    155.  
    156. for(Player player : Bukkit.getOnlinePlayers()) {
    157. this.sendPacket(player, packet);
    158. }
    159. }
    160.  
    161. private void sendTo(Player player) {
    162. Object packet = this.createPacket("Packet209SetScoreboardTeam");
    163. this.setValue(packet, "a", "ghosts");
    164. this.setValue(packet, "f", 0);
    165. this.setValue(packet, "b", "Ghosts");
    166. this.setValue(packet, "c", "");
    167. this.setValue(packet, "d", "");
    168. this.setValue(packet, "g", 2);
    169. this.setValue(packet, "e", players);
    170. this.sendPacket(player, packet);
    171. }
    172.  
    173. private void setValue(Object instance, String fieldName, Object value) {
    174. try {
    175. Field field = instance.getClass().getDeclaredField(fieldName);
    176. field.setAccessible(true);
    177. field.set(instance, value);
    178. } catch(Exception e) {
    179. e.printStackTrace();
    180. }
    181. }
    182.  
    183. private Object getValue(Object instance, String fieldName) {
    184. try {
    185. Field field = instance.getClass().getDeclaredField(fieldName);
    186. field.setAccessible(true);
    187. return field.get(instance);
    188. } catch(Exception e) {
    189. e.printStackTrace();
    190. return null;
    191. }
    192. }
    193.  
    194. private Object invoke(Object instance, String methodName, Class<?>[] fields, Object[] values) {
    195. try {
    196. Method method = instance.getClass().getDeclaredMethod(methodName, fields);
    197. method.setAccessible(true);
    198. return method.invoke(instance, values);
    199. } catch(Exception e) {
    200. e.printStackTrace();
    201. return null;
    202. }
    203. }
    204.  
    205. private Object createPacket(String name) {
    206. try {
    207. Class<?> clazz = Class.forName(NMS_ROOT + name);
    208. return clazz.newInstance();
    209. } catch(Exception e) {
    210. e.printStackTrace();
    211. return null;
    212. }
    213. }
    214.  
    215. private void sendPacket(Player player, Object packet) {
    216. try {
    217. Class<?> Packet = Class.forName(NMS_ROOT + "Packet");
    218. Object playerHandle = this.invoke(player, "getHandle", new Class<?>[0], new Class<?>[0]);
    219. Object playerConnection = this.getValue(playerHandle, "playerConnection");
    220. this.invoke(playerConnection, "sendPacket", new Class<?>[] {Packet}, new Object[] {packet});
    221. } catch(Exception e) {
    222. e.printStackTrace();
    223. }
    224. }
    225.  
    226. public static class GhostListener implements Listener {
    227. private GhostFactory factory;
    228.  
    229. public GhostListener(GhostFactory factory) {
    230. this.factory = factory;
    231. }
    232.  
    233. @EventHandler(priority = EventPriority.MONITOR)
    234. public void onPlayerQuit(PlayerQuitEvent event) {
    235. Player player = event.getPlayer();
    236. factory.removeGhost(player);
    237. if(factory.show)
    238. factory.removeGhostBuster(player);
    239. }
    240.  
    241. @EventHandler(priority = EventPriority.LOWEST)
    242. public void onPlayerJoin(PlayerJoinEvent event) {
    243. Player player = event.getPlayer();
    244. factory.sendTo(player);
    245. if(factory.show)
    246. factory.addGhostBuster(player);
    247. }
    248. }
    249. }


    Plugin.yml:
    Code:
    main: nl.MD5Dev.Ghost.Main
    version: 1.0
    name: Ghost
    author: MD5Dev
    commands:
      GhostMode:
        description: Toggles GhostMode
        usage: /GhostMode <Enable:Disable>

    anybody know what i did wrong?


    EDIT: Nvm, i ran it on 1.7.2, works on 1.6.4 :D
     
  29. Offline

    Skyost

  30. Offline

    Comphenix

    Many scoreboard plugins are incompatible, and this is an unfortunate consequence of how Dinnerbone implemented the scoreboard systen. A player can only be a member of a single team, and certain features (such as the ghost invisibility effect), require that two players are a member of the same team.

    This limitation is inherent in the client-side implementation of the scoreboard system, and cannot be changed in Bukkit alone. I suggest disabling ScoreboardStats for the duration of the game that requires GhostFactory, or perhaps use a different method for displaying that information:
    • Display the information as client-side blocks in the sky.
    • Use DragonAnnouncer.
    • Show the statistics in the chat withour disrupting normal conversation. I suggest either dividing the chat into two columns (left would be chat, right would be statistics), or two rows (top and bottom). I don't know if this is possible with pure Bukkit API, but I definitely know it can be done with ProtocolLib.
    • Draw it in a map.
    • Etc. Use your imagination.
     
    Skyost likes this.
Thread Status:
Not open for further replies.

Share This Page