PVP9dc Looks to me that this person had to get down and dirty with NMS. Here's a "custom packet" he made for it: https://github.com/wacossusca34/nametagedit/blob/master/src/ca/wacos/nametagedit/Packet209Mod.java
PVP9dc NameTagEdit does not look outdated to me... It doesn't import directly into org.bukkit.craftbukkit craftbukkit or net.minecraft. So, the plugin should still work. In any case, if you need an API for 16+ characters why not use this and if doesn't work you should update it
But it uses reflection to get access to methods and fields in craftbukkit and net.minecraft, which could have changed names/meaning. So that doesn't mean anything.
blablubbabc It uses Reflection to get the correct classes for the current version of CraftBukkit you are using... How Do i Know!? Edit: Just re-read your post... Yes, these imports will only work if names have not changed but i seriously doubt that they have changed since 1.6.1
Can you show your code? The objective name cannot be above 16 characters, but the Display name can be.
PVP9dc If you want to depend on another plugin then you can add my AnimationLib. It contains a Packet framework which allows you to easily craft and send packets. You can use it like this: Code:java Packet packet = new Packet(PacketType.TEAMS);//then you can set values by doing:packet.write(<key>, <value>); The library is still a massive work in progress but you can just add the jar to your plugin; I will soon set up a dev-bukkit page where people can download it so if you decide to use it then you can tell them to get it there. Anyways; here is a mediafire download: <Edit by Moderator: Redacted mediafire url>
Code:java Random r = new Random(); Packet packet = new Packet(PacketType.UPDATE_SIGN); //then you can set values by doing: packet.write("X", -505); packet.write("Y",(short) 13); packet.write("Z", -41); packet.write("Line 1", "§c" + p.getName()); packet.write("Line 2", "§e" + r.nextInt(10000)); packet.write("Line 3", "§e" + r.nextInt(10000)); packet.write("Line 4", "§e" + r.nextInt(10000)); PlayerUtil.sendPacket(p, packet); What is wrong CaptainBern or is the problem that i use the new 1.7 spigot build?
PVP9dc Well first of all, I do not work with Spigot and it is not supported here, so I do not know if the packet fields are correct. (if Spigot didn't touched the packet fields then I'm sure those are incorrect) In the source code the fields are: x, y, z and "lines", a string array that contains the 4 lines on the sign. In this case your code should be: Code:java Random r = new Random();Packet packet = new Packet(PacketType.UPDATE_SIGN);packet.write("x", -505);packet.write("y", 13); //the fields are integerspacket.write("z", -41); String[] lines = new String[]{"§c" + p.getName(),"§e" + String.parseString(r.nextInt(10000),"§e" + String.parseString(r.nextInt(10000),"§e" +String.parseString(r.nextInt(10000)} packet.write("lines", lines); PlayerUtil.sendPacket(player, packet);
CaptainBern Code:java Caused by: java.lang.IllegalArgumentException: Can not set int field net.minecraft.server.v1_6_R3.Packet130UpdateSign.x to java.lang.Double Idk... My Code: Code:java double X = Double.parseDouble(getConfig().getString("signrefresh.X")); double Y = Double.parseDouble(getConfig().getString("signrefresh.Y")); double Z = Double.parseDouble(getConfig().getString("signrefresh.Z")); Random r = new Random(); Packet packet = new Packet(PacketType.UPDATE_SIGN); packet.write("x", X); packet.write("y", Y); //the fields are integers packet.write("z", Z); String[] lines = new String[]{ "§c" + p.getName(), "§e" + "game", "§e" + "leer", "§e" + "none" }; packet.write("lines", lines); PlayerUtil.sendPacket(p, packet);
PVP9dc do Integer.parseInteger(x) y and z, the field requires a an Integer and you're passing doubles.
Ok ! Now its working Thanks Code:java int X = Integer.parseInt(getConfig().getString("signrefresh.X")); int Y = Integer.parseInt(getConfig().getString("signrefresh.Y")); int Z = Integer.parseInt(getConfig().getString("signrefresh.Z")); Random r = new Random(); Packet packet = new Packet(PacketType.UPDATE_SIGN); packet.write("x", X); packet.write("y", Y); //the fields are integers packet.write("z", Z); String[] lines = new String[]{ "§c" + p.getName(), "§e" + "game", "§e" + "leer", "§e" + "none" }; packet.write("lines", lines); PlayerUtil.sendPacket(p, packet);