Jump to content

[1.8][UNSOLVED] Help Me! Crash Report My Forge Modding In Custom Drops!!!


Recommended Posts

Posted

Pls Help Me Quickly Forge Modding Pls Help me! I have A Custom Drop Event Handler But Every Join Game Crashing...

DropHandler Class

 

 

1- package com.kodev.df.handlers;

2-

3- import java.util.Random;

4-

5-import com.kodev.df.main.ModRegister;

6-

7-import net.minecraft.init.Blocks;

8-import net.minecraft.init.Items;

9-import net.minecraft.item.ItemStack;

10-import net.minecraftforge.event.world.BlockEvent.HarvestDropsEvent;

11-import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;

12-import net.minecraftforge.fml.relauncher.Side;

13-import net.minecraftforge.fml.relauncher.SideOnly;

14-@SideOnly(Side.CLIENT)

15-public class DropHandler {

16- @SubscribeEvent

17- public void LeavesDrop (HarvestDropsEvent event) {

18- if (event.state.getBlock() == Blocks.leaves) {

19-

20- Random rand = new Random();

21-

22- ItemStack holding = event.harvester.inventory.getStackInSlot(event.harvester.inventory.currentItem);

23- if (holding != null) {

24- event.drops.add(new ItemStack(Items.stick, rand.nextInt(2)));

25- }

26- if (holding == null) {

27- event.drops.add(new ItemStack(Items.stick, rand.nextInt(2)));

28- }

29-

30- }

31- }

32- @SubscribeEvent

33- public void Leaves2Drop (HarvestDropsEvent event) {

34-if (event.state.getBlock() == Blocks.leaves2) {

35- Random rand = new Random();

36- ItemStack holding = event.harvester.inventory.getStackInSlot(event.harvester.inventory.currentItem);

37- if (holding != null) {

38- event.drops.add(new ItemStack(Items.stick, rand.nextInt(2)));

39- }

40- if (holding == null) {

41- event.drops.add(new ItemStack(Items.stick, rand.nextInt(2)));

42-

43-

44- }

45-

46- }

47- }

48-

49- @SubscribeEvent

50- public void StoneDrop (HarvestDropsEvent event) {

51-if (event.state.getBlock() == Blocks.stone) {

52- Random rand = new Random();

53- ItemStack holding = event.harvester.inventory.getStackInSlot(event.harvester.inventory.currentItem);

54- if (holding.getItem() == Items.wooden_pickaxe) {

55- event.drops.add(new ItemStack(ModRegister.stone_nugget, rand.nextInt(2)));

56- }

57- if (holding.getItem() == Items.stone_pickaxe) {

58- event.drops.add(new ItemStack(ModRegister.stone_nugget, rand.nextInt(2)));

59- }

60- if (holding.getItem() == Items.iron_pickaxe) {

61- event.drops.add(new ItemStack(ModRegister.stone_nugget, rand.nextInt(2)));

62- }

63- if (holding.getItem() == Items.golden_pickaxe) {

64- event.drops.add(new ItemStack(ModRegister.stone_nugget, rand.nextInt(2)));

65- }

66- if (holding.getItem() == Items.diamond_pickaxe) {

67- event.drops.add(new ItemStack(ModRegister.stone_nugget, rand.nextInt(2)));

68- }

69-

70- }

71- }

72- }

 

 

 

 

 

Crah Report

 

---- Minecraft Crash Report ----

// You're mean.

 

Time: 06.03.2016 20:26

Description: Exception ticking world

 

java.lang.NullPointerException: Exception ticking world

at com.kodev.df.handlers.DropHandler.LeavesDrop(DropHandler.java:22)

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

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

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

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

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

at net.minecraft.block.BlockLeaves.dropBlockAsItemWithChance(BlockLeaves.java:248)

at net.minecraft.block.Block.dropBlockAsItem(Block.java:597)

at net.minecraft.block.BlockLeaves.destroy(BlockLeaves.java:218)

at net.minecraft.block.BlockLeaves.updateTick(BlockLeaves.java:198)

at net.minecraft.block.Block.randomTick(Block.java:528)

at net.minecraft.world.WorldServer.updateBlocks(WorldServer.java:467)

at net.minecraft.world.WorldServer.tick(WorldServer.java:228)

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

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.kodev.df.handlers.DropHandler.LeavesDrop(DropHandler.java:22)

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

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

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

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

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

at net.minecraft.block.BlockLeaves.dropBlockAsItemWithChance(BlockLeaves.java:248)

at net.minecraft.block.Block.dropBlockAsItem(Block.java:597)

at net.minecraft.block.BlockLeaves.destroy(BlockLeaves.java:218)

at net.minecraft.block.BlockLeaves.updateTick(BlockLeaves.java:198)

at net.minecraft.block.Block.randomTick(Block.java:528)

at net.minecraft.world.WorldServer.updateBlocks(WorldServer.java:467)

at net.minecraft.world.WorldServer.tick(WorldServer.java:228)

 

-- Affected level --

Details:

Level name: Kodev

