[Tutorial] Utilizing the Boss Health Bar

Discussion in 'Resources' started by chasechocolate, Jul 5, 2013.

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

    BungeeTheCookie

  2. Offline

    imaboy321

    BungeeTheCookie It's required D: SoThatsIt Nevermined. I fixed the percent thing. (Was accidentally set to 0). Removing it still doesn't work.

    Edit: Found that I accidentally set the wrong thing to false. It works now!
     
  3. Offline

    MrDynamo

  4. Offline

    ice374

  5. Offline

    Quaro

  6. Offline

    darkness1999

    Micius

    This code does not work for 1.7.2.
     
  7. Offline

    Quaro

  8. Offline

    darkness1999

    Micius

    Could you publish a fixed version here?
     
  9. Offline

    Quaro

    darkness1999 1.7 had more protocol changes than i thinked... Sorry, I can't help.
     
  10. Offline

    MrDynamo


    Read the thread
     
  11. Offline

    sgavster

    Minnymin3 I'm getting this error (in eclipse)
    Code:java
    1. Type mismatch: cannot convert from WorldServer to World

    on the line
    Code:java
    1. this.world = ((CraftWorld) loc.getWorld()).getHandle();


    My imports:
    Code:java
    1. import java.lang.reflect.InvocationTargetException;
    2. import java.lang.reflect.Method;
    3. import java.lang.reflect.Field;
    4. import java.util.HashMap;
    5. import java.util.Map;
    6.  
    7. import net.minecraft.server.v1_7_R1.DataWatcher;
    8. import net.minecraft.server.v1_7_R1.EntityEnderDragon;
    9. import net.minecraft.server.v1_7_R1.PacketPlayOutEntityDestroy;
    10. import net.minecraft.server.v1_7_R1.PacketPlayOutEntityMetadata;
    11. import net.minecraft.server.v1_7_R1.PacketPlayOutEntityTeleport;
    12. import net.minecraft.server.v1_7_R1.PacketPlayOutSpawnEntityLiving;
    13.  
    14. import org.bukkit.Location;
    15. import org.bukkit.World;
    16. import org.bukkit.craftbukkit.v1_7_R1.CraftWorld;
    17. import org.bukkit.entity.Entity;
    18. import org.bukkit.entity.Player;


    Thanks for any help :D
    EDIT: I think I fixed it.
     
  12. Offline

    Quaro

    Anyone have working version for 1.7.2?
    ---edit---
    Nevermind, fixed by my self.
     
  13. Offline

    ftbastler

    Good job! I really wanna see this updated for 1.7!
     
  14. Offline

    eaxoftw

    can someone tell me how i can use this in my server because all i see is code's is there a download so i can drag and drop it into my pugins folder and customize it?
     
  15. Offline

    Quaro

    eaxoftw Everything is done by programming with JAVA. It's not a plugin, it's just a part of code, to help developers.
     
    Garris0n likes this.
  16. Offline

    Garris0n

    There is a plugin called BarAPI but you need other plugins to interface with it as well. There are some.
     
    DrMedia likes this.
  17. Offline

    ldyte3

    What do you do with it i pasted
    1. PacketUtils.displayTextBar(ChatColor.GREEN + "Hello there, " + player.getName() + "!", player);
    and it doesnt work PacketUtils in underlined and says Syntax error on token(s), misplaced construct(s) please help. I bet i am just being dumb
     

    Attached Files:

  18. Offline

    ftbastler

    GermanCoding, Garris0n and DrMedia like this.
  19. Offline

    GermanCoding

  20. Offline

    Survivorman

    It seems like in 1.7 setting the DataWatcher's invisibility flag (watcher.a(0, (byte) 0x20)) will only work if you use NMS. @ftbastler's code works just fine, the fake entity is invisible, however with this reflection class I wrote up the entity is visible. It should be doing the same thing, right? I can't figure out what's going on. It's the same if you use ProtocolLib, entity is always visible. Here's a simple example using reflection, test it out.
     
  21. Offline

    hamzaxx

    chasechocolate The methods in the updated 1.7 version are very different.
     
  22. Offline

    scarabcoder

    Hey, thanks for making this, but how do I set it up? Do I paste it into my main class?

    chasechocolate Any help?

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

    DrJava

    scarabcoder No, put it in a new class and call the methods.
     
  24. Offline

    jusjus112

    chasechocolate
    I have your code, but in my main class gives my an error, for class not found?
    I use version 1;
    My error:
    PHP:
    24.12 09:55:56 [ServerWARNING No compatible nms block class found.
    24.12 09:55:56 [MulticraftSkipped 3 lines due to rate limit (30/s)
    24.12 09:55:54 [ServerINFO at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:53)
    24.12 09:55:54 [Multicraftjusjus112 ran command Bericht van de dag
    24.12 09
    :55:54 [ServerINFO at org.bukkit.plugin.java.PluginClassLoader.findClass0(PluginClassLoader.java:70)
    24.12 09:55:54 [ServerINFO Caused byjava.lang.ClassNotFoundExceptionnet.minecraft.server.v1_6_R2.Packet
    24.12 09
    :55:54 [ServerINFO ... 14 more
    24.12 09
    :55:54 [ServerINFO at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:425)
    24.12 09:55:54 [ServerINFO at java.lang.reflect.Method.invoke(Method.java:601)
    24.12 09:55:54 [ServerINFO at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    24.12 09:55:54 [ServerINFO at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    24.12 09:55:54 [ServerINFO at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    24.12 09:55:54 [ServerINFO at Minigame.Main.onPlayerJoin(Main.java:50)
    24.12 09:55:54 [ServerINFO Caused byjava.lang.NoClassDefFoundErrornet/minecraft/server/v1_6_R2/Packet
    24.12 09
    :55:54 [ServerINFO at net.minecraft.server.v1_6_R3.ThreadServerApplication.run(SourceFile:583)
    24.12 09:55:54 [ServerINFO at net.minecraft.server.v1_6_R3.MinecraftServer.run(MinecraftServer.java:421)
    24.12 09:55:54 [ServerINFO at net.minecraft.server.v1_6_R3.MinecraftServer.s(MinecraftServer.java:488)
    24.12 09:55:54 [ServerINFO at net.minecraft.server.v1_6_R3.DedicatedServer.t(DedicatedServer.java:227)
    24.12 09:55:54 [ServerINFO at net.minecraft.server.v1_6_R3.MinecraftServer.t(MinecraftServer.java:592)
    24.12 09:55:54 [ServerINFO at net.minecraft.server.v1_6_R3.DedicatedServerConnection.b(SourceFile:29)
    24.12 09:55:54 [ServerINFO at net.minecraft.server.v1_6_R3.DedicatedServerConnectionThread.a(DedicatedServerConnectionThread.java:41)
    24.12 09:55:54 [ServerINFO at net.minecraft.server.v1_6_R3.PendingConnection.d(PendingConnection.java:43)
    24.12 09:55:54 [ServerINFO at net.minecraft.server.v1_6_R3.PendingConnection.e(PendingConnection.java:132)
    24.12 09:55:54 [ServerINFO at net.minecraft.server.v1_6_R3.PlayerList.a(PlayerList.java:103)
    24.12 09:55:54 [ServerINFO at net.minecraft.server.v1_6_R3.PlayerList.c(PlayerList.java:207)
    24.12 09:55:54 [ServerINFO at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:462)
    24.12 09:55:54 [ServerINFO at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:477)
    24.12 09:55:54 [ServerINFO at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62)
    24.12 09:55:54 [ServerINFO at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:427)
    24.12 09:55:54 [ServerINFO org.bukkit.event.EventException
    24.12 09
    :55:54 [ServerSEVERE Could not pass event PlayerJoinEvent to ZombieSurvival v0.1
    And my code:
    Code:java
    1. @EventHandler
    2. public void onPlayerJoin(PlayerJoinEvent e) {
    3. PacketUtils.displayTextBar(ChatColor.GREEN + "Hello there, " + e.getPlayer().getName() + "!", e.getPlayer()); //My error
    4. }
     
  25. Offline

    darkness1999

    jusjus112

    Version 1 is not compatible with 1.7.X also not Version 2.
    This library is not updated for 1.7.X.
     
  26. Offline

    jusjus112

  27. Offline

    DrJava

    Actually, this library is.
     
    darkness1999 likes this.
  28. Offline

    scarabcoder

    DrJava I remember getting an error, in Eclipse, lemme check what it was.
    EDIT: Okay, I have two problems. First, it can't find com.chasechocolate. Secondly, it can't find cAPI. How do I fix?
    EDIT2: I fixed the first problem
     
  29. Offline

    ldyte3

    @chasechoclate what do i change bukkitgames.getInstance to its underlined ?????? or any if they can help?
     
  30. Offline

    maciekmm

    To your plugin's mine class.
     
Thread Status:
Not open for further replies.

Share This Page