Jump to content

[1.8] [Solved] npe ...#attackEntityWithRangedAttack


Recommended Posts

Posted

Crash report -- happens when two mobs attack each other ...everything was A-okay in 1.7.10

 

 

Description: Ticking entity

 

java.lang.NullPointerException: Ticking entity

at com.glistre.glistremod.projectiles.blaster.EntityBlasterBolt.<init>(EntityBlasterBolt.java:94)

at com.glistre.glistremod.entities.guardian.EntityTobieSkel.attackEntityWithRangedAttack(EntityTobieSkel.java:447)

at net.minecraft.entity.ai.EntityAIArrowAttack.updateTask(EntityAIArrowAttack.java:129)

at net.minecraft.entity.ai.EntityAITasks.onUpdateTasks(EntityAITasks.java:117)

at net.minecraft.entity.EntityLiving.updateEntityActionState(EntityLiving.java:637)

at net.minecraft.entity.EntityLivingBase.onLivingUpdate(EntityLivingBase.java:1993)

at net.minecraft.entity.EntityLiving.onLivingUpdate(EntityLiving.java:449)

at net.minecraft.entity.monster.EntityMob.onLivingUpdate(EntityMob.java:54)

at net.minecraft.entity.EntityLivingBase.onUpdate(EntityLivingBase.java:1828)

at net.minecraft.entity.EntityLiving.onUpdate(EntityLiving.java:273)

at net.minecraft.entity.monster.EntityMob.onUpdate(EntityMob.java:62)

at net.minecraft.world.World.updateEntityWithOptionalForce(World.java:2031)

at net.minecraft.world.WorldServer.updateEntityWithOptionalForce(WorldServer.java:758)

at net.minecraft.world.World.updateEntity(World.java:1997)

at net.minecraft.world.World.updateEntities(World.java:1823)

at net.minecraft.world.WorldServer.updateEntities(WorldServer.java:587)

at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:775)

at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:669)

at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:171)

at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:540)

at java.lang.Thread.run(Unknown Source)

 

 

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

---------------------------------------------------------------------------------------

 

-- Head --

Stacktrace:

at com.glistre.glistremod.projectiles.blaster.EntityBlasterBolt.<init>(EntityBlasterBolt.java:94)

at com.glistre.glistremod.entities.guardian.EntityTobieSkel.attackEntityWithRangedAttack(EntityTobieSkel.java:447)

at net.minecraft.entity.ai.EntityAIArrowAttack.updateTask(EntityAIArrowAttack.java:129)

at net.minecraft.entity.ai.EntityAITasks.onUpdateTasks(EntityAITasks.java:117)

at net.minecraft.entity.EntityLiving.updateEntityActionState(EntityLiving.java:637)

at net.minecraft.entity.EntityLivingBase.onLivingUpdate(EntityLivingBase.java:1993)

at net.minecraft.entity.EntityLiving.onLivingUpdate(EntityLiving.java:449)

at net.minecraft.entity.monster.EntityMob.onLivingUpdate(EntityMob.java:54)

at net.minecraft.entity.EntityLivingBase.onUpdate(EntityLivingBase.java:1828)

at net.minecraft.entity.EntityLiving.onUpdate(EntityLiving.java:273)

at net.minecraft.entity.monster.EntityMob.onUpdate(EntityMob.java:62)

at net.minecraft.world.World.updateEntityWithOptionalForce(World.java:2031)

at net.minecraft.world.WorldServer.updateEntityWithOptionalForce(WorldServer.java:758)

at net.minecraft.world.World.updateEntity(World.java:1997)

 

-- Entity being ticked --

Details:

Entity Type: glistremod.tobie_skelly_guardian (com.glistre.glistremod.entities.guardian.EntityTobieSkel)

Entity ID: 32071

Entity Name: §6Tobie Guardian

Entity's Exact location: -317.08, 82.00, 233.51

