Jump to content

Recommended Posts

  • Replies 52
  • Created
  • Last Reply

Top Posters In This Topic

Posted

Okay. Now it's in my main mod class init method. Launched the game, tried to hit a mob from far away, and the game crashed. The console tells me that it's line 65 in MouseEventHandler, which is:

SpearMod.network.sendToServer(new MessageExtendedReachAttack(mov.entityHit.getEntityId()));

 

This is probably because mov.entityHit is null.  You should check for that.

 

Should I remove one of them?

Yes.  @EventHandler is for FML mod lifecycle events.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted

Okay. Now it's in my main mod class init method. Launched the game, tried to hit a mob from far away, and the game crashed. The console tells me that it's line 65 in MouseEventHandler, which is:

SpearMod.network.sendToServer(new MessageExtendedReachAttack(mov.entityHit.getEntityId()));

 

This is probably because mov.entityHit is null.  You should check for that.

 

Should I remove one of them?

Yes.  @EventHandler is for FML mod lifecycle events.

Where does it say that mov.entityHit is null? There is a

if (mov.entityHit != null && mov.entityHit.hurtResistantTime == 0)

Is this what you mean?

Posted

Without seeing your whole code, I can only make guesses.

 

You also didn't post the error, just the line that caused it.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted

Post updated code. Are you sure you are subscribing to right MouseEvent?

Are there multiple MouseEvents?

I will post all of the code that was changed from jabelar's tutorial to fit 1.10 in a bit. I'm not on the same computer that has it right now.

MouseEvent should be donenin client proxy because the server doesnt need to know what do you have inside that method? Are you importing the correct MouseEvent?

net.minecraftforge.client.event.MouseEvent is being imported. I moved it from CommonProxy to ClientProxy, still no difference.

 

 

MouseEventHandler:

package bloopers.spearmod.reach;

import java.awt.List;

import org.lwjgl.input.Mouse;

import bloopers.spearmod.SpearMod;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.RayTraceResult;
import net.minecraft.util.math.Vec3d;
import net.minecraftforge.client.event.MouseEvent;
import net.minecraftforge.fml.client.FMLClientHandler;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.eventhandler.EventPriority;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

public class MouseEventHandler {

    

@SideOnly(Side.CLIENT)
@SubscribeEvent
@EventHandler
public void onEvent(MouseEvent event)
{ 
	int button = event.getButton();
    boolean buttonstate = event.isButtonstate();
    
    
    if (button == 0 && buttonstate)
    {
        Minecraft mc = Minecraft.getMinecraft();
        EntityPlayer thePlayer = mc.thePlayer;
        if (thePlayer != null)
        {
            ItemStack itemstack = thePlayer.getHeldItemMainhand();
            IExtendedReach ieri;
            if (itemstack != null)
            {
                if (itemstack.getItem() instanceof IExtendedReach)
                {
                    ieri = (IExtendedReach) itemstack.getItem();
                } else
                {
                    ieri = null;
                }
   
                if (ieri != null)
                {
                    float reach = ieri.getReach();
                    RayTraceResult mov = getMouseOverExtended(reach); 
                      
                    if (mov != null)
                    {
                        if (mov.entityHit != null && mov.entityHit.hurtResistantTime == 0)
                        {
                            if (mov.entityHit != thePlayer )
                            {
                                SpearMod.network.sendToServer(new MessageExtendedReachAttack(
                                      mov.entityHit.getEntityId()));
                            }
                        }
                    }
                }
            }
        }
    }
}
        
// This is mostly copied from the EntityRenderer#getMouseOver() method
public static RayTraceResult getMouseOverExtended(float dist)
{
    Minecraft mc = FMLClientHandler.instance().getClient();
    Entity theRenderViewEntity = mc.getRenderViewEntity();
    AxisAlignedBB theViewBoundingBox = new AxisAlignedBB(
            theRenderViewEntity.posX-0.5D,
            theRenderViewEntity.posY-0.0D,
            theRenderViewEntity.posZ-0.5D,
            theRenderViewEntity.posX+0.5D,
            theRenderViewEntity.posY+1.5D,
            theRenderViewEntity.posZ+0.5D
            );
    RayTraceResult returnMOP = null;
    if (mc.theWorld != null)
    {
        double var2 = dist;
        returnMOP = theRenderViewEntity.rayTrace(var2, 0);
        double calcdist = var2;
        Vec3d pos = theRenderViewEntity.getPositionEyes(0);
        var2 = calcdist;
        if (returnMOP != null)
        {
            calcdist = returnMOP.hitVec.distanceTo(pos);
        }
         
        Vec3d lookvec = theRenderViewEntity.getLook(0);
        Vec3d var8 = pos.addVector(lookvec.xCoord * var2, 
              lookvec.yCoord * var2, 
              lookvec.zCoord * var2);
        Entity pointedEntity = null;
        float var9 = 1.0F;
        @SuppressWarnings("unchecked")
        java.util.List<Entity> list = mc.theWorld.getEntitiesWithinAABBExcludingEntity(
              theRenderViewEntity, 
              theViewBoundingBox.addCoord(
                    lookvec.xCoord * var2, 
                    lookvec.yCoord * var2, 
                    lookvec.zCoord * var2).expand(var9, var9, var9));
        double d = calcdist;
            
        for (Entity entity : list)
        {
            if (entity.canBeCollidedWith())
            {
                float bordersize = entity.getCollisionBorderSize();
                AxisAlignedBB aabb = new AxisAlignedBB(
                      entity.posX-entity.width/2, 
                      entity.posY, 
                      entity.posZ-entity.width/2, 
                      entity.posX+entity.width/2, 
                      entity.posY+entity.height, 
                      entity.posZ+entity.width/2);
                aabb.expand(bordersize, bordersize, bordersize);
                RayTraceResult mop0 = aabb.calculateIntercept(pos, var8);
                    
                if (aabb.isVecInside(pos))
                {
                    if (0.0D < d || d == 0.0D)
                    {
                        pointedEntity = entity;
                        d = 0.0D;
                    }
                } else if (mop0 != null)
                {
                    double d1 = pos.distanceTo(mop0.hitVec);
                        
                    if (d1 < d || d == 0.0D)
                    {
                        pointedEntity = entity;
                        d = d1;
                    }
                }
            }
        }
           
        if (pointedEntity != null && (d < calcdist || returnMOP == null))
        {
             returnMOP = new RayTraceResult(pointedEntity);
        }
    }
    return returnMOP;
}

}

 

MessageExtendedReachAttack:

package bloopers.spearmod.reach;

import bloopers.spearmod.SpearMod;
import io.netty.buffer.ByteBuf;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraftforge.fml.common.network.ByteBufUtils;
import net.minecraftforge.fml.common.network.simpleimpl.IMessage;
import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler;
import net.minecraftforge.fml.common.network.simpleimpl.MessageContext;

public class MessageExtendedReachAttack implements IMessage 
{
    private int entityId ;

    public MessageExtendedReachAttack() 
    { 
     // need this constructor
    }

    public MessageExtendedReachAttack(int parEntityId) 
    {
     entityId = parEntityId;
        // DEBUG
        System.out.println("Constructor");
    }

    @Override
    public void fromBytes(ByteBuf buf) 
    {
     entityId = ByteBufUtils.readVarInt(buf, 4);
     // DEBUG
     System.out.println("fromBytes");
    }

    @Override
    public void toBytes(ByteBuf buf) 
    {
     ByteBufUtils.writeVarInt(buf, entityId, 4);
        // DEBUG
        System.out.println("toBytes encoded");
    }

    public static class Handler implements IMessageHandler<MessageExtendedReachAttack, 
          IMessage> 
    {
        @Override
        public IMessage onMessage(final MessageExtendedReachAttack message, 
              MessageContext ctx) 
        {
            // DEBUG
            System.out.println("Message received");
            // Know it will be on the server so make it thread-safe
            final EntityPlayerMP thePlayer = (EntityPlayerMP) SpearMod.proxy.
                  getPlayerEntityFromContext(ctx);
            thePlayer.getServer().addScheduledTask(
                  new Runnable()
                  {
                      @Override
                      public void run() 
                      {
                          Entity theEntity = thePlayer.worldObj.
                                getEntityByID(message.entityId);
                          // DEBUG
                          System.out.println("Entity = "+theEntity);
                          
                          // Need to ensure that hackers can't cause trick kills, 
                          // so double check weapon type and reach
                          if (thePlayer.getHeldItemMainhand() == null)
                          {
                              return;
                          }
                          if (thePlayer.getHeldItemMainhand().getItem() instanceof 
                                IExtendedReach)
                          {
                              IExtendedReach theExtendedReachWeapon = 
                                    (IExtendedReach)thePlayer.getHeldItemMainhand().
                                    getItem();
                              double distanceSq = thePlayer.getDistanceSqToEntity(
                                    theEntity);
                              double reachSq =theExtendedReachWeapon.getReach()*
                                    theExtendedReachWeapon.getReach();
                              if (reachSq >= distanceSq)
                              {
                                  thePlayer.attackTargetEntityWithCurrentItem(
                                        theEntity);
                              }
                          }
                          return; // no response in this case
                      }
                }
            );
            return null; // no response message
        }
    }
}

 

IExtendedReach:

package bloopers.spearmod.reach;

public interface IExtendedReach {

    public float getReach(); // default is 1.0D

}

 

And then in item classes to set the reach:

@Override
    public float getReach() 
    {
        return 15.0F;
    }

 

At 15 for testing.

What is button 0?

Jabelar's tutorial says it means left click, so I assume button 1 would also mean right click.

I also have this in my CommonProxy. I'm not sure what to do with it. It's used in MessageExtendedReachAttack.

public EntityPlayerMP getPlayerEntityFromContext(MessageContext ctx) {
	// TODO Auto-generated method stub
	return null;
}

 

This should be all of the code used. Jabelar's tutorial says nothing about getPlayerEntityFromContext and it was generated by eclipse quick-fix.

Posted

You still didn't post the error, however that's likely your problem:

 

You call this method here, storing the result:

final EntityPlayerMP thePlayer = (EntityPlayerMP) SpearMod.proxy.getPlayerEntityFromContext(ctx);

Then you do this:

thePlayer.getServer()

Which won't work because:

return null;

 

You need to make that method return something other than null.  Take a look at the MessageContext object.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted

You still didn't post the error, however that's likely your problem:

 

You call this method here, storing the result:

final EntityPlayerMP thePlayer = (EntityPlayerMP) SpearMod.proxy.getPlayerEntityFromContext(ctx);

Then you do this:

thePlayer.getServer()

Which won't work because:

return null;

You need to make that method return something other than null.  Take a look at the MessageContext object.

There is no error in eclipse, it's in the console when the project is running, it links me to the line that I posted above. I'll take a look at MessageContext now.

Posted

Of course there's not an error.  Eclipse can't tell that you're referencing a null object, that's a runtime problem.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted

Of course there's not an error.  Eclipse can't tell that you're referencing a null object, that's a runtime problem.

Okay.

 

So, in MessageContext I see some stuff returning netHandler. Should I do that?

Posted

Your goal is to locate a player object.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted

Mhm

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted

Mhm

So I changed the return null; to thePlayer and I had to put a cast (IMessage) on it, otherwise I get an error. When I test it, it still crashes when I hit an entity.

Posted

No, that is not what you do. MessageContext is not an IMessage.

 

And you still haven't posted a crash log.

 

Try looking at this:

http://www.minecraftforge.net/forum/index.php?topic=20135.0

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted

If your problem is a crash, read what caused it and try to solve it yourself first. If stumped enough to post about a crash here, you should ALWAYS include (within tags) or link to the crash log. Asking for crash help without posting the crash log is a way to rapidly earn negative karma  :(

The debugger is a powerful and necessary tool in any IDE, so learn how to use it. You'll be able to tell us more and get better help here if you investigate your runtime problems in the debugger before posting.

Posted

Ohh.. I didn't understand that I was meant to post my logs. Sorry.

2016-09-16 15:41:28,531 WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream
2016-09-16 15:41:28,533 WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream
[15:41:28] [main/INFO] [GradleStart]: Extra: []
[15:41:28] [main/INFO] [GradleStart]: Running with arguments: [--userProperties, {}, --assetsDir, C:/Users/Bloopers/.gradle/caches/minecraft/assets, --assetIndex, 1.10, --accessToken{REDACTED}, --version, 1.10.2, --tweakClass, net.minecraftforge.fml.common.launcher.FMLTweaker, --tweakClass, net.minecraftforge.gradle.tweakers.CoremodTweaker]
[15:41:28] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker
[15:41:28] [main/INFO] [LaunchWrapper]: Using primary tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker
[15:41:28] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.CoremodTweaker
[15:41:28] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLTweaker
[15:41:28] [main/INFO] [FML]: Forge Mod Loader version 12.18.1.2077 for Minecraft 1.10.2 loading
[15:41:28] [main/INFO] [FML]: Java is Java HotSpot(TM) 64-Bit Server VM, version 1.8.0_91, running on Windows 7:amd64:6.1, installed at C:\Program Files\Java\jre1.8.0_91
[15:41:28] [main/INFO] [FML]: Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation
[15:41:28] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.CoremodTweaker
[15:41:28] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.fml.relauncher.FMLCorePlugin
[15:41:28] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.classloading.FMLForgePlugin
[15:41:28] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker
[15:41:28] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLDeobfTweaker
[15:41:28] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.AccessTransformerTweaker
[15:41:28] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker
[15:41:28] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker
[15:41:28] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper
[15:41:28] [main/ERROR] [FML]: The binary patch set is missing. Either you are in a development environment, or things are not going to work!
[15:41:30] [main/ERROR] [FML]: FML appears to be missing any signature data. This is not a good thing
[15:41:30] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper
[15:41:30] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLDeobfTweaker
[15:41:30] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.AccessTransformerTweaker
[15:41:30] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.TerminalTweaker
[15:41:30] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.TerminalTweaker
[15:41:30] [main/INFO] [LaunchWrapper]: Launching wrapped minecraft {net.minecraft.client.main.Main}
2016-09-16 15:41:31,582 WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream
2016-09-16 15:41:31,611 WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream
2016-09-16 15:41:31,612 WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream
[15:41:31] [Client thread/INFO]: Setting user: Player492
[15:41:36] [Client thread/WARN]: Skipping bad option: lastServer:
[15:41:36] [Client thread/INFO]: LWJGL Version: 2.9.4
[15:41:37] [Client thread/INFO] [sTDOUT]: [net.minecraftforge.fml.client.SplashProgress:start:221]: ---- Minecraft Crash Report ----
// Ooh. Shiny.

Time: 9/16/16 3:41 PM
Description: Loading screen debug info

This is just a prompt for computer specs to be printed. THIS IS NOT A ERROR


A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------

-- System Details --
Details:
Minecraft Version: 1.10.2
Operating System: Windows 7 (amd64) version 6.1
Java Version: 1.8.0_91, Oracle Corporation
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 853179304 bytes (813 MB) / 1037959168 bytes (989 MB) up to 1037959168 bytes (989 MB)
JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
FML: 
Loaded coremods (and transformers): 
GL info: ' Vendor: 'NVIDIA Corporation' Version: '4.5.0 NVIDIA 368.22' Renderer: 'GeForce GT 640/PCIe/SSE2'
[15:41:37] [Client thread/INFO] [FML]: MinecraftForge v12.18.1.2077 Initialized
[15:41:37] [Client thread/INFO] [FML]: Replaced 233 ore recipes
[15:41:37] [Client thread/INFO] [FML]: Found 0 mods from the command line. Injecting into mod discoverer
[15:41:37] [Client thread/INFO] [FML]: Searching C:\Users\Bloopers\Desktop\Coding\Coding 1.9\1.10 test\Spears\run\mods for mods
[15:41:39] [Client thread/INFO] [FML]: Forge Mod Loader has identified 4 mods to load
[15:41:39] [Client thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, Forge, spear] at CLIENT
[15:41:39] [Client thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, Forge, spear] at SERVER
[15:41:40] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:Spears
[15:41:40] [Client thread/INFO] [FML]: Processing ObjectHolder annotations
[15:41:40] [Client thread/INFO] [FML]: Found 423 ObjectHolder annotations
[15:41:40] [Client thread/INFO] [FML]: Identifying ItemStackHolder annotations
[15:41:40] [Client thread/INFO] [FML]: Found 0 ItemStackHolder annotations
[15:41:40] [Client thread/INFO] [FML]: Configured a dormant chunk cache size of 0
[15:41:40] [Client thread/INFO] [sTDOUT]: [bloopers.spearmod.SpearMod:preInit:33]: PreInit
[15:41:40] [Forge Version Check/INFO] [ForgeVersionCheck]: [Forge] Starting version check at http://files.minecraftforge.net/maven/net/minecraftforge/forge/promotions_slim.json
[15:41:40] [Client thread/INFO] [FML]: Applying holder lookups
[15:41:40] [Client thread/INFO] [FML]: Holder lookups applied
[15:41:40] [Client thread/INFO] [FML]: Injecting itemstacks
[15:41:40] [Client thread/INFO] [FML]: Itemstack injection complete
[15:41:40] [Forge Version Check/INFO] [ForgeVersionCheck]: [Forge] Found status: OUTDATED Target: 12.18.1.2088
[15:41:42] [sound Library Loader/INFO]: Starting up SoundSystem...
[15:41:42] [Thread-8/INFO]: Initializing LWJGL OpenAL
[15:41:42] [Thread-8/INFO]: (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)
[15:41:42] [Thread-8/INFO]: OpenAL initialized.
[15:41:43] [sound Library Loader/INFO]: Sound engine started
[15:41:46] [Client thread/INFO] [FML]: Max texture size: 16384
[15:41:46] [Client thread/INFO]: Created: 16x16 textures-atlas
[15:41:47] [Client thread/ERROR] [FML]: Exception loading model for variant spear:primitive_spear#inventory for item "spear:primitive_spear", normal location exception: 
net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model spear:item/primitive_spear with loader VanillaLoader.INSTANCE, skipping
at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:153) ~[ModelLoaderRegistry.class:?]
at net.minecraftforge.client.model.ModelLoader.loadItemModels(ModelLoader.java:317) ~[ModelLoader.class:?]
at net.minecraft.client.renderer.block.model.ModelBakery.loadVariantItemModels(ModelBakery.java:170) ~[ModelBakery.class:?]
at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:147) ~[ModelLoader.class:?]
at net.minecraft.client.renderer.block.model.ModelManager.onResourceManagerReload(ModelManager.java:28) [ModelManager.class:?]
at net.minecraft.client.resources.SimpleReloadableResourceManager.registerReloadListener(SimpleReloadableResourceManager.java:122) [simpleReloadableResourceManager.class:?]
at net.minecraft.client.Minecraft.startGame(Minecraft.java:540) [Minecraft.class:?]
at net.minecraft.client.Minecraft.run(Minecraft.java:386) [Minecraft.class:?]
at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_91]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_91]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_91]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_91]
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_91]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_91]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_91]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_91]
at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
at GradleStart.main(GradleStart.java:26) [start/:?]
Caused by: java.io.FileNotFoundException: spear:models/item/primitive_spear.json
at net.minecraft.client.resources.SimpleReloadableResourceManager.getResource(SimpleReloadableResourceManager.java:69) ~[simpleReloadableResourceManager.class:?]
at net.minecraft.client.renderer.block.model.ModelBakery.loadModel(ModelBakery.java:311) ~[ModelBakery.class:?]
at net.minecraftforge.client.model.ModelLoader.access$1100(ModelLoader.java:118) ~[ModelLoader.class:?]
at net.minecraftforge.client.model.ModelLoader$VanillaLoader.loadModel(ModelLoader.java:868) ~[ModelLoader$VanillaLoader.class:?]
at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:149) ~[ModelLoaderRegistry.class:?]
... 20 more
[15:41:47] [Client thread/ERROR] [FML]: Exception loading model for variant spear:primitive_spear#inventory for item "spear:primitive_spear", blockstate location exception: 
net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model spear:primitive_spear#inventory with loader VariantLoader.INSTANCE, skipping
at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:153) ~[ModelLoaderRegistry.class:?]
at net.minecraftforge.client.model.ModelLoader.loadItemModels(ModelLoader.java:325) ~[ModelLoader.class:?]
at net.minecraft.client.renderer.block.model.ModelBakery.loadVariantItemModels(ModelBakery.java:170) ~[ModelBakery.class:?]
at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:147) ~[ModelLoader.class:?]
at net.minecraft.client.renderer.block.model.ModelManager.onResourceManagerReload(ModelManager.java:28) [ModelManager.class:?]
at net.minecraft.client.resources.SimpleReloadableResourceManager.registerReloadListener(SimpleReloadableResourceManager.java:122) [simpleReloadableResourceManager.class:?]
at net.minecraft.client.Minecraft.startGame(Minecraft.java:540) [Minecraft.class:?]
at net.minecraft.client.Minecraft.run(Minecraft.java:386) [Minecraft.class:?]
at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_91]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_91]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_91]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_91]
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_91]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_91]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_91]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_91]
at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
at GradleStart.main(GradleStart.java:26) [start/:?]
Caused by: net.minecraft.client.renderer.block.model.ModelBlockDefinition$MissingVariantException
at net.minecraft.client.renderer.block.model.ModelBlockDefinition.getVariant(ModelBlockDefinition.java:78) ~[ModelBlockDefinition.class:?]
at net.minecraftforge.client.model.ModelLoader$VariantLoader.loadModel(ModelLoader.java:1184) ~[ModelLoader$VariantLoader.class:?]
at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:149) ~[ModelLoaderRegistry.class:?]
... 20 more
[15:41:47] [Client thread/INFO] [sTDOUT]: [bloopers.spearmod.SpearMod:Init:41]: Init
[15:41:47] [Client thread/INFO] [FML]: Injecting itemstacks
[15:41:47] [Client thread/INFO] [FML]: Itemstack injection complete
[15:41:47] [Client thread/INFO] [sTDOUT]: [bloopers.spearmod.SpearMod:postInit:52]: PostInit
[15:41:47] [Client thread/INFO] [FML]: Forge Mod Loader has successfully loaded 4 mods
[15:41:47] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:Spears
[15:41:50] [Client thread/INFO]: SoundSystem shutting down...
[15:41:50] [Client thread/WARN]: Author: Paul Lamb, www.paulscode.com
[15:41:50] [sound Library Loader/INFO]: Starting up SoundSystem...
[15:41:50] [Thread-10/INFO]: Initializing LWJGL OpenAL
[15:41:50] [Thread-10/INFO]: (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)
[15:41:50] [Thread-10/INFO]: OpenAL initialized.
[15:41:50] [sound Library Loader/INFO]: Sound engine started
[15:41:52] [Client thread/INFO] [FML]: Max texture size: 16384
[15:41:53] [Client thread/INFO]: Created: 1024x512 textures-atlas
[15:41:53] [Client thread/ERROR] [FML]: Exception loading model for variant spear:primitive_spear#inventory for item "spear:primitive_spear", normal location exception: 
net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model spear:item/primitive_spear with loader VanillaLoader.INSTANCE, skipping
at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:153) ~[ModelLoaderRegistry.class:?]
at net.minecraftforge.client.model.ModelLoader.loadItemModels(ModelLoader.java:317) ~[ModelLoader.class:?]
at net.minecraft.client.renderer.block.model.ModelBakery.loadVariantItemModels(ModelBakery.java:170) ~[ModelBakery.class:?]
at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:147) ~[ModelLoader.class:?]
at net.minecraft.client.renderer.block.model.ModelManager.onResourceManagerReload(ModelManager.java:28) [ModelManager.class:?]
at net.minecraft.client.resources.SimpleReloadableResourceManager.notifyReloadListeners(SimpleReloadableResourceManager.java:132) [simpleReloadableResourceManager.class:?]
at net.minecraft.client.resources.SimpleReloadableResourceManager.reloadResources(SimpleReloadableResourceManager.java:113) [simpleReloadableResourceManager.class:?]
at net.minecraft.client.Minecraft.refreshResources(Minecraft.java:799) [Minecraft.class:?]
at net.minecraftforge.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:338) [FMLClientHandler.class:?]
at net.minecraft.client.Minecraft.startGame(Minecraft.java:561) [Minecraft.class:?]
at net.minecraft.client.Minecraft.run(Minecraft.java:386) [Minecraft.class:?]
at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_91]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_91]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_91]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_91]
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_91]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_91]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_91]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_91]
at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
at GradleStart.main(GradleStart.java:26) [start/:?]
Caused by: java.io.FileNotFoundException: spear:models/item/primitive_spear.json
at net.minecraft.client.resources.SimpleReloadableResourceManager.getResource(SimpleReloadableResourceManager.java:69) ~[simpleReloadableResourceManager.class:?]
at net.minecraft.client.renderer.block.model.ModelBakery.loadModel(ModelBakery.java:311) ~[ModelBakery.class:?]
at net.minecraftforge.client.model.ModelLoader.access$1100(ModelLoader.java:118) ~[ModelLoader.class:?]
at net.minecraftforge.client.model.ModelLoader$VanillaLoader.loadModel(ModelLoader.java:868) ~[ModelLoader$VanillaLoader.class:?]
at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:149) ~[ModelLoaderRegistry.class:?]
... 23 more
[15:41:53] [Client thread/ERROR] [FML]: Exception loading model for variant spear:primitive_spear#inventory for item "spear:primitive_spear", blockstate location exception: 
net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model spear:primitive_spear#inventory with loader VariantLoader.INSTANCE, skipping
at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:153) ~[ModelLoaderRegistry.class:?]
at net.minecraftforge.client.model.ModelLoader.loadItemModels(ModelLoader.java:325) ~[ModelLoader.class:?]
at net.minecraft.client.renderer.block.model.ModelBakery.loadVariantItemModels(ModelBakery.java:170) ~[ModelBakery.class:?]
at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:147) ~[ModelLoader.class:?]
at net.minecraft.client.renderer.block.model.ModelManager.onResourceManagerReload(ModelManager.java:28) [ModelManager.class:?]
at net.minecraft.client.resources.SimpleReloadableResourceManager.notifyReloadListeners(SimpleReloadableResourceManager.java:132) [simpleReloadableResourceManager.class:?]
at net.minecraft.client.resources.SimpleReloadableResourceManager.reloadResources(SimpleReloadableResourceManager.java:113) [simpleReloadableResourceManager.class:?]
at net.minecraft.client.Minecraft.refreshResources(Minecraft.java:799) [Minecraft.class:?]
at net.minecraftforge.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:338) [FMLClientHandler.class:?]
at net.minecraft.client.Minecraft.startGame(Minecraft.java:561) [Minecraft.class:?]
at net.minecraft.client.Minecraft.run(Minecraft.java:386) [Minecraft.class:?]
at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_91]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_91]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_91]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_91]
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_91]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_91]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_91]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_91]
at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
at GradleStart.main(GradleStart.java:26) [start/:?]
Caused by: net.minecraft.client.renderer.block.model.ModelBlockDefinition$MissingVariantException
at net.minecraft.client.renderer.block.model.ModelBlockDefinition.getVariant(ModelBlockDefinition.java:78) ~[ModelBlockDefinition.class:?]
at net.minecraftforge.client.model.ModelLoader$VariantLoader.loadModel(ModelLoader.java:1184) ~[ModelLoader$VariantLoader.class:?]
at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:149) ~[ModelLoaderRegistry.class:?]
... 23 more
[15:41:53] [Client thread/WARN]: Skipping bad option: lastServer:
[15:41:54] [Realms Notification Availability checker #1/INFO]: Could not authorize you against Realms server: Invalid session id
[15:41:59] [server thread/INFO]: Starting integrated minecraft server version 1.10.2
[15:41:59] [server thread/INFO]: Generating keypair
[15:41:59] [server thread/INFO] [FML]: Injecting existing block and item data into this server instance
[15:41:59] [server thread/INFO] [FML]: Applying holder lookups
[15:41:59] [server thread/INFO] [FML]: Holder lookups applied
[15:41:59] [server thread/INFO] [FML]: Loading dimension 0 (New World) (net.minecraft.server.integrated.IntegratedServer@76a0ccf3)
[15:41:59] [server thread/INFO] [FML]: Loading dimension 1 (New World) (net.minecraft.server.integrated.IntegratedServer@76a0ccf3)
[15:41:59] [server thread/INFO] [FML]: Loading dimension -1 (New World) (net.minecraft.server.integrated.IntegratedServer@76a0ccf3)
[15:41:59] [server thread/INFO]: Preparing start region for level 0
[15:42:00] [server thread/WARN]: Keeping entity Villager that already exists with UUID 8fed010b-2e3d-47ff-8922-fe4f8a6af0ef
[15:42:00] [server thread/WARN]: Keeping entity Villager that already exists with UUID 7b2373b1-a203-4ea8-beb1-5cf3fd1d6cce
[15:42:00] [server thread/INFO]: Preparing spawn area: 15%
[15:42:01] [server thread/INFO]: Changing view distance to 12, from 10
[15:42:02] [Netty Local Client IO #0/INFO] [FML]: Server protocol version 2
[15:42:02] [Netty Server IO #1/INFO] [FML]: Client protocol version 2
[15:42:02] [Netty Server IO #1/INFO] [FML]: Client attempting to join with 4 mods : [email protected],[email protected],[email protected],[email protected]
[15:42:02] [Netty Local Client IO #0/INFO] [FML]: [Netty Local Client IO #0] Client side modded connection established
[15:42:02] [server thread/INFO] [FML]: [server thread] Server side modded connection established
[15:42:02] [server thread/INFO]: Player492[local:E:8376f5ed] logged in with entity id 210 at (-358.2780964433852, 70.06507675861431, 902.1471985928209)
[15:42:02] [server thread/INFO]: Player492 joined the game
[15:42:03] [server thread/INFO]: Saving and pausing game...
[15:42:03] [server thread/INFO]: Saving chunks for level 'New World'/Overworld
[15:42:04] [server thread/INFO]: Saving chunks for level 'New World'/Nether
[15:42:04] [server thread/INFO]: Saving chunks for level 'New World'/The End
[15:42:04] [pool-2-thread-1/WARN]: Couldn't look up profile properties for com.mojang.authlib.GameProfile@4dd760b4[id=b3f55dee-e1b0-36b3-b913-a72bec89c0ee,name=Player492,properties={},legacy=false]
com.mojang.authlib.exceptions.AuthenticationException: The client has sent too many requests within a certain amount of time
at com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService.makeRequest(YggdrasilAuthenticationService.java:65) ~[YggdrasilAuthenticationService.class:?]
at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService.fillGameProfile(YggdrasilMinecraftSessionService.java:175) [YggdrasilMinecraftSessionService.class:?]
at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService$1.load(YggdrasilMinecraftSessionService.java:59) [YggdrasilMinecraftSessionService$1.class:?]
at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService$1.load(YggdrasilMinecraftSessionService.java:56) [YggdrasilMinecraftSessionService$1.class:?]
at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3524) [guava-17.0.jar:?]
at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2317) [guava-17.0.jar:?]
at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2280) [guava-17.0.jar:?]
at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2195) [guava-17.0.jar:?]
at com.google.common.cache.LocalCache.get(LocalCache.java:3934) [guava-17.0.jar:?]
at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3938) [guava-17.0.jar:?]
at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4821) [guava-17.0.jar:?]
at com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:4827) [guava-17.0.jar:?]
at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService.fillProfileProperties(YggdrasilMinecraftSessionService.java:165) [YggdrasilMinecraftSessionService.class:?]
at net.minecraft.client.Minecraft.getProfileProperties(Minecraft.java:3060) [Minecraft.class:?]
at net.minecraft.client.resources.SkinManager$3.run(SkinManager.java:131) [skinManager$3.class:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_91]
at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_91]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:1.8.0_91]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:1.8.0_91]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_91]
[15:42:16] [Client thread/INFO] [sTDOUT]: [bloopers.spearmod.reach.MessageExtendedReachAttack:<init>:28]: Constructor
[15:42:16] [Client thread/ERROR] [FML]: Exception caught during firing event net.minecraftforge.client.event.MouseEvent@3961a89c:
java.lang.NullPointerException
at bloopers.spearmod.reach.MouseEventHandler.onEvent(MouseEventHandler.java:64) ~[MouseEventHandler.class:?]
at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_6_MouseEventHandler_onEvent_MouseEvent.invoke(.dynamic) ~[?:?]
at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:72) ~[ASMEventHandler.class:?]
at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:168) [EventBus.class:?]
at net.minecraftforge.client.ForgeHooksClient.postMouseEvent(ForgeHooksClient.java:232) [ForgeHooksClient.class:?]
at net.minecraft.client.Minecraft.runTickMouse(Minecraft.java:2302) [Minecraft.class:?]
at net.minecraft.client.Minecraft.runTick(Minecraft.java:1838) [Minecraft.class:?]
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1118) [Minecraft.class:?]
at net.minecraft.client.Minecraft.run(Minecraft.java:406) [Minecraft.class:?]
at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_91]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_91]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_91]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_91]
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_91]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_91]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_91]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_91]
at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
at GradleStart.main(GradleStart.java:26) [start/:?]
[15:42:16] [Client thread/ERROR] [FML]: Index: 1 Listeners:
[15:42:16] [Client thread/ERROR] [FML]: 0: NORMAL
[15:42:16] [Client thread/ERROR] [FML]: 1: ASM: bloopers.spearmod.reach.MouseEventHandler@4df62e64 onEvent(Lnet/minecraftforge/client/event/MouseEvent;)V
[15:42:17] [server thread/INFO]: Stopping server
[15:42:17] [server thread/INFO]: Saving players
[15:42:17] [server thread/INFO]: Saving worlds
[15:42:17] [server thread/INFO]: Saving chunks for level 'New World'/Overworld
[15:42:17] [server thread/INFO]: Saving chunks for level 'New World'/Nether
[15:42:17] [server thread/INFO]: Saving chunks for level 'New World'/The End
[15:42:18] [server thread/INFO] [FML]: Unloading dimension 0
[15:42:18] [server thread/INFO] [FML]: Unloading dimension -1
[15:42:18] [server thread/INFO] [FML]: Unloading dimension 1
[15:42:19] [Client thread/FATAL]: Unreported exception thrown!
java.lang.NullPointerException
at bloopers.spearmod.reach.MouseEventHandler.onEvent(MouseEventHandler.java:64) ~[MouseEventHandler.class:?]
at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_6_MouseEventHandler_onEvent_MouseEvent.invoke(.dynamic) ~[?:?]
at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:72) ~[ASMEventHandler.class:?]
at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:168) ~[EventBus.class:?]
at net.minecraftforge.client.ForgeHooksClient.postMouseEvent(ForgeHooksClient.java:232) ~[ForgeHooksClient.class:?]
at net.minecraft.client.Minecraft.runTickMouse(Minecraft.java:2302) ~[Minecraft.class:?]
at net.minecraft.client.Minecraft.runTick(Minecraft.java:1838) ~[Minecraft.class:?]
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1118) ~[Minecraft.class:?]
at net.minecraft.client.Minecraft.run(Minecraft.java:406) [Minecraft.class:?]
at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_91]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_91]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_91]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_91]
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_91]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_91]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_91]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_91]
at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
at GradleStart.main(GradleStart.java:26) [start/:?]
[15:42:19] [Client thread/INFO] [sTDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:649]: ---- Minecraft Crash Report ----
// Don't do that.

