Jump to content

Recommended Posts

Posted

This code here makes it so that cobblestone instead drops stone if they are wearing the specific pickaxe, however I have found out there's a glitch with this, when a creeper explodes (and the explosion hits the cobblestone) it crashes the game, does anyone know how to fix this?

@SubscribeEvent
public void addBlockDrop1(HarvestDropsEvent event) {
	if (event.state.getBlock() == Blocks.cobblestone) {
		ItemStack holding = event.harvester.inventory.getStackInSlot(event.harvester.inventory.currentItem);
		if (holding != null && holding.getItem() instanceof FirePickaxe) {
			event.drops.clear();
			event.drops.add(new ItemStack(Blocks.stone));
		}
	}
}

 

 

Here's my crash log:

 

 

2016-06-08 13:06:26,590 WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream

2016-06-08 13:06:26,591 WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream

[13:06:26] [main/INFO] [GradleStart]: Extra: []

[13:06:26] [main/INFO] [GradleStart]: Running with arguments: [--userProperties, {}, --assetsDir, C:/Users/Reece/.gradle/caches/minecraft/assets, --assetIndex, 1.8, --accessToken{REDACTED}, --version, 1.8.9, --tweakClass, net.minecraftforge.fml.common.launcher.FMLTweaker, --tweakClass, net.minecraftforge.gradle.tweakers.CoremodTweaker]

[13:06:26] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker

[13:06:26] [main/INFO] [LaunchWrapper]: Using primary tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker

[13:06:26] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.CoremodTweaker

[13:06:26] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLTweaker

[13:06:26] [main/INFO] [FML]: Forge Mod Loader version 11.15.1.1722 for Minecraft 1.8.9 loading

[13:06:26] [main/INFO] [FML]: Java is Java HotSpot Client VM, version 1.8.0_91, running on Windows 10:x86:10.0, installed at C:\Program Files (x86)\Java\jre1.8.0_91

[13:06:26] [main/INFO] [FML]: Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation

[13:06:26] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.CoremodTweaker

[13:06:26] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.fml.relauncher.FMLCorePlugin

[13:06:26] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.classloading.FMLForgePlugin

[13:06:26] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker

[13:06:26] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLDeobfTweaker

[13:06:26] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.AccessTransformerTweaker

[13:06:26] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker

[13:06:26] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker

[13:06:26] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper

[13:06:27] [main/ERROR] [FML]: The binary patch set is missing. Either you are in a development environment, or things are not going to work!

[13:06:28] [main/ERROR] [FML]: FML appears to be missing any signature data. This is not a good thing

[13:06:28] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper

[13:06:28] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLDeobfTweaker

[13:06:28] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.AccessTransformerTweaker

[13:06:28] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.TerminalTweaker

[13:06:28] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.TerminalTweaker

[13:06:28] [main/INFO] [LaunchWrapper]: Launching wrapped minecraft {net.minecraft.client.main.Main}

2016-06-08 13:06:29,394 WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream

2016-06-08 13:06:29,423 WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream

2016-06-08 13:06:29,425 WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream

[13:06:29] [Client thread/INFO]: Setting user: Player185

[13:06:36] [Client thread/INFO]: LWJGL Version: 2.9.4

[13:06:36] [Client thread/WARN] [FML]: =============================================================

[13:06:36] [Client thread/WARN] [FML]: MOD HAS DIRECT REFERENCE System.exit() THIS IS NOT ALLOWED REROUTING TO FML!