Entity's Block location: -318.00,82.00,233.00 - World: (-318,82,233), Chunk: (at 2,5,9 in -20,14; contains blocks -320,0,224 to -305,255,239), Region: (-1,0; contains chunks -32,0 to -1,31, blocks -512,0,0 to -1,255,511)

Entity's Momentum: 0.00, -0.08, 0.00

Entity's Rider: ~~ERROR~~ NullPointerException: null

Entity's Vehicle: ~~ERROR~~ NullPointerException: null

Stacktrace:

at net.minecraft.world.World.updateEntities(World.java:1823)

at net.minecraft.world.WorldServer.updateEntities(WorldServer.java:587)

 

-- Affected level --

Details:

Level name: New Worldc

All players: 1 total; [EntityPlayerMP['Player745'/235, l='New Worldc', x=-249.78, y=85.00, z=296.04]]

Chunk stats: ServerChunkCache: 926 Drop: 0

Level seed: -3751145878116194786

Level generator: ID 00 - default, ver 1. Features enabled: false

Level generator options:

Level spawn location: 0.00,0.00,0.00 - World: (0,0,0), Chunk: (at 0,0,0 in 0,0; contains blocks 0,0,0 to 15,255,15), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511)

Level time: 0 game time, 0 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: ~~ERROR~~ NullPointerException: null

Stacktrace:

at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:775)

at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:669)

at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:171)

at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:540)

at java.lang.Thread.run(Unknown Source)

 

 

 

#attackEntityWithRangedAttack -- my EntityBlasterBolt seems to be returning null cannot figure out why it works fine except in this method

 

    public void attackEntityWithRangedAttack(EntityLivingBase target, float distance)
    {
          EntityBlasterBolt entityblasterbolt = new EntityBlasterBolt(this.worldObj, this, target, 1.6F, (float)(14 - this.worldObj.getDifficulty().getDifficultyId() * 4));

        int i = EnchantmentHelper.getEnchantmentLevel(Enchantment.power.effectId, this.getHeldItem());
        int j = EnchantmentHelper.getEnchantmentLevel(Enchantment.punch.effectId, this.getHeldItem());
        entityblasterbolt.setDamage((double)(distance * 2.0F) + this.rand.nextGaussian() * 0.25D + (double)((float)this.worldObj.getDifficulty().getDifficultyId() * 0.11F));

        if (i > 0)
        {
            entityblasterbolt.setDamage(entityblasterbolt.getDamage() + (double)i * 0.5D + 0.5D);
        }

        if (j > 0)
        {
            entityblasterbolt.setKnockbackStrength(j);
        }

        if (EnchantmentHelper.getEnchantmentLevel(Enchantment.flame.effectId, this.getHeldItem()) > 0 || this.getSkeletonType() == 1)
        {
            entityblasterbolt.setFire(100);
        }

        this.playSound("glistremod:laserblaster", 1.2F, 1.0F / (this.getRNG().nextFloat() * 0.4F + 0.8F));
        this.worldObj.spawnEntityInWorld(entityblasterbolt);
        

        }

 

Posted

Man, if only I knew where it was crashing...might possibly be EntityBlasterBolt.java line 94?

 

No, that couldn't possibly be it.

 

 

Read your god damn crash reports.  If you still can't figure it out, post your damn code.

 

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

Man, if only I knew where it was crashing...might possibly be EntityBlasterBolt.java line 94?

 

No, that couldn't possibly be it.

 

 

Read your god damn crash reports.  If you still can't figure it out, post your damn code.

 

 

I get that but what the heck is wrong with that line?

Posted

Considering that you haven't posted your damn code, how the fuck should I know?

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

Man, if only I knew where it was crashing...might possibly be EntityBlasterBolt.java line 94?

 

No, that couldn't possibly be it.

 

 

Read your god damn crash reports.  If you still can't figure it out, post your damn code.

 

 

Ohhh man, I am so dumb I was looking at the wrong line 94.  Thanks  (no need to curse though)!

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



×
×
  • Create New...

Important Information

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