Time: 9/16/16 3:42 PM
Description: Unexpected error

java.lang.NullPointerException: Unexpected error
at bloopers.spearmod.reach.MouseEventHandler.onEvent(MouseEventHandler.java:64)
at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_6_MouseEventHandler_onEvent_MouseEvent.invoke(.dynamic)
at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:72)
at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:168)
at net.minecraftforge.client.ForgeHooksClient.postMouseEvent(ForgeHooksClient.java:232)
at net.minecraft.client.Minecraft.runTickMouse(Minecraft.java:2302)
at net.minecraft.client.Minecraft.runTick(Minecraft.java:1838)
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1118)
at net.minecraft.client.Minecraft.run(Minecraft.java:406)
at net.minecraft.client.main.Main.main(Main.java:118)
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:135)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
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.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97)
at GradleStart.main(GradleStart.java:26)


A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------

-- Head --
Thread: Client thread
Stacktrace:
at bloopers.spearmod.reach.MouseEventHandler.onEvent(MouseEventHandler.java:64)
at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_6_MouseEventHandler_onEvent_MouseEvent.invoke(.dynamic)
at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:72)
at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:168)
at net.minecraftforge.client.ForgeHooksClient.postMouseEvent(ForgeHooksClient.java:232)
at net.minecraft.client.Minecraft.runTickMouse(Minecraft.java:2302)

