Nameplates With No (Visible) Mob Underneath (Holograms)

Discussion in 'Resources' started by gyroninja, Feb 20, 2014.

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

    Goblom

  2. Offline

    gyroninja

    :| I just got home and turns out someone spread a false rumor.
    THIS WORKS ON 1.7
    This will (most likely) work on 1.8

    I'm NOT using NMS code. I'm using ProtocolLib
    http://dev.bukkit.org/bukkit-plugins/protocollib/

    This is a really cool library which has fuzzy reflection so that it'll work cross versions. (As long as there are no major changes)

    To make the fields easier to read I have used PacketWrapper by the same person Comphenix.
    PacketWrapper has a class for each packet to allow you to easily modify packets.

    TLDR; This is not NMS. This will work cross version. This works in 1.7.

    Also oops, just reallized I'm using a REALLY old copy of PacketWrapper. I'll update it right now.

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

    filoghost

    Sorry Goblom, but I've already started the development 1 day ago :p Is that a problem for you? I thought about a plugin as soon as I saw the video...
     
  4. Offline

    user_90854156

    Aahh, I was thinking about doing the excact same thing D:
    Nice job tho, now I don't have to pop my brain making this :)
     
  5. This looks VERY nice and I will no doubt be using this sometime soon. Great job!
     
  6. Offline

    gyroninja

    Updated to the new https://github.com/aadnk/PacketWrapper PacketWrapper

    ...I was using 3 month old version.

    If you had the old sources it did work with 1.7. I guess it must have been a little confusing.
     
  7. Offline

    DevRosemberg

  8. Offline

    Goblom

    When you posted the code yesterday you were using Packet18SpawnMob (NMS), Packet17SpawnObjectVehicle (NMS), Packet27AttachEntity (NMS) and WrappedDataWatcher (PacketWrapper).

    About 15 minutes ago you updated everything to @aandk's PacketWrapper, which uses ProtocolLib.

    So please, no false information was spread. It was perfectly sound just up until 15 minutes ago.
     
  9. Offline

    gyroninja

    DevRosemberg
    Look into the original post. I updated it there. This does require ProtocolLib and PacketWrapper as
    a dependency.

    I'll be working on some improvements to this system to make nametags a bit easier to update and move.
     
  10. Offline

    Goblom

    filoghost Not a problem at all, if there is only one hologram plugin out there then there is no competition to make your version better.
     
  11. Offline

    filoghost

    Goblom You're right, good point. Are you planning to use NMS or packets?
     
  12. Offline

    Goblom

  13. Offline

    DevRosemberg

    Credits go to Comphenix
    Code:java
    1. package com.comphenix.example;
    2.  
    3. import org.bukkit.Location;
    4. import org.bukkit.command.Command;
    5. import org.bukkit.command.CommandSender;
    6. import org.bukkit.entity.EntityType;
    7. import org.bukkit.entity.Player;
    8. import org.bukkit.event.Listener;
    9. import org.bukkit.plugin.java.JavaPlugin;
    10.  
    11. import com.comphenix.protocol.wrappers.WrappedDataWatcher;
    12.  
    13. public class DisplayFloatingText extends JavaPlugin implements Listener {
    14. private static int entityId = Short.MAX_VALUE;
    15.  
    16. private static final int WITHER_SKULL = 66;
    17.  
    18. @Override
    19. public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
    20. if (sender instanceof Player) {
    21. Player player = (Player) sender;
    22.  
    23. spawnNametag(player, player.getLocation(), 0.5, "Hello World");
    24. }
    25. return true;
    26. }
    27.  
    28. public static void spawnNametag(Player p, Location loc, double dy, String message) {
    29. WrapperPlayServerSpawnEntityLiving horse = new WrapperPlayServerSpawnEntityLiving();
    30. WrapperPlayServerSpawnEntity skull = new WrapperPlayServerSpawnEntity();
    31. WrapperPlayServerAttachEntity attach = new WrapperPlayServerAttachEntity();
    32.  
    33. // Initialize horse packet
    34. horse.setEntityID(entityId++);
    35. horse.setType(EntityType.HORSE);
    36. setLocation(horse, dy, loc);
    37.  
    38. WrappedDataWatcher wdw = new WrappedDataWatcher();
    39. wdw.setObject(10, message);
    40. wdw.setObject(11, (byte) 1);
    41. wdw.setObject(12, -1700000);
    42. horse.setMetadata(wdw);
    43.  
    44. // Initialize skull packet
    45. skull.setEntityID(entityId++);
    46. skull.setType(WITHER_SKULL);
    47. setLocation(skull, dy, loc);
    48.  
    49. // The horse is riding on the skull
    50. attach.setEntityId(horse.getEntityID());
    51. attach.setVehicleId(skull.getEntityID());
    52.  
    53. horse.sendPacket(p);
    54. skull.sendPacket(p);
    55. attach.sendPacket(p);
    56. }
    57.  
    58. private static void setLocation(WrapperPlayServerSpawnEntity living, double dy, Location location) {
    59. living.setX(location.getX());
    60. living.setY(location.getY() + dy + 55);
    61. living.setZ(location.getZ());
    62. }
    63.  
    64. private static void setLocation(WrapperPlayServerSpawnEntityLiving living, double dy, Location location) {
    65. living.setX(location.getX());
    66. living.setY(location.getY() + dy + 55);
    67. living.setZ(location.getZ());
    68. }
    69. }
     
    Goblom, Hoolean and DSH105 like this.
  14. Offline

    filoghost

    Goblom me too. I'm still not sure if I am able to make it. How is your development proceeding?
     
  15. Offline

    Goblom

    filoghost Lets continue in PM, we are kind of cluttering up this topic

    DevRosemberg Thats cheating! NMS only!
     
  16. Offline

    viper_monster

    DevRosemberg Goblom why is this so dark? :O I can barely see it... :p
    [​IMG]

    PHP:
    spawnNametag(player, new Location(player.getWorld(), 1265.5162, -717.5), 0.25"This is a test Hologram!");
     
  17. Offline

    Goblom

    spoljo666 Im guessing its because you don't ColorCode attached to it.

    Try something like this...
    Code:java
    1. spawnNametag(player, new Location(player.getWorld(), 1265.5, 162, -717.5), 0.25, ChatColor.White + "This is a test Hologram!");
     
  18. Offline

    viper_monster

    Goblom still the same thing :/
     
  19. Offline

    Garris0n

  20. Offline

    viper_monster

    Garris0n I have removed everything in radius of 10 blocks and still nothing
     
  21. Offline

    Garris0n

  22. Offline

    viper_monster

  23. Offline

    Goblom

    spoljo666 Try placing the text outside. It might have something to do with the sun (Ohhhh Mighty Square sun)
     
    Garris0n and spoljo666 like this.
  24. Offline

    viper_monster

    Goblom It worked! Here's your cookie!
    [​IMG]
     
    Goblom likes this.
  25. Offline

    MrAwellstein

    Mfw, this is amazing.
     
  26. Offline

    Goblom

    I wonder why that is...

    -------------
    The darkness could of happened because the horse/skull whatever was inside a block

    It could have also happened because the horse was in a very dark area.
     
  27. Offline

    viper_monster

    Goblom it was in a dark area :p
     
  28. Offline

    MrAwellstein


    I'd love to get my hands on that once you're done :p

    Btw, I just realized that we can create real custom GUI's with this. we can have the created entity follow, and possibly only be visible to certain players, allowing a nice user interface to exist. Anyone want to work together and see about creating it?

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

    DevRosemberg

  30. Offline

    Ultimate_n00b

    Annnd done with NMS version <3
     
    MrAwellstein likes this.
Thread Status:
Not open for further replies.

Share This Page