public class LeavesDropHandler {
public static void addDropForType(HarvestDropsEvent event) {
Block block = event.getState().getBlock();
java.util.List<ItemStack> drops = event.getDrops();
if (block == Blocks.LEAVES) {
drops.add(new ItemStack(Items.ARROW));
}
}
}
is what I have so far. However, I'm doing something wrong as leaves aren't dropping arrows. Eventually, I plan to change the drop to a custom item, just I want to handle the part I'm unfamiliar with first. What am I doing wrong, and how could I customise this so if I'm holding a certain tool?
Would it be better to have it coded into the tool, something like (pseudocode warning)
if (breakingLeaves) {
drop(Items.Arrow)
}
(Forge 14.21.1.2387)
Yes I've imported everything necessary, and will import anything needed
Edit: In my actual Mod File, I add this to preInit:
I created my mod, which adds a new dimension, and several blocks. When I tried loading it, it crashed and gave this error:
<div>---- Minecraft Crash Report ----
// Oops.</div>
<div> </div>
<div>Time: 8/23/15 3:06 PM
Description: There was a severe problem during mod loading that has caused the game to fail</div>
<div> </div>
<div>net.minecraftforge.fml.common.LoaderException: java.lang.NoSuchFieldError: ground
at net.minecraftforge.fml.common.LoadController.transition(LoadController.java:163)
at net.minecraftforge.fml.common.Loader.loadMods(Loader.java:538)
at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:214)
at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:413)
at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:325)
at net.minecraft.client.main.Main.main(SourceFile:120)
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:483)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
Caused by: java.lang.NoSuchFieldError: ground
at mod.mcreator.mcreator_netherStarBlock$BlockNetherStarBlock.<init>(mcreator_netherStarBlock.java:147)
at mod.mcreator.mcreator_netherStarBlock.<clinit>(mcreator_netherStarBlock.java:121)
at mod.mcreator.TestEnvironmentMod.<init>(TestEnvironmentMod.java:106)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:408)
at java.lang.Class.newInstance(Class.java:438)
at net.minecraftforge.fml.common.ILanguageAdapter$JavaAdapter.getNewInstance(ILanguageAdapter.java:174)
at net.minecraftforge.fml.common.FMLModContainer.constructMod(FMLModContainer.java:511)
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:483)
at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
at com.google.common.eventbus.EventBus.post(EventBus.java:275)
at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:212)
at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:190)
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:483)
at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
at com.google.common.eventbus.EventBus.post(EventBus.java:275)
at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:119)
at net.minecraftforge.fml.common.Loader.loadMods(Loader.java:507)
... 10 more</div>
<div> </div>
<div>
A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------</div>
<div> </div>
<div>-- System Details --
Details:
Minecraft Version: 1.8
Operating System: Windows 10 (amd64) version 10.0
Java Version: 1.8.0_25, Oracle Corporation
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 128763800 bytes (122 MB) / 252325888 bytes (240 MB) up to 1060372480 bytes (1011 MB)
JVM Flags: 6 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xmx1G -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:-UseAdaptiveSizePolicy -Xmn128M
IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
FML: MCP v9.10 FML v8.0.99.99 Minecraft Forge 11.14.3.1499 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
UC mcp{9.05} [Minecraft Coder Pack] (minecraft.jar)
UC FML{8.0.99.99} [Forge Mod Loader] (forge-1.8-11.14.3.1499.jar)
UC Forge{11.14.3.1499} [Minecraft Forge] (forge-1.8-11.14.3.1499.jar)
UE TestEnvironmentMod{1.0} [TestEnvironmentMod] (test_mod.jar)
Loaded coremods (and transformers):
GL info: ' Vendor: 'Intel' Version: '4.0.0 - Build 10.18.10.4252' Renderer: 'Intel(R) HD Graphics 4000'</div>
Irresponsible Craft This server is a Computercraft (and Perihperals) It uses a Technic Platform so you don't have to do anything!
We have a dedicated staff of 3 members at the moment: Sxw1212 [Founder and Owner] sethxia [Co-Owner] carrots084 [Admin] We have a very friendly community that is active, and even have a server email system. Our owner, Sxw1212, has gone so far to even develop
Hello jamioflan or who ever reads this could you please tell me how to make this mod compatible with industrial craft 2? Or if just flan reads this could you please update the mod to be compatible with industrial craft 2?
jamoiflan is flan. and it is compatible with ic2 1.12 jsut except guns dont work. But that isnt because of ic2 it is a glitch with flans coding
Now launching...
Failed to launch
java.lang.VerifyError: (class: net/minecraft/client/MinecraftApplet, method: fmlInitReentry signature: ()V) Bad type in putfield/putstatic
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
at java.lang.Class.getConstructor0(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at com.sk89q.mclauncher.launch.GameLauncher$1.run(GameLauncher.java:177)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$200(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
-NO GRIEFING. IF YOU GRIEF, YOU WILL BE BANNED, AND HAVE A BAD REVIEW ON SERVER LIST WEBSITES.
-NO SPAWN KILLERS. PEOPLE HATE THEM, AND WE DON'T BAD REVIEWS FOR LETTING PEOPLE SPAWN KILL.
-HAVE FUN!
0
Update: Fixed.
0
is what I have so far. However, I'm doing something wrong as leaves aren't dropping arrows. Eventually, I plan to change the drop to a custom item, just I want to handle the part I'm unfamiliar with first. What am I doing wrong, and how could I customise this so if I'm holding a certain tool?
Would it be better to have it coded into the tool, something like (pseudocode warning)
(Forge 14.21.1.2387)
Yes I've imported everything necessary, and will import anything needed
Edit: In my actual Mod File, I add this to preInit:
0
That program seems to just be a default minecraft server for which you code your own plugins...
0
in the .gradle folder create gradle.properties
and make the first and only line
0
For some reason, del and reloading this mod from my mods folder worked. Weird.
0
I created my mod, which adds a new dimension, and several blocks. When I tried loading it, it crashed and gave this error:
Thanks!
0
http://imgur.com/3Y90Hwm,fHPPHRC,mtWZlU7,ffetNlY,NlNQjsr,AYTEe6h
IGN: Carrots084
Time playing Minecraft: Since around 2011, with Beta 1.3
Skills as a builder: Definitely not the best, but not bad.
Skills at redstone: Definitely not the best, but not bad.
0
This server is a Computercraft (and Perihperals) It uses a Technic Platform so you don't have to do anything!
We have a dedicated staff of 3 members at the moment:
Sxw1212 [Founder and Owner]
sethxia [Co-Owner]
carrots084 [Admin]
We have a very friendly community that is active, and even have a server email system. Our owner, Sxw1212, has gone so far to even develop
0
banana
what he said hi. Whats wrong with that.
3 years here. but it was fun. i just hated cancelling my mem 3 or 4 times xD
if you're gonna troll get off the forums. we're not nerds. You especially can't say that because, you play minecraft. minecraft is a game for nerds.
0
Sam here...
0
0
jamoiflan is flan. and it is compatible with ic2 1.12 jsut except guns dont work. But that isnt because of ic2 it is a glitch with flans coding
0
Failed to launch
java.lang.VerifyError: (class: net/minecraft/client/MinecraftApplet, method: fmlInitReentry signature: ()V) Bad type in putfield/putstatic
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
at java.lang.Class.getConstructor0(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at com.sk89q.mclauncher.launch.GameLauncher$1.run(GameLauncher.java:177)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$200(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
i got this error log
0
0
Managed 4 servers before. Not an amateur.
SERVER RULES
-NO GRIEFING. IF YOU GRIEF, YOU WILL BE BANNED, AND HAVE A BAD REVIEW ON SERVER LIST WEBSITES.
-NO SPAWN KILLERS. PEOPLE HATE THEM, AND WE DON'T BAD REVIEWS FOR LETTING PEOPLE SPAWN KILL.
-HAVE FUN!