-- Affected level --
Details:
Level name: MpServer
All players: 1 total; [EntityPlayerSP['Player492'/210, l='MpServer', x=-345.87, y=64.56, z=905.99]]
Chunk stats: MultiplayerChunkCache: 593, 593
Level seed: 0
Level generator: ID 00 - default, ver 1. Features enabled: false
Level generator options: 
Level spawn location: World: (-110,64,-30), Chunk: (at 2,4,2 in -7,-2; contains blocks -112,0,-32 to -97,255,-17), Region: (-1,-1; contains chunks -32,-32 to -1,-1, blocks -512,0,-512 to -1,255,-1)
Level time: 79041 game time, 59797 day time
Level dimension: 0
Level storage version: 0x00000 - Unknown?
Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false)
Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: false
Forced entities: 106 total; [EntitySquid['Squid'/517, l='MpServer', x=-292.37, y=58.42, z=927.92], EntityEnderman['Enderman'/518, l='MpServer', x=-335.77, y=21.00, z=948.38], EntityEnderman['Enderman'/519, l='MpServer', x=-331.65, y=21.00, z=947.50], EntityCreeper['Creeper'/520, l='MpServer', x=-315.50, y=26.00, z=941.50], EntityEnderman['Enderman'/296, l='MpServer', x=-353.26, y=39.00, z=870.54], EntityZombie['Zombie'/307, l='MpServer', x=-414.70, y=12.00, z=949.57], EntityZombie['Zombie'/308, l='MpServer', x=-405.37, y=14.00, z=962.58], EntityZombie['Zombie'/309, l='MpServer', x=-405.07, y=15.00, z=956.65], EntityWitch['Witch'/310, l='MpServer', x=-403.51, y=15.00, z=956.33], EntityWitch['Witch'/311, l='MpServer', x=-399.79, y=20.00, z=952.49], EntityZombie['Zombie'/312, l='MpServer', x=-409.52, y=17.00, z=952.69], EntitySkeleton['Skeleton'/313, l='MpServer', x=-406.60, y=23.00, z=953.28], EntitySheep['Sheep'/314, l='MpServer', x=-410.25, y=70.00, z=956.41], EntitySkeleton['Skeleton'/574, l='MpServer', x=-350.68, y=34.00, z=853.54], EntitySkeleton['Skeleton'/320, l='MpServer', x=-413.24, y=22.00, z=967.99], EntityZombie['Zombie'/321, l='MpServer', x=-413.50, y=28.00, z=960.50], EntitySheep['Sheep'/322, l='MpServer', x=-416.39, y=70.00, z=964.73], EntityPig['Pig'/323, l='MpServer', x=-410.36, y=69.00, z=969.56], EntitySheep['Sheep'/324, l='MpServer', x=-411.25, y=69.00, z=972.50], EntitySkeleton['Skeleton'/329, l='MpServer', x=-416.50, y=15.00, z=954.50], EntityBat['Bat'/333, l='MpServer', x=-389.40, y=33.92, z=864.82], EntityBat['Bat'/334, l='MpServer', x=-425.66, y=21.07, z=900.52], EntitySkeleton['Skeleton'/335, l='MpServer', x=-421.50, y=21.00, z=900.50], EntityChicken['Chicken'/342, l='MpServer', x=-418.12, y=67.00, z=865.51], EntityChicken['Chicken'/344, l='MpServer', x=-408.51, y=63.00, z=863.20], EntityChicken['Chicken'/345, l='MpServer', x=-411.71, y=69.00, z=856.32], EntityZombie['Zombie'/346, l='MpServer', x=-419.80, y=26.00, z=884.52], EntityCreeper['Creeper'/349, l='MpServer', x=-414.50, y=33.00, z=873.35], EntityZombie['Zombie'/350, l='MpServer', x=-405.81, y=32.00, z=878.41], EntityChicken['Chicken'/351, l='MpServer', x=-409.56, y=62.57, z=874.95], EntityChicken['Chicken'/352, l='MpServer', x=-408.41, y=62.50, z=872.05], EntityItem['item.item.egg'/353, l='MpServer', x=-409.70, y=63.00, z=866.19], EntityChicken['Chicken'/354, l='MpServer', x=-414.50, y=64.00, z=865.50], EntityZombie['Zombie'/613, l='MpServer', x=-324.74, y=33.00, z=938.53], EntityChicken['Chicken'/361, l='MpServer', x=-426.46, y=70.00, z=837.82], EntityChicken['Chicken'/363, l='MpServer', x=-426.49, y=70.00, z=846.89], EntityChicken['Chicken'/365, l='MpServer', x=-416.20, y=67.00, z=863.66], EntityChicken['Chicken'/367, l='MpServer', x=-418.97, y=70.00, z=854.81], EntityChicken['Chicken'/368, l='MpServer', x=-417.80, y=70.00, z=854.92], EntityChicken['Chicken'/369, l='MpServer', x=-424.41, y=70.00, z=848.16], EntityChicken['Chicken'/370, l='MpServer', x=-413.60, y=70.00, z=847.78], EntityZombie['entity.Zombie.name'/380, l='MpServer', x=-387.49, y=25.00, z=983.81], EntityPig['Pig'/381, l='MpServer', x=-378.78, y=66.00, z=977.51], EntityPig['Pig'/382, l='MpServer', x=-358.16, y=65.00, z=975.50], EntityBat['Bat'/389, l='MpServer', x=-357.17, y=46.10, z=982.98], EntityBat['Bat'/390, l='MpServer', x=-363.91, y=44.21, z=980.20], EntitySquid['Squid'/391, l='MpServer', x=-338.49, y=48.68, z=962.80], EntitySpider['Spider'/651, l='MpServer', x=-342.50, y=14.00, z=846.50], EntitySpider['Spider'/652, l='MpServer', x=-337.50, y=14.00, z=848.50], EntityPlayerSP['Player492'/210, l='MpServer', x=-345.87, y=64.56, z=905.99], EntityCreeper['Creeper'/408, l='MpServer', x=-399.49, y=15.00, z=967.17], EntityBat['Bat'/409, l='MpServer', x=-389.75, y=35.10, z=970.75], EntitySheep['Sheep'/410, l='MpServer', x=-386.40, y=67.00, z=962.36], EntityBat['Bat'/666, l='MpServer', x=-362.36, y=43.09, z=975.25], EntitySheep['Sheep'/411, l='MpServer', x=-367.82, y=62.38, z=941.89], EntityPig['Pig'/412, l='MpServer', x=-371.98, y=66.00, z=951.50], EntitySquid['Squid'/413, l='MpServer', x=-326.30, y=59.97, z=903.32], EntityCreeper['Creeper'/415, l='MpServer', x=-370.50, y=14.00, z=967.81], EntityBat['Bat'/671, l='MpServer', x=-398.93, y=34.08, z=844.91], EntityZombie['Zombie'/416, l='MpServer', x=-379.45, y=23.00, z=962.76], EntitySkeleton['Skeleton'/417, l='MpServer', x=-379.50, y=20.00, z=967.50], EntitySkeleton['Skeleton'/418, l='MpServer', x=-379.50, y=23.00, z=969.50], EntitySkeleton['Skeleton'/419, l='MpServer', x=-380.50, y=23.00, z=969.50], EntitySkeleton['Skeleton'/420, l='MpServer', x=-381.50, y=23.00, z=967.50], EntityBat['Bat'/676, l='MpServer', x=-307.96, y=35.02, z=924.53], EntitySkeleton['Skeleton'/421, l='MpServer', x=-375.50, y=21.00, z=970.50], EntitySkeleton['Skeleton'/423, l='MpServer', x=-376.50, y=21.00, z=972.50], EntitySkeleton['Skeleton'/424, l='MpServer', x=-376.50, y=21.00, z=970.50], EntitySkeleton['Skeleton'/425, l='MpServer', x=-375.70, y=40.00, z=963.64], EntitySkeleton['Skeleton'/426, l='MpServer', x=-399.50, y=34.00, z=977.50], EntitySkeleton['Skeleton'/427, l='MpServer', x=-399.86, y=34.00, z=979.07], EntityCreeper['Creeper'/683, l='MpServer', x=-401.50, y=18.00, z=933.50], EntitySkeleton['Skeleton'/428, l='MpServer', x=-397.50, y=34.00, z=981.50], EntitySheep['Sheep'/429, l='MpServer', x=-384.55, y=66.00, z=978.22], EntitySquid['Squid'/430, l='MpServer', x=-325.30, y=60.07, z=902.56], EntitySkeleton['Skeleton'/431, l='MpServer', x=-350.50, y=14.00, z=939.50], EntitySquid['Squid'/432, l='MpServer', x=-337.43, y=50.70, z=919.39], EntitySquid['Squid'/433, l='MpServer', x=-325.29, y=59.88, z=921.82], EntityZombie['Zombie'/435, l='MpServer', x=-338.75, y=33.88, z=895.49], EntitySquid['Squid'/436, l='MpServer', x=-337.30, y=52.63, z=896.81], EntitySquid['Squid'/437, l='MpServer', x=-350.93, y=60.86, z=897.25], EntityCreeper['Creeper'/693, l='MpServer', x=-364.50, y=29.00, z=828.50], EntityMinecartChest['Minecart with Chest'/438, l='MpServer', x=-386.50, y=19.06, z=944.50], EntityCreeper['Creeper'/694, l='MpServer', x=-365.50, y=29.00, z=825.50], EntitySkeleton['Skeleton'/439, l='MpServer', x=-389.50, y=23.00, z=949.50], EntitySkeleton['Skeleton'/440, l='MpServer', x=-389.50, y=23.00, z=954.50], EntitySheep['Sheep'/441, l='MpServer', x=-391.49, y=65.00, z=946.57], EntitySheep['Sheep'/442, l='MpServer', x=-396.48, y=68.00, z=952.56], EntityBat['Bat'/443, l='MpServer', x=-328.24, y=34.10, z=886.83], EntityCreeper['Creeper'/444, l='MpServer', x=-320.50, y=34.00, z=884.50], EntityBat['Bat'/445, l='MpServer', x=-327.88, y=35.00, z=893.25], EntitySquid['Squid'/446, l='MpServer', x=-320.53, y=56.74, z=870.80], EntityMinecartChest['Minecart with Chest'/449, l='MpServer', x=-346.50, y=33.06, z=855.50], EntityMinecartChest['Minecart with Chest'/451, l='MpServer', x=-330.50, y=38.06, z=835.50], EntityBat['Bat'/452, l='MpServer', x=-331.05, y=36.22, z=853.60], EntityBat['Bat'/453, l='MpServer', x=-326.12, y=36.02, z=855.55], EntityMinecartChest['Minecart with Chest'/455, l='MpServer', x=-360.50, y=34.06, z=862.50], EntityMinecartChest['Minecart with Chest'/456, l='MpServer', x=-359.50, y=35.06, z=849.50], EntityBat['Bat'/457, l='MpServer', x=-354.93, y=34.10, z=859.59], EntityEnderman['Enderman'/458, l='MpServer', x=-354.59, y=38.00, z=859.49], EntitySkeleton['Skeleton'/737, l='MpServer', x=-326.30, y=34.00, z=827.70], EntityZombie['Zombie'/749, l='MpServer', x=-345.50, y=17.00, z=835.50], EntityCreeper['Creeper'/760, l='MpServer', x=-333.50, y=33.00, z=943.50], EntityCreeper['Creeper'/761, l='MpServer', x=-335.50, y=33.00, z=944.50], EntityCreeper['Creeper'/762, l='MpServer', x=-332.50, y=33.00, z=943.50], EntityZombie['Zombie'/767, l='MpServer', x=-361.73, y=13.00, z=853.46]]
Retry entities: 0 total; []
Server brand: fml,forge
Server type: Integrated singleplayer server
Stacktrace:
at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:451)
at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2779)
at net.minecraft.client.Minecraft.run(Minecraft.java:435)
at net.minecraft.client.main.Main.main(Main.java:118)
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:135)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
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.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97)
at GradleStart.main(GradleStart.java:26)