[13:06:36] [Client thread/WARN] [FML]: Offendor: com/sun/jna/Native.main([Ljava/lang/String;)V

[13:06:36] [Client thread/WARN] [FML]: Use FMLCommonHandler.exitJava instead

[13:06:36] [Client thread/WARN] [FML]: =============================================================

[13:06:37] [Client thread/INFO] [sTDOUT]: [net.minecraftforge.fml.client.SplashProgress:start:246]: ---- Minecraft Crash Report ----

// I let you down. Sorry :(

 

Time: 08/06/16 13:06

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.8.9

Operating System: Windows 10 (x86) version 10.0

Java Version: 1.8.0_91, Oracle Corporation

Java VM Version: Java HotSpot Client VM (mixed mode), Oracle Corporation

Memory: 802218768 bytes (765 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 353.82' Renderer: 'GeForce GT 640/PCIe/SSE2'

[13:06:37] [Client thread/INFO] [FML]: MinecraftForge v11.15.1.1722 Initialized

[13:06:37] [Client thread/INFO] [FML]: Replaced 204 ore recipies

[13:06:37] [Client thread/INFO] [FML]: Found 0 mods from the command line. Injecting into mod discoverer

[13:06:37] [Client thread/INFO] [FML]: Searching C:\Users\Reece\Desktop\Minecraft 1.8.9 Mod\1.8.9 Production\run\mods for mods

[13:06:38] [Client thread/INFO] [FML]: Forge Mod Loader has identified 4 mods to load

[13:06:38] [Client thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, Forge, mod] at CLIENT

[13:06:38] [Client thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, Forge, mod] at SERVER

[13:06:39] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:Monstrous Apple's Mod

[13:06:39] [Client thread/INFO] [FML]: Processing ObjectHolder annotations

[13:06:39] [Client thread/INFO] [FML]: Found 384 ObjectHolder annotations

[13:06:39] [Client thread/INFO] [FML]: Identifying ItemStackHolder annotations

[13:06:39] [Client thread/INFO] [FML]: Found 0 ItemStackHolder annotations

[13:06:39] [Client thread/INFO] [FML]: Configured a dormant chunk cache size of 0

[13:06:39] [Forge Version Check/INFO] [ForgeVersionCheck]: [Forge] Starting version check at http://files.minecraftforge.net/maven/net/minecraftforge/forge/promotions_slim.json

[13:06:39] [Client thread/INFO] [FML]: Applying holder lookups

[13:06:39] [Client thread/INFO] [FML]: Holder lookups applied

[13:06:39] [Client thread/INFO] [FML]: Injecting itemstacks

[13:06:39] [Client thread/INFO] [FML]: Itemstack injection complete

[13:06:39] [Forge Version Check/INFO] [ForgeVersionCheck]: [Forge] Found status: UP_TO_DATE Target: null

[13:06:39] [Client thread/INFO] [sTDOUT]: [tv.twitch.StandardCoreAPI:<init>:16]: If on Windows, make sure to provide all of the necessary dll's as specified in the twitchsdk README. Also, make sure to set the PATH environment variable to point to the directory containing the dll's.

[13:06:39] [Client thread/ERROR]: Couldn't initialize twitch stream

[13:06:39] [sound Library Loader/INFO]: Starting up SoundSystem...

[13:06:40] [Thread-9/INFO]: Initializing LWJGL OpenAL

[13:06:40] [Thread-9/INFO]: (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)

[13:06:40] [Thread-9/INFO]: OpenAL initialized.

[13:06:40] [sound Library Loader/INFO]: Sound engine started

[13:06:46] [Client thread/INFO] [FML]: Max texture size: 16384

[13:06:46] [Client thread/INFO]: Created: 16x16 textures-atlas

[13:06:47] [Client thread/ERROR] [FML]: Model definition for location mod:TestBlockTnt#explode=false not found

[13:06:47] [Client thread/ERROR] [FML]: Model definition for location mod:CherryPlant#inventory not found

[13:06:47] [Client thread/ERROR] [FML]: Model definition for location mod:TestBlockTnt#explode=true not found

[13:06:47] [Client thread/ERROR] [FML]: Model definition for location mod:BananaPlant#inventory not found

[13:06:48] [Client thread/INFO] [FML]: Injecting itemstacks

[13:06:48] [Client thread/INFO] [FML]: Itemstack injection complete

[13:06:48] [Client thread/INFO] [FML]: Forge Mod Loader has successfully loaded 4 mods

[13:06:48] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:Monstrous Apple's Mod

[13:06:48] [Client thread/INFO]: SoundSystem shutting down...

[13:06:48] [Client thread/WARN]: Author: Paul Lamb, www.paulscode.com

[13:06:48] [sound Library Loader/INFO]: Starting up SoundSystem...

[13:06:48] [Thread-11/INFO]: Initializing LWJGL OpenAL

[13:06:48] [Thread-11/INFO]: (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)

[13:06:48] [Thread-11/INFO]: OpenAL initialized.

[13:06:49] [sound Library Loader/INFO]: Sound engine started

[13:06:54] [Client thread/INFO] [FML]: Max texture size: 16384

[13:06:55] [Client thread/INFO]: Created: 512x512 textures-atlas

[13:06:55] [Client thread/ERROR] [FML]: Exception loading model for variant mod:TestBlockTnt_side#inventory

java.lang.Exception: Could not load model definition for variant mod:TestBlockTnt_side#inventory

at net.minecraftforge.client.model.ModelLoader.getModelBlockDefinition(ModelLoader.java:219) ~[ModelLoader.class:?]

at net.minecraftforge.client.model.ModelLoader.loadItems(ModelLoader.java:256) ~[ModelLoader.class:?]

at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:120) ~[ModelLoader.class:?]

at net.minecraft.client.resources.model.ModelManager.onResourceManagerReload(ModelManager.java:28) [ModelManager.class:?]

at net.minecraft.client.resources.SimpleReloadableResourceManager.notifyReloadListeners(SimpleReloadableResourceManager.java:130) [simpleReloadableResourceManager.class:?]

at net.minecraft.client.resources.SimpleReloadableResourceManager.reloadResources(SimpleReloadableResourceManager.java:111) [simpleReloadableResourceManager.class:?]

at net.minecraft.client.Minecraft.refreshResources(Minecraft.java:772) [Minecraft.class:?]

at net.minecraftforge.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:326) [FMLClientHandler.class:?]

at net.minecraft.client.Minecraft.startGame(Minecraft.java:532) [Minecraft.class:?]

at net.minecraft.client.Minecraft.run(Minecraft.java:360) [Minecraft.class:?]

