Why Is My Client Crashing?

Discussion in 'Plugin Development' started by BungeeTheCookie, Jun 6, 2014.

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

    BungeeTheCookie

    The Crash Report:
    PHP:
    [17:35:32 INFO]: Client> [17:35:32] [Client thread/FATAL]: Unreported exception thrown!
    [
    17:35:32 INFO]: Clientjava.lang.NullPointerException
    [17:35:32 INFO]: Client>    at net.minecraft.client.network.NetHandlerPlayClient.func_147281_a(NetHandlerPlayClient.java:730) ~[biv.class:?]
    [
    17:35:32 INFO]: Client>    at net.minecraft.network.play.server.S0FPacketSpawnMob.func_148833_a(SourceFile:97) ~[fq.class:?]
    [
    17:35:32 INFO]: Client>    at net.minecraft.network.play.server.S0FPacketSpawnMob.func_148833_a(SourceFile:15) ~[fq.class:?]
    [
    17:35:32 INFO]: Client>    at net.minecraft.network.NetworkManager.func_74428_b(NetworkManager.java:197) ~[ef.class:?]
    [
    17:35:32 INFO]: Client>    at net.minecraft.client.multiplayer.PlayerControllerMP.func_78765_e(PlayerControllerMP.java:273) ~[biy.class:?]
    [
    17:35:32 INFO]: Client>    at net.minecraft.client.Minecraft.func_71407_l(Minecraft.java:1541) ~[azd.class:?]
    [
    17:35:32 INFO]: Client>    at net.minecraft.client.Minecraft.func_71411_J(Minecraft.java:916) ~[azd.class:?]
    [
    17:35:32 INFO]: Client>    at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:835) [azd.class:?]
    [
    17:35:32 INFO]: Client>    at net.minecraft.client.main.Main.main(SourceFile:103) [Main.class:?]
    [
    17:35:32 INFO]: Client>    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0]
    [
    17:35:32 INFO]: Client>    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0]
    [
    17:35:32 INFO]: Client>    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0]
    [
    17:35:32 INFO]: Client>    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0]
    [
    17:35:32 INFO]: Client>    at net.minecraft.launchwrapper.Launch.launch(Launch.java:134) [launchwrapper-1.9.jar:?]
    [
    17:35:32 INFO]: Client>    at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.9.jar:?]
    [
    17:35:32 INFO]: Client> ---- Minecraft Crash Report ----
    [
    17:35:32 INFO]: Client// Ooh. Shiny.
    [17:35:32 INFO]: Client>
    [
    17:35:32 INFO]: ClientTime6/6/14 5:35 PM
    [17:35:32 INFO]: ClientDescriptionUnexpected error
    [17:35:32 INFO]: Client>
    [
    17:35:32 INFO]: Clientjava.lang.NullPointerExceptionUnexpected error
    [17:35:32 INFO]: Client>    at net.minecraft.client.network.NetHandlerPlayClient.func_147281_a(NetHandlerPlayClient.java:730)
    [
    17:35:32 INFO]: Client>    at net.minecraft.network.play.server.S0FPacketSpawnMob.func_148833_a(SourceFile:97)
    [
    17:35:32 INFO]: Client>    at net.minecraft.network.play.server.S0FPacketSpawnMob.func_148833_a(SourceFile:15)
    [
    17:35:32 INFO]: Client>    at net.minecraft.network.NetworkManager.func_74428_b(NetworkManager.java:197)
    [
    17:35:32 INFO]: Client>    at net.minecraft.client.multiplayer.PlayerControllerMP.func_78765_e(PlayerControllerMP.java:273)
    [
    17:35:32 INFO]: Client>    at net.minecraft.client.Minecraft.func_71407_l(Minecraft.java:1541)
    [
    17:35:32 INFO]: Client>    at net.minecraft.client.Minecraft.func_71411_J(Minecraft.java:916)
    [
    17:35:32 INFO]: Client>    at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:835)
    [
    17:35:32 INFO]: Client>    at net.minecraft.client.main.Main.main(SourceFile:103)
    [
    17:35:32 INFO]: Client>    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    [
    17:35:32 INFO]: Client>    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    [
    17:35:32 INFO]: Client>    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    [
    17:35:32 INFO]: Client>    at java.lang.reflect.Method.invoke(Unknown Source)
    [
    17:35:32 INFO]: Client>    at net.minecraft.launchwrapper.Launch.launch(Launch.java:134)
    [
    17:35:32 INFO]: Client>    at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
    [
    17:35:32 INFO]: Client>
    [
    17:35:32 INFO]: Client>
    [
    17:35:32 INFO]: ClientA detailed walkthrough of the errorits code path and all known details is as follows:
    [
    17:35:32 INFO]: Client> ---------------------------------------------------------------------------------------
    [
    17:35:32 INFO]: Client>
    [
    17:35:32 INFO]: Client> -- Head --
    [
    17:35:32 INFO]: ClientStacktrace:
    [
    17:35:32 INFO]: Client>    at net.minecraft.client.network.NetHandlerPlayClient.func_147281_a(NetHandlerPlayClient.java:730)
    [
    17:35:32 INFO]: Client>    at net.minecraft.network.play.server.S0FPacketSpawnMob.func_148833_a(SourceFile:97)
    [
    17:35:32 INFO]: Client>    at net.minecraft.network.play.server.S0FPacketSpawnMob.func_148833_a(SourceFile:15)
    [
    17:35:32 INFO]: Client>    at net.minecraft.network.NetworkManager.func_74428_b(NetworkManager.java:197)
    [
    17:35:32 INFO]: Client>    at net.minecraft.client.multiplayer.PlayerControllerMP.func_78765_e(PlayerControllerMP.java:273)
    [
    17:35:32 INFO]: Client>
    [
    17:35:32 INFO]: Client> -- Affected level --
    [
    17:35:32 INFO]: ClientDetails:
    [
    17:35:32 INFO]: Client>    Level nameMpServer
    [17:35:32 INFO]: Client>    All players1 total; [EntityClientPlayerMP['Bungeecookie'/6256l='MpServer'x=-172.80y=131.12z=-679.31]]
    [
    17:35:32 INFO]: Client>    Chunk statsMultiplayerChunkCache441441
    [17:35:32 INFO]: Client>    Level seed0
    [17:35:32 INFO]: Client>    Level generatorID 00 - default, ver 1. Features enabledfalse
    [17:35:32 INFO]: Client>    Level generator options:
    [
    17:35:32 INFO]: Client>    Level spawn locationWorld: (-418,106,-292), Chunk: (at 14,6,12 in -27,-19contains blocks -432,0,-304 to -417,255,-289), Region: (-1,-1contains chunks -32,-32 to -1,-1blocks -512,0,-512 to -1,255,-1)
    [
    17:35:32 INFO]: Client>    Level time6224605 game time778101 day time
    [17:35:32 INFO]: Client>    Level dimension0
    [17:35:32 INFO]: Client>    Level storage version0x00000 Unknown?
    [
    17:35:32 INFO]: Client>    Level weatherRain time(nowfalse), thunder time(nowfalse)
    [
    17:35:32 INFO]: Client>    Level game modeGame modecreative (ID 1). HardcorefalseCheatsfalse
    [17:35:32 INFO]: Client>    Forced entities34 total; [EntitySheep['Sheep'/8469l='MpServer'x=-214.16y=71.00z=-727.78], EntitySheep['Sheep'/8472l='MpServer'x=-209.16y=66.00z=-723.13], EntitySheep['Sheep'/8475l='MpServer'x=-194.50y=71.00z=-727.50], EntitySheep['Sheep'/8476l='MpServer'x=-183.97y=69.00z=-713.03], EntityChicken['Chicken'/8477l='MpServer'x=-189.53y=68.00z=-723.53], EntityChicken['Chicken'/8478l='MpServer'x=-182.69y=69.00z=-725.81], EntityChicken['Chicken'/8479l='MpServer'x=-185.63y=69.00z=-723.41], EntityChicken['Chicken'/8480l='MpServer'x=-207.47y=65.00z=-726.56], EntityCreeper['Creeper'/11040l='MpServer'x=-159.50y=38.00z=-659.50], EntityMinecartChest['entity.MinecartChest.name'/8481l='MpServer'x=-218.50y=29.50z=-743.50], EntitySheep['Sheep'/8482l='MpServer'x=-152.13y=69.00z=-691.38], EntitySheep['Sheep'/8483l='MpServer'x=-167.75y=71.00z=-690.63], EntitySheep['Sheep'/8484l='MpServer'x=-155.84y=72.00z=-699.88], EntitySheep['Sheep'/8485l='MpServer'x=-174.50y=71.00z=-685.28], EntitySpider['Spider'/11304l='MpServer'x=-147.50y=68.00z=-687.50], EntityZombie['Zombie'/11317l='MpServer'x=-187.52y=69.00z=-689.70], EntitySkeleton['Skeleton'/10322l='MpServer'x=-214.50y=42.00z=-689.50], EntityCreeper['Creeper'/10323l='MpServer'x=-163.50y=36.00z=-659.50], EntityClientPlayerMP['Bungeecookie'/6256l='MpServer'x=-172.80y=131.12z=-679.31], EntitySkeleton['Skeleton'/10075l='MpServer'x=-200.69y=33.00z=-673.22], EntityZombie['Zombie'/9819l='MpServer'x=-164.50y=67.00z=-667.50], EntitySkeleton['Skeleton'/10603l='MpServer'x=-173.75y=36.00z=-660.31], EntityCreeper['Creeper'/10097l='MpServer'x=-186.50y=31.00z=-660.50], EntityCreeper['Creeper'/10098l='MpServer'x=-183.50y=31.00z=-662.50], EntityCreeper['Creeper'/10618l='MpServer'x=-201.50y=16.00z=-646.50], EntityZombie['Zombie'/10881l='MpServer'x=-129.50y=67.00z=-644.50], EntityItem['item.tile.sapling.spruce'/10899l='MpServer'x=-147.59y=66.13z=-672.13], EntityItem['item.tile.flower2.poppy'/10387l='MpServer'x=-143.88y=67.13z=-663.88], EntityCreeper['Creeper'/10647l='MpServer'x=-183.50y=31.00z=-660.50], EntityCreeper['Creeper'/10648l='MpServer'x=-185.50y=31.00z=-663.50], EntityCreeper['Creeper'/11427l='MpServer'x=-137.50y=26.00z=-664.50], EntityCreeper['Creeper'/9912l='MpServer'x=-213.22y=38.00z=-726.69], EntitySpider['Spider'/10454l='MpServer'x=-216.78y=39.00z=-703.06], EntitySkeleton['Skeleton'/10478l='MpServer'x=-210.50y=30.00z=-646.50]]
    [
    17:35:32 INFO]: Client>    Retry entities0 total; []
    [
    17:35:32 INFO]: ClientStacktrace:
    [
    17:35:32 INFO]: Client>    at net.minecraft.client.multiplayer.WorldClient.func_72914_a(WorldClient.java:368)
    [
    17:35:32 INFO]: Client>    at net.minecraft.client.Minecraft.func_71396_d(Minecraft.java:2382)
    [
    17:35:32 INFO]: Client>    at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:864)
    [
    17:35:32 INFO]: Client>    at net.minecraft.client.main.Main.main(SourceFile:103)
    [
    17:35:32 INFO]: Client>    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    [
    17:35:32 INFO]: Client>    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    [
    17:35:32 INFO]: Client>    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    [
    17:35:32 INFO]: Client>    at java.lang.reflect.Method.invoke(Unknown Source)
    [
    17:35:32 INFO]: Client>    at net.minecraft.launchwrapper.Launch.launch(Launch.java:134)
    [
    17:35:32 INFO]: Client>    at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
    The Entity Class:
    Code:java
    1. import net.minecraft.server.v1_7_R3.*;
    2. import org.bukkit.Bukkit;
    3. import org.bukkit.Location;
    4. import org.bukkit.craftbukkit.v1_7_R3.CraftWorld;
    5. import org.bukkit.scheduler.BukkitRunnable;
    6.  
    7. import java.lang.reflect.Field;
    8. import java.util.List;
    9.  
    10. public class DisplayChicken extends EntityChicken {
    11.  
    12. private ClassDisplay display;
    13.  
    14. public DisplayChicken(World world, ClassDisplay display){
    15. super(world);
    16. List goalB = (List)getPrivateField("b", PathfinderGoalSelector.class, goalSelector); goalB.clear();
    17. List goalC = (List)getPrivateField("c", PathfinderGoalSelector.class, goalSelector); goalC.clear();
    18. List targetB = (List)getPrivateField("b", PathfinderGoalSelector.class, targetSelector); targetB.clear();
    19. List targetC = (List)getPrivateField("c", PathfinderGoalSelector.class, targetSelector); targetC.clear();
    20. this.display = display;
    21. this.goalSelector.a(6, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 6.0F));
    22. this.goalSelector.a(7, new PathfinderGoalRandomLookaround(this));
    23. this.fireProof = true;
    24. }
    25.  
    26. public ClassDisplay getDisplay(){
    27. return display;
    28. }
    29.  
    30. public static Object getPrivateField(String fieldName, Class clazz, Object object){
    31. Field field;
    32. Object o = null;
    33. try{
    34. field = clazz.getDeclaredField(fieldName);
    35. field.setAccessible(true);
    36. o = field.get(object);
    37. }
    38. e.printStackTrace();
    39. }
    40. e.printStackTrace();
    41. }
    42. return o;
    43. }
    44.  
    45. @Override
    46. protected void aC(){
    47. super.aC();
    48. this.getAttributeInstance(GenericAttributes.a).setValue(100000.0D);
    49. this.getAttributeInstance(GenericAttributes.b).setValue(0.000D);
    50. this.getAttributeInstance(GenericAttributes.c).setValue(100000.D);
    51. this.getAttributeInstance(GenericAttributes.d).setValue(0.000D);
    52. }
    53.  
    54. @Override
    55. public void collide(Entity entity){
    56.  
    57. }
    58.  
    59. @Override
    60. public void g(double d0, double d1, double d2){
    61.  
    62. }
    63.  
    64. public void spawn(final Location l){
    65. setLocation(l.getX(), l.getY(), l.getZ(), 0F, 0F);
    66. ((CraftWorld) l.getWorld()).getHandle().addEntity(this);
    67. Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(Bukkit.getServer().getPluginManager().getPlugin("FlappyBirds"), new BukkitRunnable(){
    68. public void run() {
    69. getBukkitEntity().teleport(l.add(0.0D, 0.1D, 0.0D));
    70. }
    71. }, 0L, 5L);
    72. }
    73. }
    74.  


    The Class For Registering The Entities:
    Code:java
    1. public class NMSHandler {
    2.  
    3. @SuppressWarnings("unchecked")
    4. public static void registerEntity(String name, int id, Class<? extends EntityInsentient> customClass) {
    5. try {
    6. List<Map<?, ?>> dataMaps = new ArrayList<Map<?, ?>>();
    7. for (Field f : EntityTypes.class.getDeclaredFields()) {
    8. if (f.getType().getSimpleName().equals(Map.class.getSimpleName())) {
    9. f.setAccessible(true);
    10. dataMaps.add((Map<?, ?>) f.get(null));
    11. }
    12. }
    13.  
    14. ((Map<Class<? extends EntityInsentient>, String>) dataMaps.get(1)).put(customClass, name);
    15. ((Map<Class<? extends EntityInsentient>, Integer>) dataMaps.get(3)).put(customClass, id);
    16.  
    17. } catch (Exception e) {
    18. e.printStackTrace();
    19. }
    20. }
    21. }
    22.  


    The Registration:
    Code:java
    1. NMSHandler.registerEntity("DisplayChicken", 76, DisplayChicken.class);


    Class That Uses The Display Chicken:
    Code:java
    1. public void spawnDisplayChicken(ClassBase base, Location l){
    2. ClassDisplay display = new ClassDisplay(base, l);
    3. ConfigurationSection s = getSection("classDisplays").createSection(display.getClassBase().getName());
    4. LocationUtil.setLocation(s, l);
    5. LobbyConfig.saveLobbyConfig(plugin);
    6. classDisplays.add(display);
    7. DisplayChicken chicken = new DisplayChicken(((CraftWorld)l.getWorld()).getHandle(), display);
    8. chicken.spawn(l);
    9. }
    10.  
    11. public ClassDisplay getClassDisplay(String className){
    12. try{
    13. Location l = LocationUtil.getLocation(getSection("classDisplays." + className));
    14. ClassDisplay display = new ClassDisplay(ClassManager.getInstance().getClass(className), l);
    15. return display;
    16. }catch(Exception e){
    17. e.printStackTrace();
    18. return null;
    19. }
    20. }
    21.  
    22. private void loadClassDisplays(){
    23. try{
    24. isClassDisplaysLoaded = true;
    25. for(String key : getSection("classDisplays").getKeys(false)){
    26. ClassDisplay display = getClassDisplay(key);
    27. classDisplays.add(display);
    28. Location l = display.getLocation();
    29. DisplayChicken chicken = new DisplayChicken(((CraftWorld)l.getWorld()).getHandle(), display);
    30. chicken.spawn(l);
    31. }
    32. }catch(Exception e){
    33.  
    34. }
    35. }

    bigteddy98 xTrollxDudex Cirno
     
  2. Offline

    Plo124

  3. Offline

    Deleted user

    BungeeTheCookie

    I'm pretty sure the name and id has to match the one you're replacing. Is the id for chicken 76?

    And set the name to Chicken not DisplayChicken
     
  4. Offline

    BungeeTheCookie

    Im not replacing it. @bigteddy98's library said it does not replace the entity you already have. So why does it still have to be the same? Can I change the name and ID of it using getID() and getString() and returning a different one? Or can I just do that, but when I am registering it, it has to be the same as the regular Chicken entity?

    If I can do it (this is my first day of working with NMS) you can too.

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

    Deleted user

  6. Offline

    BungeeTheCookie

    Nope. Doesn't work
    PHP:
    ---- Minecraft Crash Report ----
    // Hey, that tickles! Hehehe!
     
    Time6/6/14 8:26 PM
    Description
    Unexpected error
     
    java
    .lang.NullPointerExceptionUnexpected error
        at net
    .minecraft.client.network.NetHandlerPlayClient.func_147281_a(NetHandlerPlayClient.java:730)
        
    at net.minecraft.network.play.server.S0FPacketSpawnMob.func_148833_a(SourceFile:97)
        
    at net.minecraft.network.play.server.S0FPacketSpawnMob.func_148833_a(SourceFile:15)
        
    at net.minecraft.network.NetworkManager.func_74428_b(NetworkManager.java:197)
        
    at net.minecraft.client.multiplayer.PlayerControllerMP.func_78765_e(PlayerControllerMP.java:273)
        
    at net.minecraft.client.Minecraft.func_71407_l(Minecraft.java:1541)
        
    at net.minecraft.client.Minecraft.func_71411_J(Minecraft.java:916)
        
    at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:835)
        
    at net.minecraft.client.main.Main.main(SourceFile:103)
        
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        
    at java.lang.reflect.Method.invoke(Unknown Source)
        
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:134)
        
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
     
     
    A detailed walkthrough of the errorits code path and all known details is as follows:
    ---------------------------------------------------------------------------------------
     
    -- 
    Head --
    Stacktrace:
        
    at net.minecraft.client.network.NetHandlerPlayClient.func_147281_a(NetHandlerPlayClient.java:730)
        
    at net.minecraft.network.play.server.S0FPacketSpawnMob.func_148833_a(SourceFile:97)
        
    at net.minecraft.network.play.server.S0FPacketSpawnMob.func_148833_a(SourceFile:15)
        
    at net.minecraft.network.NetworkManager.func_74428_b(NetworkManager.java:197)
        
    at net.minecraft.client.multiplayer.PlayerControllerMP.func_78765_e(PlayerControllerMP.java:273)
    NMSHandler.registerEntity("Chicken", 93, DisplayChicken.class);
    Should I use a different registry tool? bigteddy98
     
  7. Offline

    Deleted user

    Code:java
    1. public static void registerCustomEntity(Class<?> clazz, String name, int id) throws Exception {
    2. registerCustomEntity0("c", name, clazz);
    3. registerCustomEntity0("d", clazz, name);
    4. registerCustomEntity0("e", id, clazz);
    5. registerCustomEntity0("f", clazz, id);
    6. registerCustomEntity0("g", name, id);
    7. }
    8.  
    9. protected static void registerCustomEntity0(String fieldName, Object key, Object value) throws Exception {
    10. Field field = EntityTypes.class.getDeclaredField(fieldName);
    11. field.setAccessible(true);
    12. Map<Object, Object> map = (Map<Object, Object>) field.get(null);
    13. map.put(key, value);
    14. field.set(null, map);
    15. }


    This is for 1.7.9, but should work for 1.7.x

    Code:java
    1. registerCustomEntity(DisplayChicken.class, "Chicken", 93)
     
  8. Offline

    BlueMustache

    Lol, If you want to know how to crash your client, I have easier way.
    Download the latest version on my plugin ForceResource! [tnt]
    Or this!

    Code:java
    1. p.setWalkSpeed(0.0F);
    2. p.setWalkSpeed(-1.0F);
    3. p.setWalkSpeed(1.0F);
    4. p.setWalkSpeed(0.0F);
    5. p.setWalkSpeed(0.2F);


    I know this doesn't answer your question, but why not! :p
     
  9. Offline

    Ultimate_n00b

    Why would this crash the client? All it will do is throw an error on your craftbukkit server. Here's some source code from the git.
     
  10. Offline

    Deleted user

  11. Offline

    Gamecube762

    There are a few packets that can do the job easier =P But this is not the thread for that.

    I may not know much about custom entities, but I can point this NPE out:
    [17:35:32 INFO]: Client> java.lang.NullPointerException
    [17:35:32 INFO]: Client> at net.minecraft.network.play.server.S0FPacketSpawnMob.func_148833_a(SourceFile:97)
    [17:35:32 INFO]: Client> at net.minecraft.network.play.server.S0FPacketSpawnMob.func_148833_a(SourceFile:15)
     
  12. Offline

    bigteddy98

    You should have tagged my for a faster reply, BungeeTheCookie ;). But the only client crashes caused by this I've seen so far are all crashed caused by not registering your mob. Be sure the method is actually called, because I can't find it in the code you posted at the top.

    The other problem might be the way you spawn it, I've never seen someone doing it like you are doing it. Please try something like this to make sure your problem isn't in that code:
    Code:java
    1. Player p = null;
    2. CustomEnderDragon dragon = new CustomEnderDragon(((CraftWorld) p.getWorld()).getHandle());
    3. dragon.setLocation(p.getLocation().getX(), p.getLocation().getY(), p.getLocation().getZ(), 0F, 0F);
    4. ((CraftWorld) p.getWorld()).getHandle().addEntity(dragon);

    Hope this helps you, reply to this or tag me for a fast reply ;)

    No that would crash the client when a normal mob spawns. It only works if you should disable default mob spawning.

    or do it in one line by sending the block break effect of an item... But you're completely off-topic :p

    No it's not neccesarily for this method. The ID determines how your entity would look like for the client. Registering a chicking with the ID of a creeper would make friendly egg making creepers with chicken sounds :p

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

    fireblast709

    BungeeTheCookie Since the id is an int, and the packet uses bytes, you could use the chicken id + 256 (iirc) which will send it as a chicken to the client, while its another mob for the server. Moreover there does not seem to be a mob for id 76 (according to the MC wiki), which most likely causes your error
     
  14. Offline

    BungeeTheCookie

    Wow, so many responses... lemme read up on them :p

    Maybe because I am doing the spawning from within the inner class... ;)
    fireblast709 zombiekiller753
    Makes sense because of the NullPointerException, it is calling a World instead of a CraftWorld maybe?

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

    bigteddy98

    what do you mean?
     
  16. Offline

    BungeeTheCookie

    bigteddy98 zombiekiller753 BlueMustache Ultimate_n00b Gamecube762
    Code:
    public void spawnDisplayChicken(ClassDisplay display, final Location l){
            final DisplayChicken chicken = new DisplayChicken(l.getWorld(), display);
            chicken.setLocation(l.getX(), l.getY(), l.getZ(), 0F, 0F);
            ((CraftWorld) l.getWorld()).getHandle().addEntity(chicken);
            Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(Bukkit.getServer().getPluginManager().getPlugin("FlappyBirds"), new BukkitRunnable(){
                public void run() {
                    chicken.getBukkitEntity().teleport(l.add(0.0D, 0.1D, 0.0D));
                }
            }, 0L, 5L);
        }
    Im not using a "Player" because Location can still return a world, but if my client still crashes, I will change the Location parameter to a player.
    EDIT: I mean, maybe spawning it from an inner class crashes the client? bigteddy98

    bigteddy98
    PHP:
    java.lang.NullPointerExceptionTicking screen
        at net
    .minecraft.client.network.NetHandlerPlayClient.func_147281_a(NetHandlerPlayClient.java:730)
        
    at net.minecraft.network.play.server.S0FPacketSpawnMob.func_148833_a(SourceFile:97)
        
    at net.minecraft.network.play.server.S0FPacketSpawnMob.func_148833_a(SourceFile:15)
        
    at net.minecraft.network.NetworkManager.func_74428_b(NetworkManager.java:197)
        
    at net.minecraft.client.multiplayer.GuiConnecting.func_73876_c(SourceFile:76)
        
    at net.minecraft.client.Minecraft.func_71407_l(Minecraft.java:1600)
        
    at net.minecraft.client.Minecraft.func_71411_J(Minecraft.java:916)
        
    at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:835)
        
    at net.minecraft.client.main.Main.main(SourceFile:103)
        
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        
    at java.lang.reflect.Method.invoke(Unknown Source)
        
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:134)
        
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
    That happens when I join, because I am saving all of the display chickens and loading them at the start up.
    EDIT: Seems like it still is the same error.

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

    fireblast709

    BungeeTheCookie have you tried to use an existing entity ID while registering the entity?
     
  18. Offline

    BungeeTheCookie

    Yes, In the registration I am using the same name and ID as the chicken's, I don't know if I am overriding it though.
     
  19. Offline

    Deleted user

  20. Offline

    bigteddy98

    Can you send your whole plugin to my inbox (or upload it to git or something) so I can take a look myself? Including the CraftBukkit version you are running (only the version name, not the whole file :p).
     
  21. Offline

    jpjunho

  22. Offline

    BungeeTheCookie

    zombiekiller753
    Nope. I was using Forge 1.7.2 on a Spigot server, because when I got the client crash on a CraftBukkit server for 1.7.9, it was just a bunch of letters. It is still the same exception, and I am only using Forge to interpret the error. I am definitely not using MCPC+, even though that would spew the same error.

    jpjunho
    Still same error.
     
  23. Offline

    thepaperboy99

    Are you registering the entity right? When I was doing it, I got the same error, and I was only crashing if I didn't register the entity and spawn it correctly. Hope this helps.
     
  24. Offline

    Iroh

    Locked.
    While you claim that you were using spigot only for finding the error we can still not support spigot/forge servers.
     
Thread Status:
Not open for further replies.

Share This Page