-- System Details --
Details:
Minecraft Version: 1.10.2
Operating System: Windows 7 (amd64) version 6.1
Java Version: 1.8.0_91, Oracle Corporation
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 635980272 bytes (606 MB) / 1037959168 bytes (989 MB) up to 1037959168 bytes (989 MB)
JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
IntCache: cache: 0, tcache: 0, allocated: 12, tallocated: 94
FML: MCP 9.32 Powered by Forge 12.18.1.2077 4 mods loaded, 4 mods active
States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored
UCHIJAAAA	mcp{9.19} [Minecraft Coder Pack] (minecraft.jar) 
UCHIJAAAA	FML{8.0.99.99} [Forge Mod Loader] (forgeSrc-1.10.2-12.18.1.2077.jar) 
UCHIJAAAA	Forge{12.18.1.2077} [Minecraft Forge] (forgeSrc-1.10.2-12.18.1.2077.jar) 
UCHIJAAAA	spear{1.0} [spears] (bin) 
Loaded coremods (and transformers): 
GL info: ' Vendor: 'NVIDIA Corporation' Version: '4.5.0 NVIDIA 368.22' Renderer: 'GeForce GT 640/PCIe/SSE2'
Launched Version: 1.10.2
LWJGL: 2.9.4
OpenGL: GeForce GT 640/PCIe/SSE2 GL version 4.5.0 NVIDIA 368.22, NVIDIA Corporation
GL Caps: Using GL 1.3 multitexturing.
Using GL 1.3 texture combiners.
Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported.
Shaders are available because OpenGL 2.1 is supported.
VBOs are available because OpenGL 1.5 is supported.

Using VBOs: Yes
Is Modded: Definitely; Client brand changed to 'fml,forge'
Type: Client (map_client.txt)
Resource Packs: 
Current Language: English (US)
Profiler Position: N/A (disabled)
CPU: 8x Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz
[15:42:19] [Client thread/INFO] [sTDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:649]: #@!@# Game crashed! Crash report saved to: #@!@# C:\Users\Bloopers\Desktop\Coding\Coding 1.9\1.10 test\Spears\run\.\crash-reports\crash-2016-09-16_15.42.19-client.txt
[15:42:19] [Client thread/INFO] [FML]: Waiting for the server to terminate/save.
[15:42:19] [server thread/INFO] [FML]: Applying holder lookups
[15:42:19] [server thread/INFO] [FML]: Holder lookups applied
[15:42:19] [Client thread/INFO] [FML]: Server terminated.
AL lib: (EE) alc_cleanup: 1 device not closed
Java HotSpot(TM) 64-Bit Server VM warning: Using incremental CMS is deprecated and will likely be removed in a future release

Posted

On line 64 in your MouseEventHandler class there is a null field.

This is on line 64, I can't tell what is null:

SpearMod.network.sendToServer(new MessageExtendedReachAttack(mov.entityHit.getEntityId()));

Is it the entity ID?

Posted

Can you show your main class (

SprearMod

)?

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted

Can you show your main class (

SprearMod

)?

package bloopers.spearmod;

import bloopers.spearmod.init.SpearItems;
import bloopers.spearmod.proxy.CommonProxy;
import bloopers.spearmod.reach.MouseEventHandler;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.Mod.Instance;
import net.minecraftforge.fml.common.SidedProxy;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper;

@Mod(modid = "spear",
name = "Spears",
version = "1.0",
acceptedMinecraftVersions = "[1.10]")
public class SpearMod {

@Instance
public static SpearMod instance;

public static SimpleNetworkWrapper network;

@SidedProxy(clientSide = "bloopers.spearmod.proxy.ClientProxy",
		serverSide = "bloopers.spearmod.proxy.ServerProxy")
public static CommonProxy proxy;

@EventHandler
public void preInit(FMLPreInitializationEvent event) {
	System.out.println("PreInit");

	SpearItems.init();
	SpearItems.register();
}

@EventHandler
public void Init(FMLInitializationEvent event) {
	System.out.println("Init");
	MouseEventHandler handler = new MouseEventHandler();
    	MinecraftForge.EVENT_BUS.register(handler);

}




@EventHandler
public void postInit(FMLPostInitializationEvent event) {
	System.out.println("PostInit");

}

}

Posted

You never initialize network.

Oh, I did miss that. Now I have this to initialize it

public static String CHANNEL_NAME = "network";
SpearMod.network = NetworkRegistry.INSTANCE.newSimpleChannel(SpearMod.CHANNEL_NAME);


in my Init method in SpearMod. Now, instead of just crashing the game, when I hit an entity with my item, it will disconnect me from the singleplayer world, saying

"A fatal error has occured, this connect is terminated"

If I click "Back to server list" I am taken to the multiplayer server selection list. This is my console/crash report now.

2016-09-16 18:49:30,880 WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream
2016-09-16 18:49:30,882 WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream
[18:49:30] [main/INFO] [GradleStart]: Extra: []
[18:49:30] [main/INFO] [GradleStart]: Running with arguments: [--userProperties, {}, --assetsDir, C:/Users/Bloopers/.gradle/caches/minecraft/assets, --assetIndex, 1.10, --accessToken{REDACTED}, --version, 1.10.2, --tweakClass, net.minecraftforge.fml.common.launcher.FMLTweaker, --tweakClass, net.minecraftforge.gradle.tweakers.CoremodTweaker]
[18:49:31] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker
[18:49:31] [main/INFO] [LaunchWrapper]: Using primary tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker
[18:49:31] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.CoremodTweaker
[18:49:31] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLTweaker
[18:49:31] [main/INFO] [FML]: Forge Mod Loader version 12.18.1.2077 for Minecraft 1.10.2 loading
[18:49:31] [main/INFO] [FML]: Java is Java HotSpot(TM) 64-Bit Server VM, version 1.8.0_91, running on Windows 7:amd64:6.1, installed at C:\Program Files\Java\jre1.8.0_91
[18:49:31] [main/INFO] [FML]: Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation
[18:49:31] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.CoremodTweaker
[18:49:31] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.fml.relauncher.FMLCorePlugin
[18:49:31] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.classloading.FMLForgePlugin
[18:49:31] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker
[18:49:31] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLDeobfTweaker
[18:49:31] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.AccessTransformerTweaker
[18:49:31] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker
[18:49:31] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker
[18:49:31] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper
[18:49:31] [main/ERROR] [FML]: The binary patch set is missing. Either you are in a development environment, or things are not going to work!
[18:49:32] [main/ERROR] [FML]: FML appears to be missing any signature data. This is not a good thing
[18:49:32] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper
[18:49:32] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLDeobfTweaker
[18:49:33] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.AccessTransformerTweaker
[18:49:33] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.TerminalTweaker
[18:49:33] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.TerminalTweaker
[18:49:33] [main/INFO] [LaunchWrapper]: Launching wrapped minecraft {net.minecraft.client.main.Main}
2016-09-16 18:49:33,932 WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream
2016-09-16 18:49:33,962 WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream
2016-09-16 18:49:33,964 WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream
[18:49:34] [Client thread/INFO]: Setting user: Player852
[18:49:38] [Client thread/WARN]: Skipping bad option: lastServer:
[18:49:38] [Client thread/INFO]: LWJGL Version: 2.9.4
[18:49:39] [Client thread/INFO] [sTDOUT]: [net.minecraftforge.fml.client.SplashProgress:start:221]: ---- Minecraft Crash Report ----
// Don't be sad, have a hug! <3

Time: 9/16/16 6:49 PM
Description: Loading screen debug info

This is just a prompt for computer specs to be printed. THIS IS NOT A ERROR


A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------