at net.minecraft.client.main.Main.main(Main.java:116) [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.lang.RuntimeException: Encountered an exception when loading model definition of model mod:blockstates/TestBlockTnt_side.json

at net.minecraft.client.resources.model.ModelBakery.getModelBlockDefinition(ModelBakery.java:165) ~[ModelBakery.class:?]

at net.minecraftforge.client.model.ModelLoader.getModelBlockDefinition(ModelLoader.java:215) ~[ModelLoader.class:?]

... 22 more

Caused by: java.io.FileNotFoundException: mod:blockstates/TestBlockTnt_side.json

at net.minecraft.client.resources.FallbackResourceManager.getAllResources(FallbackResourceManager.java:93) ~[FallbackResourceManager.class:?]

at net.minecraft.client.resources.SimpleReloadableResourceManager.getAllResources(SimpleReloadableResourceManager.java:78) ~[simpleReloadableResourceManager.class:?]

at net.minecraft.client.resources.model.ModelBakery.getModelBlockDefinition(ModelBakery.java:143) ~[ModelBakery.class:?]

at net.minecraftforge.client.model.ModelLoader.getModelBlockDefinition(ModelLoader.java:215) ~[ModelLoader.class:?]

... 22 more

[13:06:55] [Client thread/ERROR] [FML]: Exception loading model for variant mod:TestBlockTnt_bottom#inventory

java.lang.Exception: Could not load model definition for variant mod:TestBlockTnt_bottom#inventory

at net.minecraftforge.client.model.ModelLoader.getModelBlockDefinition(ModelLoader.java:219) ~[ModelLoader.class:?]

at net.minecraftforge.client.model.ModelLoader.loadItems(ModelLoader.java:256) ~[ModelLoader.class:?]

at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:120) ~[ModelLoader.class:?]

at net.minecraft.client.resources.model.ModelManager.onResourceManagerReload(ModelManager.java:28) [ModelManager.class:?]

at net.minecraft.client.resources.SimpleReloadableResourceManager.notifyReloadListeners(SimpleReloadableResourceManager.java:130) [simpleReloadableResourceManager.class:?]

at net.minecraft.client.resources.SimpleReloadableResourceManager.reloadResources(SimpleReloadableResourceManager.java:111) [simpleReloadableResourceManager.class:?]

at net.minecraft.client.Minecraft.refreshResources(Minecraft.java:772) [Minecraft.class:?]

at net.minecraftforge.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:326) [FMLClientHandler.class:?]

at net.minecraft.client.Minecraft.startGame(Minecraft.java:532) [Minecraft.class:?]

at net.minecraft.client.Minecraft.run(Minecraft.java:360) [Minecraft.class:?]

at net.minecraft.client.main.Main.main(Main.java:116) [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.lang.RuntimeException: Encountered an exception when loading model definition of model mod:blockstates/TestBlockTnt_bottom.json

at net.minecraft.client.resources.model.ModelBakery.getModelBlockDefinition(ModelBakery.java:165) ~[ModelBakery.class:?]

at net.minecraftforge.client.model.ModelLoader.getModelBlockDefinition(ModelLoader.java:215) ~[ModelLoader.class:?]

... 22 more

Caused by: java.io.FileNotFoundException: mod:blockstates/TestBlockTnt_bottom.json

at net.minecraft.client.resources.FallbackResourceManager.getAllResources(FallbackResourceManager.java:93) ~[FallbackResourceManager.class:?]

at net.minecraft.client.resources.SimpleReloadableResourceManager.getAllResources(SimpleReloadableResourceManager.java:78) ~[simpleReloadableResourceManager.class:?]

at net.minecraft.client.resources.model.ModelBakery.getModelBlockDefinition(ModelBakery.java:143) ~[ModelBakery.class:?]

at net.minecraftforge.client.model.ModelLoader.getModelBlockDefinition(ModelLoader.java:215) ~[ModelLoader.class:?]

... 22 more

[13:06:55] [Client thread/ERROR] [FML]: Exception loading model for variant mod:TestBlockTnt_top#inventory

java.lang.Exception: Could not load model definition for variant mod:TestBlockTnt_top#inventory

at net.minecraftforge.client.model.ModelLoader.getModelBlockDefinition(ModelLoader.java:219) ~[ModelLoader.class:?]

at net.minecraftforge.client.model.ModelLoader.loadItems(ModelLoader.java:256) ~[ModelLoader.class:?]

at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:120) ~[ModelLoader.class:?]

at net.minecraft.client.resources.model.ModelManager.onResourceManagerReload(ModelManager.java:28) [ModelManager.class:?]

at net.minecraft.client.resources.SimpleReloadableResourceManager.notifyReloadListeners(SimpleReloadableResourceManager.java:130) [simpleReloadableResourceManager.class:?]

at net.minecraft.client.resources.SimpleReloadableResourceManager.reloadResources(SimpleReloadableResourceManager.java:111) [simpleReloadableResourceManager.class:?]

at net.minecraft.client.Minecraft.refreshResources(Minecraft.java:772) [Minecraft.class:?]

at net.minecraftforge.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:326) [FMLClientHandler.class:?]

at net.minecraft.client.Minecraft.startGame(Minecraft.java:532) [Minecraft.class:?]

at net.minecraft.client.Minecraft.run(Minecraft.java:360) [Minecraft.class:?]

