(If anyone knows Java please help me) Projectile crashes game (different projcetile)

Started by KBEHAN on Mon, 03/27/2017 - 02:00

Topic category: Help with modding (Java Edition)

Last seen on 23:21, 14. Apr 2019
Joined Jul 2015
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
(If anyone knows Java please help me) Projectile crashes game (different projcetile)
Mon, 03/27/2017 - 21:42 (edited)

Ok, I think we all know why I am writing this forum post.  As you can see I failed to code something that works.

My projectile gave no errors, but when I went and rigthclicked my item it shot out and the game crashed. Here is an crash report:

---- Minecraft Crash Report ----
// I just don't know what went wrong :(

Time: 3/26/17 9:57 PM
Description: Ticking entity

java.lang.NullPointerException: Ticking entity
    at mod.mcreator.mcreator_bewitchedSnowball$EntitybewitchedSnowball.onUpdate(mcreator_bewitchedSnowball.java:173)
    at net.minecraft.world.World.updateEntityWithOptionalForce(World.java:2298)
    at net.minecraft.world.World.updateEntity(World.java:2258)
    at net.minecraft.world.World.updateEntities(World.java:2108)
    at net.minecraft.client.Minecraft.runTick(Minecraft.java:2097)
    at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1039)
    at net.minecraft.client.Minecraft.run(Minecraft.java:962)
    at net.minecraft.client.main.Main.main(Main.java:164)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
    at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source)
    at GradleStart.main(Unknown Source)

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

-- Head --
Stacktrace:
    at mod.mcreator.mcreator_bewitchedSnowball$EntitybewitchedSnowball.onUpdate(mcreator_bewitchedSnowball.java:173)
    at net.minecraft.world.World.updateEntityWithOptionalForce(World.java:2298)
    at net.minecraft.world.World.updateEntity(World.java:2258)

-- Entity being ticked --
Details:
    Entity Type: bewitchedSnowball (mod.mcreator.mcreator_bewitchedSnowball.EntitybewitchedSnowball)
    Entity ID: 10136
    Entity Name: BewitchedSnowball
    Entity's Exact location: -72.81, 67.50, 324.66
    Entity's Block location: World: (-73,67,324), Chunk: (at 7,4,4 in -5,20; contains blocks -80,0,320 to -65,255,335), Region: (-1,0; contains chunks -32,0 to -1,31, blocks -512,0,0 to -1,255,511)
    Entity's Momentum: 0.01, -0.21, 1.50
Stacktrace:
    at net.minecraft.world.World.updateEntities(World.java:2108)

-- Affected level --
Details:
    Level name: MpServer
    All players: 1 total; [EntityClientPlayerMP['Player720'/250, l='MpServer', x=-72.63, y=67.62, z=324.68]]
    Chunk stats: MultiplayerChunkCache: 589, 589
    Level seed: 0
    Level generator: ID 00 - default, ver 1. Features enabled: false
    Level generator options:
    Level spawn location: World: (-164,64,256), Chunk: (at 12,4,0 in -11,16; contains blocks -176,0,256 to -161,255,271), Region: (-1,0; contains chunks -32,0 to -1,31, blocks -512,0,0 to -1,255,511)
    Level time: 1099 game time, 1099 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: 41 total; [EntityBat['Bat'/5125, l='MpServer', x=-102.86, y=13.07, z=377.90], EntityBat['Bat'/9231, l='MpServer', x=-113.50, y=13.42, z=362.00], EntityItem['item.item.Mandrake'/9261, l='MpServer', x=-77.38, y=61.13, z=338.44], EntityCow['Cow'/170, l='MpServer', x=-146.63, y=69.00, z=274.81], EntityCow['Cow'/171, l='MpServer', x=-140.94, y=69.00, z=280.88], EntityCow['Cow'/172, l='MpServer', x=-145.38, y=70.00, z=274.44], EntityCow['Cow'/173, l='MpServer', x=-147.81, y=69.00, z=273.47], EntityCow['Cow'/174, l='MpServer', x=-137.47, y=77.00, z=299.53], EntityCow['Cow'/175, l='MpServer', x=-136.47, y=77.00, z=298.47], EntityCow['Cow'/176, l='MpServer', x=-136.31, y=79.00, z=294.50], EntityCow['Cow'/177, l='MpServer', x=-145.50, y=76.00, z=304.63], EntityBat['Bat'/4275, l='MpServer', x=-84.26, y=11.00, z=363.53], EntityWolf['Wolf'/186, l='MpServer', x=-135.50, y=68.00, z=274.50], EntityWolf['Wolf'/187, l='MpServer', x=-148.59, y=68.00, z=278.69], EntityWolf['Wolf'/188, l='MpServer', x=-124.63, y=64.00, z=263.66], EntityWolf['Wolf'/189, l='MpServer', x=-137.50, y=69.00, z=262.25], EntityPig['Pig'/190, l='MpServer', x=-131.13, y=71.00, z=332.50], EntityPig['Pig'/191, l='MpServer', x=-134.03, y=71.00, z=332.47], EntityPig['Pig'/192, l='MpServer', x=-141.59, y=69.00, z=338.81], EntityPig['Pig'/193, l='MpServer', x=-130.50, y=71.00, z=336.50], EntitySheep['Sheep'/211, l='MpServer', x=-43.22, y=63.00, z=405.50], EntitySheep['Sheep'/212, l='MpServer', x=-44.22, y=63.00, z=401.50], EntitySheep['Sheep'/213, l='MpServer', x=-45.81, y=63.00, z=401.50], EntitySheep['Sheep'/214, l='MpServer', x=-44.81, y=63.00, z=405.50], EntityPig['Pig'/223, l='MpServer', x=-15.47, y=63.00, z=266.97], EntityPig['Pig'/224, l='MpServer', x=-12.50, y=64.00, z=268.31], EntityPig['Pig'/225, l='MpServer', x=-9.50, y=65.00, z=272.50], EntityPig['Pig'/226, l='MpServer', x=-15.09, y=63.00, z=268.19], EntityPig['Pig'/233, l='MpServer', x=2.50, y=66.00, z=317.78], EntityPig['Pig'/234, l='MpServer', x=3.63, y=64.00, z=313.06], EntitySheep['Sheep'/235, l='MpServer', x=2.53, y=63.00, z=324.78], EntitySheep['Sheep'/236, l='MpServer', x=1.19, y=63.00, z=323.47], EntityClientPlayerMP['Player720'/250, l='MpServer', x=-72.63, y=67.62, z=324.68], EntityBat['Bat'/4482, l='MpServer', x=-94.56, y=19.77, z=348.81], EntitySquid['Squid'/6791, l='MpServer', x=-65.57, y=55.09, z=356.75], EntitySquid['Squid'/6792, l='MpServer', x=-75.50, y=56.01, z=350.82], EntityBat['Bat'/9879, l='MpServer', x=-63.75, y=30.78, z=255.53], EntityPig['Pig'/10015, l='MpServer', x=-72.53, y=65.00, z=330.38], EntityBat['Bat'/838, l='MpServer', x=-141.55, y=20.71, z=299.44], EntityBat['Bat'/839, l='MpServer', x=-137.27, y=21.41, z=292.42], EntitybewitchedSnowball['BewitchedSnowball'/10136, l='MpServer', x=-72.81, y=67.50, z=324.66]]
    Retry entities: 0 total; []
    Server brand: fml,forge
    Server type: Integrated singleplayer server