All players: 1 total; [EntityPlayerMP['Player983'/0, l='Kodev', x=-199,71, y=61,00, z=2888,95]]

Chunk stats: ServerChunkCache: 564 Drop: 0

Level seed: 1355276509355184999

Level generator: ID 01 - flat, ver 0. Features enabled: true

Level generator options: 3;minecraft:bedrock,3*minecraft:stone,52*minecraft:sandstone;2;

Level spawn location: 26,00,4,00,275,00 - World: (26,4,275), Chunk: (at 10,0,3 in 1,17; contains blocks 16,0,272 to 31,255,287), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511)

Level time: 263154 game time, 6000 day time

Level dimension: 0

Level storage version: 0x04ABD - Anvil

Level weather: Rain time: 48925 (now: false), thunder time: 1656 (now: true)

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

Stacktrace:

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

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)

 

-- System Details --

Details:

Minecraft Version: 1.8

Operating System: Windows 10 (amd64) version 10.0

Java Version: 1.8.0_66, Oracle Corporation

Java VM Version: Java HotSpot 64-Bit Server VM (mixed mode), Oracle Corporation

Memory: 831829280 bytes (793 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB)

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

IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0

FML: MCP v9.10 FML v8.0.99.99 Minecraft Forge 11.14.3.1502 5 mods loaded, 5 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{8.0.99.99} [Forge Mod Loader] (forgeSrc-1.8-11.14.3.1502.jar)

UCHIJAAAA Forge{11.14.3.1502} [Minecraft Forge] (forgeSrc-1.8-11.14.3.1502.jar)

UCHIJAAAA hardcore{2.1.12b} [§aHardcore Minecraft] (bin)

UCHIJAAAA Waila{1.6.0} [Waila] (Waila-1.6.0-B2_1.8-dev.jar)

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['Player983'/0, l='Kodev', x=-199,71, y=61,00, z=2888,95]]

Type: Integrated Server (map_client.txt)

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

 

Developing Kodev Minecraft Hardcore Mod!

If You're Wondering, My Mod Page. http://minecraft.curseforge.com/projects/minecraft-hardcore-mod

Posted

1) Why do you subscribe to the event multiple times?  You know you can check for multiple blocks at once, right?