at net.minecraft.client.main.Main.main(Main.java:116) [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.lang.RuntimeException: Encountered an exception when loading model definition of model mod:blockstates/TestBlockTnt_top.json

at net.minecraft.client.resources.model.ModelBakery.getModelBlockDefinition(ModelBakery.java:165) ~[ModelBakery.class:?]

at net.minecraftforge.client.model.ModelLoader.getModelBlockDefinition(ModelLoader.java:215) ~[ModelLoader.class:?]

... 22 more

Caused by: java.io.FileNotFoundException: mod:blockstates/TestBlockTnt_top.json

at net.minecraft.client.resources.FallbackResourceManager.getAllResources(FallbackResourceManager.java:93) ~[FallbackResourceManager.class:?]

at net.minecraft.client.resources.SimpleReloadableResourceManager.getAllResources(SimpleReloadableResourceManager.java:78) ~[simpleReloadableResourceManager.class:?]

at net.minecraft.client.resources.model.ModelBakery.getModelBlockDefinition(ModelBakery.java:143) ~[ModelBakery.class:?]

at net.minecraftforge.client.model.ModelLoader.getModelBlockDefinition(ModelLoader.java:215) ~[ModelLoader.class:?]

... 22 more

[13:06:55] [Client thread/ERROR] [FML]: Model definition for location mod:TestBlockTnt#explode=false not found

[13:06:55] [Client thread/ERROR] [FML]: Supressed additional 10 model loading errors for domain ma

[13:06:55] [Client thread/ERROR] [TEXTURE ERRORS]: +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=

[13:06:55] [Client thread/ERROR] [TEXTURE ERRORS]: The following texture errors were found.

[13:06:55] [Client thread/ERROR] [TEXTURE ERRORS]: ==================================================

[13:06:55] [Client thread/ERROR] [TEXTURE ERRORS]:  DOMAIN ma

[13:06:55] [Client thread/ERROR] [TEXTURE ERRORS]: --------------------------------------------------

[13:06:55] [Client thread/ERROR] [TEXTURE ERRORS]:  domain ma is missing 1 texture

[13:06:55] [Client thread/ERROR] [TEXTURE ERRORS]:    domain ma has 1 location:

[13:06:55] [Client thread/ERROR] [TEXTURE ERRORS]:      mod ma resources at C:\Users\Reece\Desktop\Minecraft 1.8.9 Mod\1.8.9 Production\bin

[13:06:55] [Client thread/ERROR] [TEXTURE ERRORS]: -------------------------

[13:06:55] [Client thread/ERROR] [TEXTURE ERRORS]:    The missing resources for domain ma are:

[13:06:55] [Client thread/ERROR] [TEXTURE ERRORS]:      textures/blocks/KarmaOre.png

[13:06:55] [Client thread/ERROR] [TEXTURE ERRORS]: -------------------------

[13:06:55] [Client thread/ERROR] [TEXTURE ERRORS]:    No other errors exist for domain ma

[13:06:55] [Client thread/ERROR] [TEXTURE ERRORS]: ==================================================

[13:06:55] [Client thread/ERROR] [TEXTURE ERRORS]: +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=

[13:06:56] [Realms Notification Availability checker #1/INFO]: Could not authorize you against Realms server: Invalid session id

[13:07:05] [Realms Notification Availability checker #1/INFO]: Could not authorize you against Realms server: Invalid session id

[13:07:08] [server thread/INFO]: Starting integrated minecraft server version 1.8.9

[13:07:08] [server thread/INFO]: Generating keypair

[13:07:08] [server thread/INFO] [FML]: Injecting existing block and item data into this server instance

[13:07:08] [server thread/INFO] [FML]: Applying holder lookups

[13:07:08] [server thread/INFO] [FML]: Holder lookups applied

[13:07:09] [server thread/INFO] [FML]: Loading dimension 0 (TNT!) (net.minecraft.server.integrated.IntegratedServer@1a3e373)

[13:07:09] [server thread/INFO] [FML]: Loading dimension 1 (TNT!) (net.minecraft.server.integrated.IntegratedServer@1a3e373)

[13:07:09] [server thread/INFO] [FML]: Loading dimension -1 (TNT!) (net.minecraft.server.integrated.IntegratedServer@1a3e373)

[13:07:09] [server thread/INFO]: Preparing start region for level 0

[13:07:10] [server thread/INFO]: Preparing spawn area: 86%

[13:07:10] [Realms Notification Availability checker #1/INFO]: Could not authorize you against Realms server: Invalid session id

[13:07:10] [server thread/INFO]: Changing view distance to 5, from 10

[13:07:11] [Netty Local Client IO #0/INFO] [FML]: Server protocol version 2

[13:07:11] [Netty Server IO #1/INFO] [FML]: Client protocol version 2

[13:07:11] [Netty Server IO #1/INFO] [FML]: Client attempting to join with 4 mods : [email protected],ma@Version 0.1 (1.8.9),[email protected],[email protected]

[13:07:11] [Netty Local Client IO #0/INFO] [FML]: [Netty Local Client IO #0] Client side modded connection established

[13:07:11] [server thread/INFO] [FML]: [server thread] Server side modded connection established

[13:07:11] [server thread/INFO]: Player185[local:E:576a8119] logged in with entity id 275 at (-41.69999998807907, 65.0, 142.10161586972922)

[13:07:11] [server thread/INFO]: Player185 joined the game

[13:07:11] [server thread/INFO]: Saving and pausing game...

[13:07:11] [server thread/INFO]: Saving chunks for level 'TNT!'/Overworld

[13:07:12] [server thread/INFO]: Saving chunks for level 'TNT!'/Nether

[13:07:12] [server thread/INFO]: Saving chunks for level 'TNT!'/The End

[13:07:14] [Chunk Batcher 0/WARN]: Biome ID is out of bounds: 151720, defaulting to 0 (Ocean)

[13:07:14] [Chunk Batcher 0/WARN]: Biome ID is out of bounds: 152122, defaulting to 0 (Ocean)

[13:07:14] [Chunk Batcher 0/WARN]: Biome ID is out of bounds: 151720, defaulting to 0 (Ocean)

[13:07:14] [Chunk Batcher 0/WARN]: Biome ID is out of bounds: 151720, defaulting to 0 (Ocean)

[13:07:14] [Chunk Batcher 0/WARN]: Biome ID is out of bounds: 165762, defaulting to 0 (Ocean)

[13:07:14] [Chunk Batcher 0/WARN]: Biome ID is out of bounds: 151720, defaulting to 0 (Ocean)

[13:07:14] [Chunk Batcher 0/WARN]: Biome ID is out of bounds: 151720, defaulting to 0 (Ocean)

[13:07:14] [Chunk Batcher 0/WARN]: Biome ID is out of bounds: 151720, defaulting to 0 (Ocean)

[13:07:14] [Chunk Batcher 0/WARN]: Biome ID is out of bounds: 151720, defaulting to 0 (Ocean)

[13:07:14] [Chunk Batcher 0/WARN]: Biome ID is out of bounds: 151720, defaulting to 0 (Ocean)

[13:07:14] [Chunk Batcher 0/WARN]: Biome ID is out of bounds: 165762, defaulting to 0 (Ocean)

[13:07:14] [Chunk Batcher 0/WARN]: Biome ID is out of bounds: 165762, defaulting to 0 (Ocean)

[13:07:18] [pool-2-thread-1/WARN]: Couldn't look up profile properties for com.mojang.authlib.GameProfile@10aa23d[id=8c6477df-589c-387e-8235-e07170c95726,name=Player185,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.func_181037_M(Minecraft.java:2915) [Minecraft.class:?]

at net.minecraft.client.resources.SkinManager$3.run(SkinManager.java:130) [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]

[13:07:42] [server thread/ERROR] [FML]: Exception caught during firing event net.minecraftforge.event.world.BlockEvent$HarvestDropsEvent@1ca758a:

java.lang.NullPointerException

at com.mytestmod.mod.handler.MADropHandler.addBlockDrop1(MADropHandler.java:121) ~[MADropHandler.class:?]

at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_18_MADropHandler_addBlockDrop1_HarvestDropsEvent.invoke(.dynamic) ~[?:?]

at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:55) ~[ASMEventHandler.class:?]

at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:140) [EventBus.class:?]

at net.minecraftforge.event.ForgeEventFactory.fireBlockHarvesting(ForgeEventFactory.java:189) [ForgeEventFactory.class:?]

at net.minecraft.block.Block.dropBlockAsItemWithChance(Block.java:626) [block.class:?]

at net.minecraft.world.Explosion.doExplosionB(Explosion.java:224) [Explosion.class:?]

at net.minecraft.world.WorldServer.newExplosion(WorldServer.java:1052) [WorldServer.class:?]

at net.minecraft.world.World.createExplosion(World.java:2346) [World.class:?]

at net.minecraft.entity.monster.EntityCreeper.explode(EntityCreeper.java:287) [EntityCreeper.class:?]

at net.minecraft.entity.monster.EntityCreeper.onUpdate(EntityCreeper.java:159) [EntityCreeper.class:?]

at net.minecraft.world.World.updateEntityWithOptionalForce(World.java:2009) [World.class:?]

at net.minecraft.world.WorldServer.updateEntityWithOptionalForce(WorldServer.java:724) [WorldServer.class:?]

at net.minecraft.world.World.updateEntity(World.java:1974) [World.class:?]

at net.minecraft.world.World.updateEntities(World.java:1803) [World.class:?]

at net.minecraft.world.WorldServer.updateEntities(WorldServer.java:559) [WorldServer.class:?]

at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:777) [MinecraftServer.class:?]

at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:681) [MinecraftServer.class:?]

at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:159) [integratedServer.class:?]

at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:548) [MinecraftServer.class:?]

at java.lang.Thread.run(Unknown Source) [?:1.8.0_91]

[13:07:42] [server thread/ERROR] [FML]: Index: 2 Listeners:

[13:07:42] [server thread/ERROR] [FML]: 0: NORMAL

[13:07:42] [server thread/ERROR] [FML]: 1: ASM: com.mytestmod.mod.handler.MADropHandler@19f5c35 addBlockDrop(Lnet/minecraftforge/event/world/BlockEvent$HarvestDropsEvent;)V

[13:07:42] [server thread/ERROR] [FML]: 2: ASM: com.mytestmod.mod.handler.MADropHandler@19f5c35 addBlockDrop1(Lnet/minecraftforge/event/world/BlockEvent$HarvestDropsEvent;)V

[13:07:42] [server thread/ERROR]: Encountered an unexpected exception

net.minecraft.util.ReportedException: Ticking entity

at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:783) ~[MinecraftServer.class:?]

at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:681) ~[MinecraftServer.class:?]