Stacktrace:
    at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:415)
    at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2566)
    at net.minecraft.client.Minecraft.run(Minecraft.java:984)
    at net.minecraft.client.main.Main.main(Main.java:164)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
    at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source)
    at GradleStart.main(Unknown Source)

-- System Details --
Details:
    Minecraft Version: 1.7.10
    Operating System: Mac OS X (x86_64) version 10.10.5
    Java Version: 1.8.0_65, Oracle Corporation
    Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
    Memory: 87941008 bytes (83 MB) / 804257792 bytes (767 MB) up to 1908932608 bytes (1820 MB)
    JVM Flags: 0 total;
    AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
    IntCache: cache: 0, tcache: 0, allocated: 12, tallocated: 94
    FML: MCP v9.05 FML v7.10.99.99 Minecraft Forge 10.13.4.1558 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.05} [Minecraft Coder Pack] (minecraft.jar)
    UCHIJAAAA    FML{7.10.99.99} [Forge Mod Loader] (forgeSrc-1.7.10-10.13.4.1558-1.7.10.jar)
    UCHIJAAAA    Forge{10.13.4.1558} [Minecraft Forge] (forgeSrc-1.7.10-10.13.4.1558-1.7.10.jar)
    UCHIJAAAA    TestEnvironmentMod{1.0} [TestEnvironmentMod] (modid-1.0.jar)
    GL info: ' Vendor: 'Intel Inc.' Version: '2.1 INTEL-10.6.33' Renderer: 'Intel Iris Pro OpenGL Engine'
    Launched Version: 1.7.10
    LWJGL: 2.9.1
    OpenGL: Intel Iris Pro OpenGL Engine GL version 2.1 INTEL-10.6.33, Intel Inc.
    GL Caps: Using GL 1.3 multitexturing.
Using framebuffer objects because ARB_framebuffer_object is supported and separate blending is supported.
Anisotropic filtering is supported and maximum anisotropy is 16.
Shaders are available because OpenGL 2.1 is supported.

    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)
    Vec3 Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
    Anisotropic Filtering: Off (1

 

I was trying to make a projectile that is like homing projectile, it will follow closes entity and attack it. If you need to see my code/help just let me know, I will send a link to it.

Edited by KBEHAN on Mon, 03/27/2017 - 21:42
Last seen on 23:21, 14. Apr 2019
Joined Jul 2015
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
After reading the error I
Mon, 03/27/2017 - 18:15

After reading the error I cannot tell what quite the problem is.  Is it because it is not updating on server?  I have the onUpdate code in my projectile code, would it help If I made an event handler for it or it will give me this error.

Last seen on 23:21, 14. Apr 2019
Joined Jul 2015
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
I have had no luck searching
Mon, 03/27/2017 - 21:22

I have had no luck searching in google.