-- System Details --
Details:
Minecraft Version: 1.10.2
Operating System: Windows 7 (amd64) version 6.1
Java Version: 1.8.0_91, Oracle Corporation
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 865486280 bytes (825 MB) / 1037959168 bytes (989 MB) up to 1037959168 bytes (989 MB)
JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
FML: 
Loaded coremods (and transformers): 
GL info: ' Vendor: 'NVIDIA Corporation' Version: '4.5.0 NVIDIA 368.22' Renderer: 'GeForce GT 640/PCIe/SSE2'
[18:49:39] [Client thread/INFO] [FML]: MinecraftForge v12.18.1.2077 Initialized
[18:49:39] [Client thread/INFO] [FML]: Replaced 233 ore recipes
[18:49:39] [Client thread/INFO] [FML]: Found 0 mods from the command line. Injecting into mod discoverer
[18:49:39] [Client thread/INFO] [FML]: Searching C:\Users\Bloopers\Desktop\Coding\Coding 1.9\1.10 test\Spears\run\mods for mods
[18:49:41] [Client thread/INFO] [FML]: Forge Mod Loader has identified 4 mods to load
[18:49:41] [Client thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, Forge, spear] at CLIENT
[18:49:41] [Client thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, Forge, spear] at SERVER
[18:49:42] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:Spears
[18:49:42] [Client thread/INFO] [FML]: Processing ObjectHolder annotations
[18:49:42] [Client thread/INFO] [FML]: Found 423 ObjectHolder annotations
[18:49:42] [Client thread/INFO] [FML]: Identifying ItemStackHolder annotations
[18:49:42] [Client thread/INFO] [FML]: Found 0 ItemStackHolder annotations
[18:49:42] [Client thread/INFO] [FML]: Configured a dormant chunk cache size of 0
[18:49:42] [Forge Version Check/INFO] [ForgeVersionCheck]: [Forge] Starting version check at http://files.minecraftforge.net/maven/net/minecraftforge/forge/promotions_slim.json
[18:49:42] [Client thread/INFO] [sTDOUT]: [bloopers.spearmod.SpearMod:preInit:38]: PreInit
[18:49:42] [Client thread/INFO] [FML]: Applying holder lookups
[18:49:42] [Client thread/INFO] [FML]: Holder lookups applied
[18:49:42] [Client thread/INFO] [FML]: Injecting itemstacks
[18:49:42] [Client thread/INFO] [FML]: Itemstack injection complete
[18:49:42] [Forge Version Check/INFO] [ForgeVersionCheck]: [Forge] Found status: OUTDATED Target: 12.18.1.2088
[18:49:44] [sound Library Loader/INFO]: Starting up SoundSystem...
[18:49:45] [Thread-8/INFO]: Initializing LWJGL OpenAL
[18:49:45] [Thread-8/INFO]: (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)
[18:49:45] [Thread-8/INFO]: OpenAL initialized.
[18:49:45] [sound Library Loader/INFO]: Sound engine started
[18:49:48] [Client thread/INFO] [FML]: Max texture size: 16384
[18:49:48] [Client thread/INFO]: Created: 16x16 textures-atlas
[18:49:49] [Client thread/ERROR] [FML]: Exception loading model for variant spear:primitive_spear#inventory for item "spear:primitive_spear", normal location exception: 
net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model spear:item/primitive_spear with loader VanillaLoader.INSTANCE, skipping
at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:153) ~[ModelLoaderRegistry.class:?]
at net.minecraftforge.client.model.ModelLoader.loadItemModels(ModelLoader.java:317) ~[ModelLoader.class:?]
at net.minecraft.client.renderer.block.model.ModelBakery.loadVariantItemModels(ModelBakery.java:170) ~[ModelBakery.class:?]
at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:147) ~[ModelLoader.class:?]
at net.minecraft.client.renderer.block.model.ModelManager.onResourceManagerReload(ModelManager.java:28) [ModelManager.class:?]
at net.minecraft.client.resources.SimpleReloadableResourceManager.registerReloadListener(SimpleReloadableResourceManager.java:122) [simpleReloadableResourceManager.class:?]
at net.minecraft.client.Minecraft.startGame(Minecraft.java:540) [Minecraft.class:?]
at net.minecraft.client.Minecraft.run(Minecraft.java:386) [Minecraft.class:?]
at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_91]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_91]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_91]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_91]
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_91]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_91]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_91]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_91]
at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
at GradleStart.main(GradleStart.java:26) [start/:?]
Caused by: java.io.FileNotFoundException: spear:models/item/primitive_spear.json
at net.minecraft.client.resources.SimpleReloadableResourceManager.getResource(SimpleReloadableResourceManager.java:69) ~[simpleReloadableResourceManager.class:?]
at net.minecraft.client.renderer.block.model.ModelBakery.loadModel(ModelBakery.java:311) ~[ModelBakery.class:?]
at net.minecraftforge.client.model.ModelLoader.access$1100(ModelLoader.java:118) ~[ModelLoader.class:?]
at net.minecraftforge.client.model.ModelLoader$VanillaLoader.loadModel(ModelLoader.java:868) ~[ModelLoader$VanillaLoader.class:?]
at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:149) ~[ModelLoaderRegistry.class:?]
... 20 more
[18:49:49] [Client thread/ERROR] [FML]: Exception loading model for variant spear:primitive_spear#inventory for item "spear:primitive_spear", blockstate location exception: 
net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model spear:primitive_spear#inventory with loader VariantLoader.INSTANCE, skipping
at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:153) ~[ModelLoaderRegistry.class:?]
at net.minecraftforge.client.model.ModelLoader.loadItemModels(ModelLoader.java:325) ~[ModelLoader.class:?]
at net.minecraft.client.renderer.block.model.ModelBakery.loadVariantItemModels(ModelBakery.java:170) ~[ModelBakery.class:?]
at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:147) ~[ModelLoader.class:?]
at net.minecraft.client.renderer.block.model.ModelManager.onResourceManagerReload(ModelManager.java:28) [ModelManager.class:?]
at net.minecraft.client.resources.SimpleReloadableResourceManager.registerReloadListener(SimpleReloadableResourceManager.java:122) [simpleReloadableResourceManager.class:?]
at net.minecraft.client.Minecraft.startGame(Minecraft.java:540) [Minecraft.class:?]
at net.minecraft.client.Minecraft.run(Minecraft.java:386) [Minecraft.class:?]
at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_91]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_91]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_91]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_91]
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_91]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_91]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_91]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_91]
at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
at GradleStart.main(GradleStart.java:26) [start/:?]
Caused by: net.minecraft.client.renderer.block.model.ModelBlockDefinition$MissingVariantException
at net.minecraft.client.renderer.block.model.ModelBlockDefinition.getVariant(ModelBlockDefinition.java:78) ~[ModelBlockDefinition.class:?]
at net.minecraftforge.client.model.ModelLoader$VariantLoader.loadModel(ModelLoader.java:1184) ~[ModelLoader$VariantLoader.class:?]
at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:149) ~[ModelLoaderRegistry.class:?]
... 20 more
[18:49:50] [Client thread/INFO] [sTDOUT]: [bloopers.spearmod.SpearMod:Init:46]: Init
[18:49:50] [Client thread/INFO] [FML]: Injecting itemstacks
[18:49:50] [Client thread/INFO] [FML]: Itemstack injection complete
[18:49:50] [Client thread/INFO] [sTDOUT]: [bloopers.spearmod.SpearMod:postInit:63]: PostInit
[18:49:50] [Client thread/INFO] [FML]: Forge Mod Loader has successfully loaded 4 mods
[18:49:50] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:Spears
[18:49:52] [Client thread/INFO]: SoundSystem shutting down...
[18:49:52] [Client thread/WARN]: Author: Paul Lamb, www.paulscode.com
[18:49:52] [sound Library Loader/INFO]: Starting up SoundSystem...
[18:49:52] [Thread-10/INFO]: Initializing LWJGL OpenAL
[18:49:52] [Thread-10/INFO]: (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)
[18:49:52] [Thread-10/INFO]: OpenAL initialized.
[18:49:53] [sound Library Loader/INFO]: Sound engine started
[18:49:55] [Client thread/INFO] [FML]: Max texture size: 16384
[18:49:55] [Client thread/INFO]: Created: 1024x512 textures-atlas
[18:49:56] [Client thread/ERROR] [FML]: Exception loading model for variant spear:primitive_spear#inventory for item "spear:primitive_spear", normal location exception: 
net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model spear:item/primitive_spear with loader VanillaLoader.INSTANCE, skipping
at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:153) ~[ModelLoaderRegistry.class:?]
at net.minecraftforge.client.model.ModelLoader.loadItemModels(ModelLoader.java:317) ~[ModelLoader.class:?]
at net.minecraft.client.renderer.block.model.ModelBakery.loadVariantItemModels(ModelBakery.java:170) ~[ModelBakery.class:?]
at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:147) ~[ModelLoader.class:?]
at net.minecraft.client.renderer.block.model.ModelManager.onResourceManagerReload(ModelManager.java:28) [ModelManager.class:?]
at net.minecraft.client.resources.SimpleReloadableResourceManager.notifyReloadListeners(SimpleReloadableResourceManager.java:132) [simpleReloadableResourceManager.class:?]
at net.minecraft.client.resources.SimpleReloadableResourceManager.reloadResources(SimpleReloadableResourceManager.java:113) [simpleReloadableResourceManager.class:?]
at net.minecraft.client.Minecraft.refreshResources(Minecraft.java:799) [Minecraft.class:?]
at net.minecraftforge.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:338) [FMLClientHandler.class:?]
at net.minecraft.client.Minecraft.startGame(Minecraft.java:561) [Minecraft.class:?]
at net.minecraft.client.Minecraft.run(Minecraft.java:386) [Minecraft.class:?]
at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_91]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_91]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_91]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_91]
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_91]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_91]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_91]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_91]
at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
at GradleStart.main(GradleStart.java:26) [start/:?]
Caused by: java.io.FileNotFoundException: spear:models/item/primitive_spear.json
at net.minecraft.client.resources.SimpleReloadableResourceManager.getResource(SimpleReloadableResourceManager.java:69) ~[simpleReloadableResourceManager.class:?]
at net.minecraft.client.renderer.block.model.ModelBakery.loadModel(ModelBakery.java:311) ~[ModelBakery.class:?]
at net.minecraftforge.client.model.ModelLoader.access$1100(ModelLoader.java:118) ~[ModelLoader.class:?]
at net.minecraftforge.client.model.ModelLoader$VanillaLoader.loadModel(ModelLoader.java:868) ~[ModelLoader$VanillaLoader.class:?]
at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:149) ~[ModelLoaderRegistry.class:?]
... 23 more
[18:49:56] [Client thread/ERROR] [FML]: Exception loading model for variant spear:primitive_spear#inventory for item "spear:primitive_spear", blockstate location exception: 
net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model spear:primitive_spear#inventory with loader VariantLoader.INSTANCE, skipping
at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:153) ~[ModelLoaderRegistry.class:?]
at net.minecraftforge.client.model.ModelLoader.loadItemModels(ModelLoader.java:325) ~[ModelLoader.class:?]
at net.minecraft.client.renderer.block.model.ModelBakery.loadVariantItemModels(ModelBakery.java:170) ~[ModelBakery.class:?]
at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:147) ~[ModelLoader.class:?]
at net.minecraft.client.renderer.block.model.ModelManager.onResourceManagerReload(ModelManager.java:28) [ModelManager.class:?]
at net.minecraft.client.resources.SimpleReloadableResourceManager.notifyReloadListeners(SimpleReloadableResourceManager.java:132) [simpleReloadableResourceManager.class:?]
at net.minecraft.client.resources.SimpleReloadableResourceManager.reloadResources(SimpleReloadableResourceManager.java:113) [simpleReloadableResourceManager.class:?]
at net.minecraft.client.Minecraft.refreshResources(Minecraft.java:799) [Minecraft.class:?]
at net.minecraftforge.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:338) [FMLClientHandler.class:?]
at net.minecraft.client.Minecraft.startGame(Minecraft.java:561) [Minecraft.class:?]
at net.minecraft.client.Minecraft.run(Minecraft.java:386) [Minecraft.class:?]
at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_91]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_91]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_91]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_91]
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_91]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_91]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_91]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_91]
at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
at GradleStart.main(GradleStart.java:26) [start/:?]
Caused by: net.minecraft.client.renderer.block.model.ModelBlockDefinition$MissingVariantException
at net.minecraft.client.renderer.block.model.ModelBlockDefinition.getVariant(ModelBlockDefinition.java:78) ~[ModelBlockDefinition.class:?]
at net.minecraftforge.client.model.ModelLoader$VariantLoader.loadModel(ModelLoader.java:1184) ~[ModelLoader$VariantLoader.class:?]
at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:149) ~[ModelLoaderRegistry.class:?]
... 23 more
[18:49:56] [Client thread/WARN]: Skipping bad option: lastServer:
[18:49:56] [Realms Notification Availability checker #1/INFO]: Could not authorize you against Realms server: Invalid session id
[18:50:09] [server thread/INFO]: Starting integrated minecraft server version 1.10.2
[18:50:09] [server thread/INFO]: Generating keypair
[18:50:09] [server thread/INFO] [FML]: Injecting existing block and item data into this server instance
[18:50:09] [server thread/INFO] [FML]: Applying holder lookups
[18:50:09] [server thread/INFO] [FML]: Holder lookups applied
[18:50:10] [server thread/INFO] [FML]: Loading dimension 0 (New World) (net.minecraft.server.integrated.IntegratedServer@61c3754c)
[18:50:10] [server thread/INFO] [FML]: Loading dimension 1 (New World) (net.minecraft.server.integrated.IntegratedServer@61c3754c)
[18:50:10] [server thread/INFO] [FML]: Loading dimension -1 (New World) (net.minecraft.server.integrated.IntegratedServer@61c3754c)
[18:50:10] [server thread/INFO]: Preparing start region for level 0
[18:50:11] [server thread/WARN]: Keeping entity Villager that already exists with UUID 8fed010b-2e3d-47ff-8922-fe4f8a6af0ef
[18:50:11] [server thread/WARN]: Keeping entity Villager that already exists with UUID 7b2373b1-a203-4ea8-beb1-5cf3fd1d6cce
[18:50:11] [server thread/INFO]: Preparing spawn area: 20%
[18:50:12] [server thread/INFO]: Changing view distance to 12, from 10
[18:50:13] [Netty Local Client IO #0/INFO] [FML]: Server protocol version 2
[18:50:13] [Netty Server IO #1/INFO] [FML]: Client protocol version 2
[18:50:13] [Netty Server IO #1/INFO] [FML]: Client attempting to join with 4 mods : [email protected],[email protected],[email protected],[email protected]
[18:50:13] [Netty Local Client IO #0/INFO] [FML]: [Netty Local Client IO #0] Client side modded connection established
[18:50:13] [server thread/INFO] [FML]: [server thread] Server side modded connection established
[18:50:13] [server thread/INFO]: Player852[local:E:4035c739] logged in with entity id 211 at (-388.79973705526345, 74.69045979234048, 824.1225288717329)
[18:50:13] [server thread/INFO]: Player852 joined the game
[18:50:14] [server thread/INFO]: Saving and pausing game...
[18:50:14] [server thread/INFO]: Saving chunks for level 'New World'/Overworld
[18:50:14] [pool-2-thread-1/WARN]: Couldn't look up profile properties for com.mojang.authlib.GameProfile@7bd42914[id=ab110892-c6b2-3de5-8fa5-f01e37cd4065,name=Player852,properties={},legacy=false]
com.mojang.authlib.exceptions.AuthenticationException: The client has sent too many requests within a certain amount of time
at com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService.makeRequest(YggdrasilAuthenticationService.java:65) ~[YggdrasilAuthenticationService.class:?]
at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService.fillGameProfile(YggdrasilMinecraftSessionService.java:175) [YggdrasilMinecraftSessionService.class:?]
at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService$1.load(YggdrasilMinecraftSessionService.java:59) [YggdrasilMinecraftSessionService$1.class:?]
at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService$1.load(YggdrasilMinecraftSessionService.java:56) [YggdrasilMinecraftSessionService$1.class:?]
at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3524) [guava-17.0.jar:?]
at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2317) [guava-17.0.jar:?]
at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2280) [guava-17.0.jar:?]
at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2195) [guava-17.0.jar:?]
at com.google.common.cache.LocalCache.get(LocalCache.java:3934) [guava-17.0.jar:?]
at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3938) [guava-17.0.jar:?]
at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4821) [guava-17.0.jar:?]
at com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:4827) [guava-17.0.jar:?]
at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService.fillProfileProperties(YggdrasilMinecraftSessionService.java:165) [YggdrasilMinecraftSessionService.class:?]
at net.minecraft.client.Minecraft.getProfileProperties(Minecraft.java:3060) [Minecraft.class:?]
at net.minecraft.client.resources.SkinManager$3.run(SkinManager.java:131) [skinManager$3.class:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_91]
at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_91]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:1.8.0_91]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:1.8.0_91]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_91]
[18:50:14] [server thread/INFO]: Saving chunks for level 'New World'/Nether
[18:50:14] [server thread/INFO]: Saving chunks for level 'New World'/The End
[18:50:16] [Client thread/INFO] [sTDOUT]: [bloopers.spearmod.reach.MessageExtendedReachAttack:<init>:28]: Constructor
[18:50:16] [Client thread/INFO] [sTDOUT]: [bloopers.spearmod.reach.MessageExtendedReachAttack:toBytes:44]: toBytes encoded
[18:50:16] [Netty Server IO #1/INFO] [sTDOUT]: [bloopers.spearmod.reach.MessageExtendedReachAttack:fromBytes:36]: fromBytes
[18:50:16] [Netty Server IO #1/INFO] [sTDOUT]: [bloopers.spearmod.reach.MessageExtendedReachAttack$Handler:onMessage:55]: Message received
[18:50:16] [Netty Server IO #1/ERROR] [FML]: SimpleChannelHandlerWrapper exception
java.lang.NullPointerException
at bloopers.spearmod.reach.MessageExtendedReachAttack$Handler.onMessage(MessageExtendedReachAttack.java:59) ~[MessageExtendedReachAttack$Handler.class:?]
at bloopers.spearmod.reach.MessageExtendedReachAttack$Handler.onMessage(MessageExtendedReachAttack.java:1) ~[MessageExtendedReachAttack$Handler.class:?]
at net.minecraftforge.fml.common.network.simpleimpl.SimpleChannelHandlerWrapper.channelRead0(SimpleChannelHandlerWrapper.java:56) ~[simpleChannelHandlerWrapper.class:?]
at net.minecraftforge.fml.common.network.simpleimpl.SimpleChannelHandlerWrapper.channelRead0(SimpleChannelHandlerWrapper.java:36) ~[simpleChannelHandlerWrapper.class:?]
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) ~[simpleChannelInboundHandler.class:4.0.23.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) [AbstractChannelHandlerContext.class:4.0.23.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) [AbstractChannelHandlerContext.class:4.0.23.Final]
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) [MessageToMessageDecoder.class:4.0.23.Final]
at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111) [MessageToMessageCodec.class:4.0.23.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) [AbstractChannelHandlerContext.class:4.0.23.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) [AbstractChannelHandlerContext.class:4.0.23.Final]
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:787) [DefaultChannelPipeline.class:4.0.23.Final]
at io.netty.channel.embedded.EmbeddedChannel.writeInbound(EmbeddedChannel.java:169) [EmbeddedChannel.class:4.0.23.Final]
at net.minecraftforge.fml.common.network.internal.FMLProxyPacket.processPacket(FMLProxyPacket.java:109) [FMLProxyPacket.class:?]
at net.minecraft.network.NetworkManager.channelRead0(NetworkManager.java:156) [NetworkManager.class:?]
at net.minecraft.network.NetworkManager.channelRead0(NetworkManager.java:51) [NetworkManager.class:?]
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) [simpleChannelInboundHandler.class:4.0.23.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) [AbstractChannelHandlerContext.class:4.0.23.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) [AbstractChannelHandlerContext.class:4.0.23.Final]
at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.handleServerSideCustomPacket(NetworkDispatcher.java:449) [NetworkDispatcher.class:?]
at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.channelRead0(NetworkDispatcher.java:272) [NetworkDispatcher.class:?]
at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.channelRead0(NetworkDispatcher.java:73) [NetworkDispatcher.class:?]
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) [simpleChannelInboundHandler.class:4.0.23.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) [AbstractChannelHandlerContext.class:4.0.23.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) [AbstractChannelHandlerContext.class:4.0.23.Final]
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:787) [DefaultChannelPipeline.class:4.0.23.Final]
at io.netty.channel.local.LocalChannel.finishPeerRead(LocalChannel.java:326) [LocalChannel.class:4.0.23.Final]
at io.netty.channel.local.LocalChannel.access$400(LocalChannel.java:45) [LocalChannel.class:4.0.23.Final]
at io.netty.channel.local.LocalChannel$5.run(LocalChannel.java:312) [LocalChannel$5.class:4.0.23.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:380) [singleThreadEventExecutor.class:4.0.23.Final]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:357) [NioEventLoop.class:4.0.23.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116) [singleThreadEventExecutor$2.class:4.0.23.Final]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_91]
[18:50:16] [Netty Server IO #1/ERROR] [FML]: There was a critical exception handling a packet on channel network
java.lang.NullPointerException
at bloopers.spearmod.reach.MessageExtendedReachAttack$Handler.onMessage(MessageExtendedReachAttack.java:59) ~[MessageExtendedReachAttack$Handler.class:?]
at bloopers.spearmod.reach.MessageExtendedReachAttack$Handler.onMessage(MessageExtendedReachAttack.java:1) ~[MessageExtendedReachAttack$Handler.class:?]
at net.minecraftforge.fml.common.network.simpleimpl.SimpleChannelHandlerWrapper.channelRead0(SimpleChannelHandlerWrapper.java:56) ~[simpleChannelHandlerWrapper.class:?]
at net.minecraftforge.fml.common.network.simpleimpl.SimpleChannelHandlerWrapper.channelRead0(SimpleChannelHandlerWrapper.java:36) ~[simpleChannelHandlerWrapper.class:?]
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) ~[simpleChannelInboundHandler.class:4.0.23.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) ~[AbstractChannelHandlerContext.class:4.0.23.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) ~[AbstractChannelHandlerContext.class:4.0.23.Final]
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) ~[MessageToMessageDecoder.class:4.0.23.Final]
at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111) ~[MessageToMessageCodec.class:4.0.23.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) ~[AbstractChannelHandlerContext.class:4.0.23.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) ~[AbstractChannelHandlerContext.class:4.0.23.Final]
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:787) ~[DefaultChannelPipeline.class:4.0.23.Final]
at io.netty.channel.embedded.EmbeddedChannel.writeInbound(EmbeddedChannel.java:169) ~[EmbeddedChannel.class:4.0.23.Final]
at net.minecraftforge.fml.common.network.internal.FMLProxyPacket.processPacket(FMLProxyPacket.java:109) [FMLProxyPacket.class:?]
at net.minecraft.network.NetworkManager.channelRead0(NetworkManager.java:156) [NetworkManager.class:?]
at net.minecraft.network.NetworkManager.channelRead0(NetworkManager.java:51) [NetworkManager.class:?]
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) [simpleChannelInboundHandler.class:4.0.23.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) [AbstractChannelHandlerContext.class:4.0.23.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) [AbstractChannelHandlerContext.class:4.0.23.Final]
at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.handleServerSideCustomPacket(NetworkDispatcher.java:449) [NetworkDispatcher.class:?]
at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.channelRead0(NetworkDispatcher.java:272) [NetworkDispatcher.class:?]
at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.channelRead0(NetworkDispatcher.java:73) [NetworkDispatcher.class:?]
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) [simpleChannelInboundHandler.class:4.0.23.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) [AbstractChannelHandlerContext.class:4.0.23.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) [AbstractChannelHandlerContext.class:4.0.23.Final]
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:787) [DefaultChannelPipeline.class:4.0.23.Final]
at io.netty.channel.local.LocalChannel.finishPeerRead(LocalChannel.java:326) [LocalChannel.class:4.0.23.Final]
at io.netty.channel.local.LocalChannel.access$400(LocalChannel.java:45) [LocalChannel.class:4.0.23.Final]
at io.netty.channel.local.LocalChannel$5.run(LocalChannel.java:312) [LocalChannel$5.class:4.0.23.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:380) [singleThreadEventExecutor.class:4.0.23.Final]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:357) [NioEventLoop.class:4.0.23.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116) [singleThreadEventExecutor$2.class:4.0.23.Final]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_91]
[18:50:16] [server thread/INFO]: Player852 lost connection: TextComponent{text='A fatal error has occurred, this connection is terminated', siblings=[], style=Style{hasParent=false, color=null, bold=null, italic=null, underlined=null, obfuscated=null, clickEvent=null, hoverEvent=null, insertion=null}}
[18:50:16] [server thread/INFO]: Player852 left the game
[18:50:16] [server thread/INFO]: Stopping singleplayer server as player logged out
[18:50:16] [server thread/INFO]: Stopping server
[18:50:16] [server thread/INFO]: Saving players
[18:50:16] [server thread/INFO]: Saving worlds
[18:50:16] [server thread/INFO]: Saving chunks for level 'New World'/Overworld
[18:50:16] [server thread/INFO]: Saving chunks for level 'New World'/Nether
[18:50:16] [server thread/INFO]: Saving chunks for level 'New World'/The End
[18:50:17] [server thread/INFO] [FML]: Unloading dimension 0
[18:50:17] [server thread/INFO] [FML]: Unloading dimension -1
[18:50:17] [server thread/INFO] [FML]: Unloading dimension 1
[18:50:17] [server thread/INFO] [FML]: Applying holder lookups
[18:50:17] [server thread/INFO] [FML]: Holder lookups applied

 