at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:159) ~[integratedServer.class:?]

at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:548) [MinecraftServer.class:?]

at java.lang.Thread.run(Unknown Source) [?:1.8.0_91]

Caused by: java.lang.NullPointerException

at com.mytestmod.mod.handler.MADropHandler.addBlockDrop1(MADropHandler.java:121) ~[MADropHandler.class:?]

at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_18_MADropHandler_addBlockDrop1_HarvestDropsEvent.invoke(.dynamic) ~[?:?]

at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:55) ~[ASMEventHandler.class:?]

at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:140) ~[EventBus.class:?]

at net.minecraftforge.event.ForgeEventFactory.fireBlockHarvesting(ForgeEventFactory.java:189) ~[ForgeEventFactory.class:?]

at net.minecraft.block.Block.dropBlockAsItemWithChance(Block.java:626) ~[block.class:?]

at net.minecraft.world.Explosion.doExplosionB(Explosion.java:224) ~[Explosion.class:?]

at net.minecraft.world.WorldServer.newExplosion(WorldServer.java:1052) ~[WorldServer.class:?]

at net.minecraft.world.World.createExplosion(World.java:2346) ~[World.class:?]

at net.minecraft.entity.monster.EntityCreeper.explode(EntityCreeper.java:287) ~[EntityCreeper.class:?]