2) Why do you check to see if the player is holding a stack, or not holding a stack, and then do the same thing regardless? (for two of those handlers)

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

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

    • Try other builds: https://www.curseforge.com/minecraft/mc-mods/geckolib/files/all?page=1&pageSize=20&version=1.16.5&gameVersionTypeId=1 Currently, you are using build 96 - the latest one that I linked is build 106 So try 97 to 105  
    • New users at Temu receive a $100 discount on orders over $100 Use the code [aci789589] during checkout to get Temu Coupon Code $100 off For New Users. Yes, Temu offers $100 off coupon code “aci789589” for first-time users. Temu 100% Off coupon code "aci789589" will save you $100 on your order. To get a discount, click on the item to purchase and enter the code. Yes, Temu offers $100 off coupon code “aci789589” for first-time users. You can get a$100 bonus plus 30% off any purchase at Temu with the$100 Coupon Bundle at Temu if you sign up with the referral code [aci789589] and make a first purchase of$50 or more. The Temu $100 Off coupon code (aci789589) will save you $100 on your order. To get a discount, click on the item to purchase and enter the code. Yes Temu offers $100 Off Coupon Code “aci789589” for First Time Users. Yes, Temu offers $100 off coupon code {aci789589} for first-time users. You can get a $100 bonus plus 100% off any purchase at Temu with the $100 Coupon Bundle if you sign up with the referral code [aci789589] and make a first purchase of $100 or more. If you are who wish to join Temu, then you should use this exclusive Temu coupon code $100 off (aci789589) and get $100 off on your purchase with Temu. You can get a $100 discount with Temu coupon code {aci789589}. This exclusive offer is for existing customers and can be used for a $100 reduction on your total purchase. Enter coupon code {aci789589} at checkout to avail of the discount. You can use the code {aci789589} to get a $100 off Temu coupon as a new customer. Apply this Temu coupon code $100 off (aci789589) to get a $100 discount on your shopping with Temu. If you’re a first-time user and looking for a Temu coupon code $100 first time user(aci789589) then using this code will give you a flat $100 Off and a 90% discount on your Temu shopping. Temu $100% Off Coupon Code "aci789589" will save you $100 on your order. To get a discount, click on the item to purchase and enter the code. Temu coupon code$100off-{aci789589} Temu coupon code -{aci789589} Temu coupon code$50 off-{aci789589} Temu Coupon code [aci789589] for existing users can get up to 50% discount on product during checkout. Temu Coupon Codes for Existing Customers-aci789589 Temu values its loyal customers and offers various promo codes, including the Legit Temu Coupon Code (aci789589]) or (aci789589), which existing users can use. This ensures that repeat shoppers can also benefit from significant discounts on their purchases. Keep an eye out for special promotions and offers that are periodically available to enhance your shopping experience.
    • New users at Temu receive a $100 discount on orders over $100 Use the code [aci789589] during checkout to get Temu Coupon Code $100 off For New Users. Yes, Temu offers $100 off coupon code “aci789589” for first-time users. Temu 100% Off coupon code "aci789589" will save you $100 on your order. To get a discount, click on the item to purchase and enter the code. Yes, Temu offers $100 off coupon code “aci789589” for first-time users. You can get a$100 bonus plus 30% off any purchase at Temu with the$100 Coupon Bundle at Temu if you sign up with the referral code [aci789589] and make a first purchase of$50 or more. The Temu $100 Off coupon code (aci789589) will save you $100 on your order. To get a discount, click on the item to purchase and enter the code. Yes Temu offers $100 Off Coupon Code “aci789589” for First Time Users. Yes, Temu offers $100 off coupon code {aci789589} for first-time users. You can get a $100 bonus plus 100% off any purchase at Temu with the $100 Coupon Bundle if you sign up with the referral code [aci789589] and make a first purchase of $100 or more. If you are who wish to join Temu, then you should use this exclusive Temu coupon code $100 off (aci789589) and get $100 off on your purchase with Temu. You can get a $100 discount with Temu coupon code {aci789589}. This exclusive offer is for existing customers and can be used for a $100 reduction on your total purchase. Enter coupon code {aci789589} at checkout to avail of the discount. You can use the code {aci789589} to get a $100 off Temu coupon as a new customer. Apply this Temu coupon code $100 off (aci789589) to get a $100 discount on your shopping with Temu. If you’re a first-time user and looking for a Temu coupon code $100 first time user(aci789589) then using this code will give you a flat $100 Off and a 90% discount on your Temu shopping. Temu $100% Off Coupon Code "aci789589" will save you $100 on your order. To get a discount, click on the item to purchase and enter the code. Temu coupon code$100off-{aci789589} Temu coupon code -{aci789589} Temu coupon code$50 off-{aci789589} Temu Coupon code [aci789589] for existing users can get up to 50% discount on product during checkout. Temu Coupon Codes for Existing Customers-aci789589 Temu values its loyal customers and offers various promo codes, including the Legit Temu Coupon Code (aci789589]) or (aci789589), which existing users can use. This ensures that repeat shoppers can also benefit from significant discounts on their purchases. Keep an eye out for special promotions and offers that are periodically available to enhance your shopping experience.
    • Both Ars Nouveau and Chaos Awakens require a range of geckolib versions, and the build you sent is outside the range. Ars Nouveau has an update, but Chaos Awakens doesn't, which means I can't use the build you sent. Is there any other way to fix the crash?
    • New users at Temu receive a $100 discount on orders over $100 Use the code [aci789589] during checkout to get Temu Coupon Code $100 off For New Users. Yes, Temu offers $100 off coupon code “aci789589” for first-time users. Temu 100% Off coupon code "aci789589" will save you $100 on your order. To get a discount, click on the item to purchase and enter the code. Yes, Temu offers $100 off coupon code “aci789589” for first-time users. You can get a$100 bonus plus 30% off any purchase at Temu with the$100 Coupon Bundle at Temu if you sign up with the referral code [aci789589] and make a first purchase of$50 or more. The Temu $100 Off coupon code (aci789589) will save you $100 on your order. To get a discount, click on the item to purchase and enter the code. Yes Temu offers $100 Off Coupon Code “aci789589” for First Time Users. Yes, Temu offers $100 off coupon code {aci789589} for first-time users. You can get a $100 bonus plus 100% off any purchase at Temu with the $100 Coupon Bundle if you sign up with the referral code [aci789589] and make a first purchase of $100 or more. If you are who wish to join Temu, then you should use this exclusive Temu coupon code $100 off (aci789589) and get $100 off on your purchase with Temu. You can get a $100 discount with Temu coupon code {aci789589}. This exclusive offer is for existing customers and can be used for a $100 reduction on your total purchase. Enter coupon code {aci789589} at checkout to avail of the discount. You can use the code {aci789589} to get a $100 off Temu coupon as a new customer. Apply this Temu coupon code $100 off (aci789589) to get a $100 discount on your shopping with Temu. If you’re a first-time user and looking for a Temu coupon code $100 first time user(aci789589) then using this code will give you a flat $100 Off and a 90% discount on your Temu shopping. Temu $100% Off Coupon Code "aci789589" will save you $100 on your order. To get a discount, click on the item to purchase and enter the code. Temu coupon code$100off-{aci789589} Temu coupon code -{aci789589} Temu coupon code$50 off-{aci789589} Temu Coupon code [aci789589] for existing users can get up to 50% discount on product during checkout. Temu Coupon Codes for Existing Customers-aci789589 Temu values its loyal customers and offers various promo codes, including the Legit Temu Coupon Code (aci789589]) or (aci789589), which existing users can use. This ensures that repeat shoppers can also benefit from significant discounts on their purchases. Keep an eye out for special promotions and offers that are periodically available to enhance your shopping experience.
  • Topics

×
×
  • Create New...

Important Information

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