Posted

java.lang.NullPointerException

at bloopers.spearmod.reach.MessageExtendedReachAttack$Handler.onMessage(MessageExtendedReachAttack.java:59)

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted

java.lang.NullPointerException

at bloopers.spearmod.reach.MessageExtendedReachAttack$Handler.onMessage(MessageExtendedReachAttack.java:59)

Does this mean it is returning null? And if so, where is it returning null? I don't see it anywhere.

Posted

Hey Bloopers, sorry you'r having trouble following my tutorial. In terms of extended reach, the idea is you need to send a custom packet and that requires some knowledge to do that (which isn't specifically described in that tutorial because different people have different approaches to it).

 

I do have a separate tutorial for custom packets: http://jabelarminecraft.blogspot.com/p/minecraft-forge.html Note that this was written for 1.8 and haven't had time to do any updating that may be necessary for 1.10. So you might want to look for tutorials on 1.10 custom packets.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements




  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Version 1.19 - Forge 41.0.63 I want to create a wolf entity that I can ride, so far it seems to be working, but the problem is that when I get on the wolf, I can’t control it. I then discovered that the issue is that the server doesn’t detect that I’m riding the wolf, so I’m struggling with synchronization. However, it seems to not be working properly. As I understand it, the server receives the packet but doesn’t register it correctly. I’m a bit new to Java, and I’ll try to provide all the relevant code and prints *The comments and prints are translated by chatgpt since they were originally in Spanish* Thank you very much in advance No player is mounted, or the passenger is not a player. No player is mounted, or the passenger is not a player. No player is mounted, or the passenger is not a player. No player is mounted, or the passenger is not a player. No player is mounted, or the passenger is not a player. MountableWolfEntity package com.vals.valscraft.entity; import com.vals.valscraft.network.MountSyncPacket; import com.vals.valscraft.network.NetworkHandler; import net.minecraft.client.Minecraft; import net.minecraft.network.syncher.EntityDataAccessor; import net.minecraft.network.syncher.EntityDataSerializers; import net.minecraft.network.syncher.SynchedEntityData; import net.minecraft.server.MinecraftServer; import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.Mob; import net.minecraft.world.entity.ai.attributes.AttributeSupplier; import net.minecraft.world.entity.ai.attributes.Attributes; import net.minecraft.world.entity.animal.Wolf; import net.minecraft.world.entity.player.Player; import net.minecraft.world.entity.Entity; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; import net.minecraft.world.level.Level; import net.minecraft.world.phys.Vec3; import net.minecraftforge.event.TickEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.network.PacketDistributor; public class MountableWolfEntity extends Wolf { private boolean hasSaddle; private static final EntityDataAccessor<Byte> DATA_ID_FLAGS = SynchedEntityData.defineId(MountableWolfEntity.class, EntityDataSerializers.BYTE); public MountableWolfEntity(EntityType<? extends Wolf> type, Level level) { super(type, level); this.hasSaddle = false; } @Override protected void defineSynchedData() { super.defineSynchedData(); this.entityData.define(DATA_ID_FLAGS, (byte)0); } public static AttributeSupplier.Builder createAttributes() { return Wolf.createAttributes() .add(Attributes.MAX_HEALTH, 20.0) .add(Attributes.MOVEMENT_SPEED, 0.3); } @Override public InteractionResult mobInteract(Player player, InteractionHand hand) { ItemStack itemstack = player.getItemInHand(hand); if (itemstack.getItem() == Items.SADDLE && !this.hasSaddle()) { if (!player.isCreative()) { itemstack.shrink(1); } this.setSaddle(true); return InteractionResult.SUCCESS; } else if (!level.isClientSide && this.hasSaddle()) { player.startRiding(this); MountSyncPacket packet = new MountSyncPacket(true); // 'true' means the player is mounted NetworkHandler.CHANNEL.sendToServer(packet); // Ensure the server handles the packet return InteractionResult.SUCCESS; } return InteractionResult.PASS; } @Override public void travel(Vec3 travelVector) { if (this.isVehicle() && this.getControllingPassenger() instanceof Player) { System.out.println("The wolf has a passenger."); System.out.println("The passenger is a player."); Player player = (Player) this.getControllingPassenger(); // Ensure the player is the controller this.setYRot(player.getYRot()); this.yRotO = this.getYRot(); this.setXRot(player.getXRot() * 0.5F); this.setRot(this.getYRot(), this.getXRot()); this.yBodyRot = this.getYRot(); this.yHeadRot = this.yBodyRot; float forward = player.zza; float strafe = player.xxa; if (forward <= 0.0F) { forward *= 0.25F; } this.flyingSpeed = this.getSpeed() * 0.1F; this.setSpeed((float) this.getAttributeValue(Attributes.MOVEMENT_SPEED) * 1.5F); this.setDeltaMovement(new Vec3(strafe, travelVector.y, forward).scale(this.getSpeed())); this.calculateEntityAnimation(this, false); } else { // The wolf does not have a passenger or the passenger is not a player System.out.println("No player is mounted, or the passenger is not a player."); super.travel(travelVector); } } public boolean hasSaddle() { return this.hasSaddle; } public void setSaddle(boolean hasSaddle) { this.hasSaddle = hasSaddle; } @Override protected void dropEquipment() { super.dropEquipment(); if (this.hasSaddle()) { this.spawnAtLocation(Items.SADDLE); this.setSaddle(false); } } @SubscribeEvent public static void onServerTick(TickEvent.ServerTickEvent event) { if (event.phase == TickEvent.Phase.START) { MinecraftServer server = net.minecraftforge.server.ServerLifecycleHooks.getCurrentServer(); if (server != null) { for (ServerPlayer player : server.getPlayerList().getPlayers()) { if (player.isPassenger() && player.getVehicle() instanceof MountableWolfEntity) { MountableWolfEntity wolf = (MountableWolfEntity) player.getVehicle(); System.out.println("Tick: " + player.getName().getString() + " is correctly mounted on " + wolf); } } } } } private boolean lastMountedState = false; @Override public void tick() { super.tick(); if (!this.level.isClientSide) { // Only on the server boolean isMounted = this.isVehicle() && this.getControllingPassenger() instanceof Player; // Only print if the state changed if (isMounted != lastMountedState) { if (isMounted) { Player player = (Player) this.getControllingPassenger(); // Verify the passenger is a player System.out.println("Server: Player " + player.getName().getString() + " is now mounted."); } else { System.out.println("Server: The wolf no longer has a passenger."); } lastMountedState = isMounted; } } } @Override public void addPassenger(Entity passenger) { super.addPassenger(passenger); if (passenger instanceof Player) { Player player = (Player) passenger; if (!this.level.isClientSide && player instanceof ServerPlayer) { // Send the packet to the server to indicate the player is mounted NetworkHandler.CHANNEL.send(PacketDistributor.PLAYER.with(() -> (ServerPlayer) player), new MountSyncPacket(true)); } } } @Override public void removePassenger(Entity passenger) { super.removePassenger(passenger); if (passenger instanceof Player) { Player player = (Player) passenger; if (!this.level.isClientSide && player instanceof ServerPlayer) { // Send the packet to the server to indicate the player is no longer mounted NetworkHandler.CHANNEL.send(PacketDistributor.PLAYER.with(() -> (ServerPlayer) player), new MountSyncPacket(false)); } } } @Override public boolean isControlledByLocalInstance() { Entity entity = this.getControllingPassenger(); return entity instanceof Player; } @Override public void positionRider(Entity passenger) { if (this.hasPassenger(passenger)) { double xOffset = Math.cos(Math.toRadians(this.getYRot() + 90)) * 0.4; double zOffset = Math.sin(Math.toRadians(this.getYRot() + 90)) * 0.4; passenger.setPos(this.getX() + xOffset, this.getY() + this.getPassengersRidingOffset() + passenger.getMyRidingOffset(), this.getZ() + zOffset); } } } MountSyncPacket package com.vals.valscraft.network; import com.vals.valscraft.entity.MountableWolfEntity; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.server.level.ServerLevel; import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.player.Player; import net.minecraftforge.network.NetworkEvent; import java.util.function.Supplier; public class MountSyncPacket { private final boolean isMounted; public MountSyncPacket(boolean isMounted) { this.isMounted = isMounted; } public void encode(FriendlyByteBuf buffer) { buffer.writeBoolean(isMounted); } public static MountSyncPacket decode(FriendlyByteBuf buffer) { return new MountSyncPacket(buffer.readBoolean()); } public void handle(NetworkEvent.Context context) { context.enqueueWork(() -> { ServerPlayer player = context.getSender(); // Get the player from the context if (player != null) { // Verifies if the player has dismounted if (!isMounted) { Entity vehicle = player.getVehicle(); if (vehicle instanceof MountableWolfEntity wolf) { // Logic to remove the player as a passenger wolf.removePassenger(player); System.out.println("Server: Player " + player.getName().getString() + " is no longer mounted."); } } } }); context.setPacketHandled(true); // Marks the packet as handled } } networkHandler package com.vals.valscraft.network; import com.vals.valscraft.valscraft; import net.minecraft.resources.ResourceLocation; import net.minecraftforge.network.NetworkRegistry; import net.minecraftforge.network.simple.SimpleChannel; import net.minecraftforge.network.NetworkEvent; import java.util.function.Supplier; public class NetworkHandler { private static final String PROTOCOL_VERSION = "1"; public static final SimpleChannel CHANNEL = NetworkRegistry.newSimpleChannel( new ResourceLocation(valscraft.MODID, "main"), () -> PROTOCOL_VERSION, PROTOCOL_VERSION::equals, PROTOCOL_VERSION::equals ); public static void init() { int packetId = 0; // Register the mount synchronization packet CHANNEL.registerMessage( packetId++, MountSyncPacket.class, MountSyncPacket::encode, MountSyncPacket::decode, (msg, context) -> msg.handle(context.get()) // Get the context with context.get() ); } }  
    • Do you use features of inventory profiles next (ipnext) or is there a change without it?
    • Remove rubidium - you are already using embeddium, which is a fork of rubidium
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.