at net.minecraft.entity.monster.EntityCreeper.onUpdate(EntityCreeper.java:159) ~[EntityCreeper.class:?]

at net.minecraft.world.World.updateEntityWithOptionalForce(World.java:2009) ~[World.class:?]

at net.minecraft.world.WorldServer.updateEntityWithOptionalForce(WorldServer.java:724) ~[WorldServer.class:?]

at net.minecraft.world.World.updateEntity(World.java:1974) ~[World.class:?]

at net.minecraft.world.World.updateEntities(World.java:1803) ~[World.class:?]

at net.minecraft.world.WorldServer.updateEntities(WorldServer.java:559) ~[WorldServer.class:?]

at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:777) ~[MinecraftServer.class:?]

... 4 more

[13:07:42] [server thread/ERROR]: This crash report has been saved to: C:\Users\Reece\Desktop\Minecraft 1.8.9 Mod\1.8.9 Production\run\.\crash-reports\crash-2016-06-08_13.07.42-server.txt

[13:07:42] [server thread/INFO]: Stopping server

[13:07:42] [server thread/INFO]: Saving players

[13:07:42] [Client thread/INFO] [sTDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:612]: ---- Minecraft Crash Report ----

// Who set us up the TNT?

 

Time: 08/06/16 13:07

Description: Ticking entity

 

java.lang.NullPointerException: Ticking entity

at com.mytestmod.mod.handler.MADropHandler.addBlockDrop1(MADropHandler.java:121)

at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_18_MADropHandler_addBlockDrop1_HarvestDropsEvent.invoke(.dynamic)

at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:55)

at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:140)

at net.minecraftforge.event.ForgeEventFactory.fireBlockHarvesting(ForgeEventFactory.java:189)

at net.minecraft.block.Block.dropBlockAsItemWithChance(Block.java:626)

at net.minecraft.world.Explosion.doExplosionB(Explosion.java:224)

at net.minecraft.world.WorldServer.newExplosion(WorldServer.java:1052)

at net.minecraft.world.World.createExplosion(World.java:2346)

at net.minecraft.entity.monster.EntityCreeper.explode(EntityCreeper.java:287)

at net.minecraft.entity.monster.EntityCreeper.onUpdate(EntityCreeper.java:159)

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

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

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

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

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

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

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

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

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

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.mytestmod.mod.handler.MADropHandler.addBlockDrop1(MADropHandler.java:121)

at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_18_MADropHandler_addBlockDrop1_HarvestDropsEvent.invoke(.dynamic)

at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:55)

at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:140)

at net.minecraftforge.event.ForgeEventFactory.fireBlockHarvesting(ForgeEventFactory.java:189)

at net.minecraft.block.Block.dropBlockAsItemWithChance(Block.java:626)

at net.minecraft.world.Explosion.doExplosionB(Explosion.java:224)

at net.minecraft.world.WorldServer.newExplosion(WorldServer.java:1052)

at net.minecraft.world.World.createExplosion(World.java:2346)

at net.minecraft.entity.monster.EntityCreeper.explode(EntityCreeper.java:287)

at net.minecraft.entity.monster.EntityCreeper.onUpdate(EntityCreeper.java:159)

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

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

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

 

-- Entity being ticked --

Details:

Entity Type: Creeper (net.minecraft.entity.monster.EntityCreeper)

Entity ID: 3142

Entity Name: Creeper

Entity's Exact location: -23.87, 65.00, 139.90

Entity's Block location: -24.00,65.00,139.00 - World: (-24,65,139), Chunk: (at 8,4,11 in -2,8; contains blocks -32,0,128 to -17,255,143), 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:1803)

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

 

-- Affected level --

Details:

Level name: TNT!

All players: 1 total; [EntityPlayerMP['Player185'/275, l='TNT!', x=-24.41, y=65.00, z=138.73]]

Chunk stats: ServerChunkCache: 440 Drop: 0

Level seed: 7561070734009135251

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

Level generator options:

Level spawn location: -93.00,64.00,269.00 - World: (-93,64,269), Chunk: (at 3,4,13 in -6,16; contains blocks -96,0,256 to -81,255,271), Region: (-1,0; contains chunks -32,0 to -1,31, blocks -512,0,0 to -1,255,511)

Level time: 50353 game time, 50353 day time

Level dimension: 0

Level storage version: 0x04ABD - Anvil

Level weather: Rain time: 111978 (now: false), thunder time: 89576 (now: false)

Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: true

Stacktrace:

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

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

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

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

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

 

-- System Details --

Details:

Minecraft Version: 1.8.9

Operating System: Windows 10 (x86) version 10.0

Java Version: 1.8.0_91, Oracle Corporation

Java VM Version: Java HotSpot Client VM (mixed mode), Oracle Corporation

Memory: 772325400 bytes (736 MB) / 1037959168 bytes (989 MB) up to 1037959168 bytes (989 MB)

JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M

IntCache: cache: 0, tcache: 18, allocated: 13, tallocated: 95

FML: MCP 9.19 Powered by Forge 11.15.1.1722 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.8.9-11.15.1.1722.jar)

UCHIJAAAA Forge{11.15.1.1722} [Minecraft Forge] (forgeSrc-1.8.9-11.15.1.1722.jar)

UCHIJAAAA ma{Version 0.1 (1.8.9)} [Monstrous Apple's Mod] (bin)

Loaded coremods (and transformers):

GL info: ~~ERROR~~ RuntimeException: No OpenGL context found in the current thread.

Profiler Position: N/A (disabled)

Player Count: 1 / 8; [EntityPlayerMP['Player185'/275, l='TNT!', x=-24.41, y=65.00, z=138.73]]

Type: Integrated Server (map_client.txt)

Is Modded: Definitely; Client brand changed to 'fml,forge'

[13:07:42] [Client thread/INFO] [sTDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:612]: #@!@# Game crashed! Crash report saved to: #@!@# .\crash-reports\crash-2016-06-08_13.07.42-server.txt

[13:07:42] [Client thread/INFO] [FML]: Waiting for the server to terminate/save.

[13:07:42] [server thread/INFO]: Saving worlds

[13:07:42] [server thread/INFO]: Saving chunks for level 'TNT!'/Overworld

[13:07:42] [server thread/INFO]: Saving chunks for level 'TNT!'/Nether

[13:07:42] [server thread/INFO]: Saving chunks for level 'TNT!'/The End

[13:07:43] [server thread/INFO] [FML]: Unloading dimension 0

[13:07:43] [server thread/INFO] [FML]: Unloading dimension -1

[13:07:43] [server thread/INFO] [FML]: Unloading dimension 1

[13:07:43] [server thread/INFO] [FML]: Applying holder lookups

[13:07:43] [server thread/INFO] [FML]: Holder lookups applied

[13:07:43] [server thread/INFO] [FML]: The state engine was in incorrect state SERVER_STOPPING and forced into state SERVER_STOPPED. Errors may have been discarded.

[13:07:43] [Client thread/INFO] [FML]: Server terminated.

AL lib: (EE) alc_cleanup: 1 device not closed

Java HotSpot Client VM warning: Using incremental CMS is deprecated and will likely be removed in a future release

 

Posted

Before doing anything else, check to make sure the harvester is a player.

 

public void addBlockDrop1(HarvestDropsEvent event) {

if (!(event.harvester instanceof EntityPlayer)) return;

// Your Code

}

Posted

HarvestDropsEvent#harvester

is a field of type

EntityPlayer

, so it will always be a player.

 

It may be

null

, though; the doc comments of the event explain this.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Posted

Before doing anything else, check to make sure the harvester is a player.

 

public void addBlockDrop1(HarvestDropsEvent event) {

if (!(event.harvester instanceof EntityPlayer)) return;

// Your Code

}

 

Oh, I see that makes sense just I thought that it being an instanceof my pickaxe it would only work from using that and nothing else, but oh well, thank you. :)

Posted

HarvestDropsEvent#harvester

is a field of type

EntityPlayer

, so it will always be a player.

 

It may be

null

, though; the doc comments of the event explain this.

 

Ah, I wasn't aware as I didn't have the time to check, I just kind of guessed that this was the problem based on the error. However doing the instanceof check also makes sure it isn't null, so that should fix it either way.

Posted

Oh, I see that makes sense just I thought that it being an instanceof my pickaxe it would only work from using that and nothing else, but oh well, thank you. :)

 

HarvestDropsEvent fires any time a block that drops an item does that.  Water breaking tall grass causes it to fire.

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.

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

    • I know that this may be a basic question, but I am very new to modding. I am trying to have it so that I can create modified Vanilla loot tables that use a custom enchantment as a condition (i.e. enchantment present = item). However, I am having trouble trying to implement this; the LootItemRandomChanceWithEnchantedBonusCondition constructor needs a Holder<Enchantment> and I am unable to use the getOrThrow() method on the custom enchantment declared in my mod's enchantments class. Here is what I have so far in the GLM:   protected void start(HolderLookup.Provider registries) { HolderLookup.RegistryLookup<Enchantment> registrylookup = registries.lookupOrThrow(Registries.ENCHANTMENT); LootItemRandomChanceWithEnchantedBonusCondition lootItemRandomChanceWithEnchantedBonusCondition = new LootItemRandomChanceWithEnchantedBonusCondition(0.0f, LevelBasedValue.perLevel(0.07f), registrylookup.getOrThrow(*enchantment here*)); this.add("nebu_from_deepslate", new AddItemModifier(new LootItemCondition[]{ LootItemBlockStatePropertyCondition.hasBlockStateProperties(Blocks.DEEPSLATE).build(), LootItemRandomChanceCondition.randomChance(0.25f).build(), lootItemRandomChanceWithEnchantedBonusCondition }, OrichalcumItems.NEBU.get())); }   Inserting Enchantments.[vanilla enchantment here] actually works but trying to declare an enchantment from my custom enchantments class as [mod enchantment class].[custom enchantment] does not work even though they are both a ResourceKey and are registered in Registries.ENCHANTMENT. Basically, how would I go about making it so that a custom enchantment declared as a ResourceKey<Enchantment> of value ResourceKey.create(Registries.ENCHANTMENT, ResourceLocation.fromNamespaceAndPath([modid], [name])), declared in a seperate enchantments class, can be used in the LootItemRandomChanceWithEnchantedBonusCondition constructor as a Holder? I can't use getOrThrow() because there is no level or block entity/entity in the start() method and it is running as datagen. It's driving me nuts.
    • Hi here is an update. I was able to fix the code so my mod does not crash Minecraft. Please understand that I am new to modding but I honestly am having a hard time understanding how anyone can get this to work without having extensive programming and debugging experience as well as searching across the Internet, multiple gen AI bots (claude, grok, openai), and examining source code hidden in the gradle directory and in various github repositories. I guess I am wrong because clearly there are thousands of mods so maybe I am just a newbie. Ok, rant over, here is a step by step summary so others can save the 3 days it took me to figure this out.   1. First, I am using forge 54.1.0 and Minecraft 1.21.4 2. I am creating a mod to add a shotgun to Minecraft 3. After creating the mod and compiling it, I installed the .jar file to the proper directory in Minecraft and used 1.21.4-forge-54.1.0 4. The mod immediately crashed with the error: Caused by: java.lang.NullPointerException: Item id not set 5. Using the stack trace, I determined that the Exception was being thrown from the net.minecraft.world.item.Item.Properties class 6. It seems that there are no javadocs for this class, so I used IntelliJ which was able to provide a decompiled version of the class, which I then examined to see the source of the error. Side question: Are there javadocs? 7. This method, specifically, was the culprit: protected String effectiveDescriptionId() {      return this.descriptionId.get(Objects.requireNonNull(this.id, "Item id not set"));  } 8. Now my quest was to determine how to set this.id. Looking at the same source file, I determined there was another method:  public Item.Properties setId(ResourceKey<Item> pId) {             this.id = pId;             return this;   } 9. So now, I need to figure out how to call setId(). This required working backwards a bit. Starting from the constructor, I stubbed out the variable p which is of type Item.Properties public static final RegistryObject<Item> SHOTGUN = ITEMS.register("shotgun", () -> new ShotgunItem(p)); Rather than putting this all on one line, I split it up for readability like this: private static final Item.Properties p = new Item.Properties().useItemDescriptionPrefix().setId(rk); Here is was the missing function, setId(), which takes a type of ResourceKey<Item>. My next problem is that due to the apparent lack of documentation (I tried searching the docs on this site) I could not determine the full import path to ResourceKey. I did some random searching on the Internet and stumbled across a Github repository which gave two clues: import net.minecraft.resources.ResourceKey; import net.minecraft.resources.ResourceLocation; Then I created the rk variable like this: private static ResourceKey<Item> rk = ResourceKey.create(Registries.ITEM, ResourceLocation.parse("modid:shotgunmod")); And now putting it all together in order: private static ResourceKey<Item> rk = ResourceKey.create(Registries.ITEM, ResourceLocation.parse("modid:shotgunmod")); private static final Item.Properties p = new Item.Properties().useItemDescriptionPrefix().setId(rk); public static final RegistryObject<Item> SHOTGUN = ITEMS.register("shotgun", () -> new ShotgunItem(p)); This compiled and the mod no longer crashes. I still have more to do on it, but hopefully this will save someone hours. I welcome any feedback and if I missed some obvious modding resource or tutorial that has this information. If not, I might suggest we add it somewhere for people trying to write a mod that doesn't crash. Thank you !!!  
    • I will keep adding to this thread with more information in case anyone can help, or at the very least I can keep my troubleshooting organized. I decided to downgrade to 54.1.0 in the hopes that this would fix the issue but it didn't. At least now I am on a "recommended" version. The crash report did confirm my earlier post that the Exception is coming from effectiveDescriptionId(). I'll continue to see if I can find a way to set the ID manually.   Caused by: java.lang.NullPointerException: Item id not set         at java.base/java.util.Objects.requireNonNull(Objects.java:259) ~[?:?]         at TRANSFORMER/[email protected]/net.minecraft.world.item.Item$Properties.effectiveDescriptionId(Item.java:465) ~[forge-1.21.4-54.1.0-client.jar!/:?]         at TRANSFORMER/[email protected]/net.minecraft.world.item.Item.<init>(Item.java:111) ~[forge-1.21.4-54.1.0-client.jar!/:?]         at TRANSFORMER/[email protected]/com.example.shotgunmod.ShotgunItem.<init>(ShotgunItem.java:19) ~[shotgunmod-1.0.0.jar!/:1.0.0]         at TRANSFORMER/[email protected]/com.example.shotgunmod.ModItems.lambda$static$0(ModItems.java:15) ~[shotgunmod-1.0.0.jar!/:1.0.0]         at TRANSFORMER/[email protected]/net.minecraftforge.registries.DeferredRegister$EventDispatcher.lambda$handleEvent      
    • It just randomly stop working after a rebooted my dedicated server PLEASE HELP!   com.google.gson   Failed to start the minecraft server com.google.gson.JsonSyntaxException: Expected a com.google.gson.JsonObject but was com.google.gson.JsonPrimitive; at path $  
  • Topics

×
×
  • Create New...

Important Information

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