EDIT: The initial method I wanted to use is way too complicated for me right now, so I'm just trying to make sand drop 1 stick when broken by the player. Hopefully I get a better understanding on how to do this with such a simple event handler.
Well I got the help of eclipse now, but I'm still pretty clueless on how to define 'when breaking a block' I keep getting errors. It's still the same one. I tried state, getState, getState(), drop, Drops, but nothing seems to hint me a clue.
EDIT: The initial method I wanted to do is way too complicated for me to understand right now, so I'm just trying to get a feel of it by having sand drop a stick when broken by the player.
Oh wow I think I solved it. Forge doesnt use java 9 I found out. Downloaded and installed JDK for java 8 and its starting to work now. Thanks for the tips!
Thanks so far so good. I was trying to do this command I saw online from inside the forge folder I extracted ''gradlew setupDecompWorkspace'' Do I even do that?
My problem now is when I try to open the ''Minecraft'' folder inside eclipse i get this error:
The project description file (.project) for 'Minecraft' is missing. This file contains important information about the project. The project will not function properly until this file is restored.
Ok let me explain why I am having so much trouble. Firstly I am not using eclipse to build my code. Why? Because I can't set up my workspace because of this:
I am using the mcreator code viewing tab which allows you to write code but not help you build code like in eclipse. I refrained from saying that for obvious reasons. I've read all the hate all around the forum when someone mentions mcreator. The problem is atm it's the only tool I have for learning code until I figure out how to set up eclipse.
I DO wanna use eclipse but its broken in my computer and I don't know how to fix it.
Thanks for the reply Arisa. I will add that to my notes and give it a shot.
I'm exhausted... This is my wip Handler. This has my mod completely at a stall. If I can't do this I'm gonna have to change my mod idea to something more fitting of my abilities.
I know I have some imports I dont need, but I have it there because I will be doing some other stuff elsewhere and I don't wanna forget the names for now. Ok now I'm trying to make a test event handler to make sand drop sticks when broken. I have not finished, and was trying to correct the many errors I had (mostly fixed importing stuff), however this last one error got me on the ropes and I have no way to fix it.
Gradle says:
myVanillaEdits.java:35: error: cannot find symbol if(event.state.getBlock() == Blocks.sand) ^ symbol: variable state location: variable event of type HarvestDropsEvent 1 error
Am I mistakenly using code from another MC version? This makes no sense. I could never find a 'state' variable that extends from HarvestDropsEvent. I just coded it like that because it's what I saw other people do.
This is it!!! Thank you so much. I've finally found the answer to my problem at just a glance, and will read it all to learn it all. This is simple the most complete guide I've seen. Once again thank you so much! I'll favorite all of this.
Wow I went to the forge forums thinking that was my best bet but I saw replies saying they no longer support 1.7.10 which is ok I guess. I've spent 2-4 hours a day researching this stuff for almost 3 weeks with no luck. On monday it will be my 3rd week and I still can't make an event handler. Something is wrong and not even coping and pasting a practice event handler seems to work. I am missing packages it says, but the internet is void of this information.
I cant find a list of events, a list of imports, or any visual help on google, mcforums, mcreator coding forums, forgeforums, planetminecraft, or youtube. Even if someone helps me create this event I'm still doomed. There is no info I can read from to learn how to use new events.
All I ask if anyone could help me is to show me where I can go to read about this stuff and learn. I can't put 2+2 together because I can't find anywhere to learn it from. My very last hope is reddit. I hope to hear from anyone soon. Thanks
My problem seems to be much bigger than I thought. One problem I keep encountering is that the tutorials tell you how to create an event handler assuming that you know and have done X amount of things. It's really problematic for people who know absolutely nothing about coding like me.
Something I'm beginning to suspect lately:
Do I need to import something for my methods to work?! It keeps saying my method package is not there and that left me thinking. Package? You mean like an import?
Now let it sit for a while until you get clay slabs, then break to collect clay:
Getting clay is not guaranteed. There is a higher chance you will fail and instead get mud, instead of clay. If you fail, then find another spot and start over:
The mud returns to dirt blocks after it rains, so that they can be useable once again. You do not mess with the muddy outlines or you will fail to get your clay 100%. Your only job is to mix with a stick and hope u find clay. Get curious and mess with the outline and it will break on you, only to start over.
Clay Pot/Bucket:
-Pot must be submerged under 1 block of water for it to be able to fill up.
-Right clicking a pot full of water will spill the water. Place it where water is desired, then right click.
Clay Pot Cooking:
-Heat sources are fire, lava, and lit furnace. They must be under a pot full of water, and or with carrots to heat up.
-Added tinder sticks as an early fire starter that only works on logs.
Thanks! I will keep that in mind. I definitely read your post. I will go back to it when the time comes to see what things I can incorporate. I'm trying to keep the vanilla feel and look, but I'm open to ideas and see how I can do things while keeping it vanilla.
Ok so with this module I will add a more realistic spin to clay. You will be able to bake in the world pots, jugs, vessels, and some early tools to assist you in your early survival game.
This is an interactive mod. A lot of things will require you to place things in the world, lit things up, and add items to blocks in the world. The recipes can be found with NEI.
Features:
-Cooking Pots
-Water Pots
-Storing Pots (WIP)
-Smelting Pots (WIP)
-Decoration Pots (WIP)
I will release betas once I have fully interconnected my mod's ideas.
I've been at it since monday and I've gotten this far:
public class MyEventHandler
{
@SubscribeEvent
public void debark(HarvestDropsEvent event)
{
Right click on birch wood with an axe and replace it with a debarked birch log. Also drop item birch bark on the ground.
}
Cool I will also be making a clay mod which will allow you to bake in-world pots for gathering water early in game with no iron, storing things, and more. I also plan to make a metal working part with actual metal processing (heating, shaping, smelting). I'm trying to decide if I wanna make it all into a gigantic mod or just make it into modules. It will have compatibility with tinkers and stuff.
0
EDIT: The initial method I wanted to use is way too complicated for me right now, so I'm just trying to make sand drop 1 stick when broken by the player. Hopefully I get a better understanding on how to do this with such a simple event handler.
0
Well I got the help of eclipse now, but I'm still pretty clueless on how to define 'when breaking a block' I keep getting errors. It's still the same one. I tried state, getState, getState(), drop, Drops, but nothing seems to hint me a clue.
package mod.myevents.main;
import java.util.Collection;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.world.BlockEvent;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
@Mod(modid = "myEvents", name = "myEvents", version = "Alpha 0.0")
public class myEvents {
public myEvents() {
}
@EventHandler
public static void PreInit(FMLPreInitializationEvent event) {
}
@EventHandler
public static void Init(FMLInitializationEvent event) {
}
public void load() {
MinecraftForge.EVENT_BUS.register(new myEvents());
}
@SubscribeEvent
public void onBlockBreak(BlockEvent.HarvestDropsEvent event) {
if(event.getState().getBlock() == Blocks.sand) {
event.drops.addAll((Collection<? extends ItemStack>) Items.stick);
}
}
}
EDIT: The initial method I wanted to do is way too complicated for me to understand right now, so I'm just trying to get a feel of it by having sand drop a stick when broken by the player.
1
Oh wow I think I solved it. Forge doesnt use java 9 I found out. Downloaded and installed JDK for java 8 and its starting to work now. Thanks for the tips!
0
Thanks so far so good. I was trying to do this command I saw online from inside the forge folder I extracted ''gradlew setupDecompWorkspace'' Do I even do that?
My problem now is when I try to open the ''Minecraft'' folder inside eclipse i get this error:
The project description file (.project) for 'Minecraft' is missing. This file contains important information about the project. The project will not function properly until this file is restored.
Any command I type leads to:
C:\Users\Jonathan\Downloads\Minecraft Modding\forge-1.7.10-10.13.4.1558-1.7.10-s
rc>gradlew setupDecompWorkspace
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine java version from '9.0.4'.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug
option to get more log output.
C:\Users\Jonathan\Downloads\Minecraft Modding\forge-1.7.10-10.13.4.1558-1.7.10-s
rc>
0
Ok let me explain why I am having so much trouble. Firstly I am not using eclipse to build my code. Why? Because I can't set up my workspace because of this:
C:\Users\Jonathan\Downloads\Minecraft Modding\forge-1.7.10-10.13.4.1558-1.7.10-s
rc>gradlew setupDecompWorkspace
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine java version from '9.0.4'.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug
option to get more log output.
C:\Users\Jonathan\Downloads\Minecraft Modding\forge-1.7.10-10.13.4.1558-1.7.10-s
rc>
I am using the mcreator code viewing tab which allows you to write code but not help you build code like in eclipse. I refrained from saying that for obvious reasons. I've read all the hate all around the forum when someone mentions mcreator. The problem is atm it's the only tool I have for learning code until I figure out how to set up eclipse.
I DO wanna use eclipse but its broken in my computer and I don't know how to fix it.
Thanks for the reply Arisa. I will add that to my notes and give it a shot.
0
I'm exhausted... This is my wip Handler. This has my mod completely at a stall. If I can't do this I'm gonna have to change my mod idea to something more fitting of my abilities.
import net.minecraftforge.event.terraingen.PopulateChunkEvent;
import net.minecraftforge.event.terraingen.DecorateBiomeEvent;
import net.minecraftforge.event.world.BlockEvent.HarvestDropsEvent;
import net.minecraftforge.event.world.BlockEvent;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.client.event.RenderGameOverlayEvent;
import net.minecraft.world.World;
import net.minecraft.server.MinecraftServer;
import net.minecraft.item.ItemStack;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.client.Minecraft;
import net.minecraft.init.Blocks;
import java.util.Random;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.eventhandler.EventPriority;
import cpw.mods.fml.common.event.FMLServerStartingEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.FMLCommonHandler;
public class myVanillaEdits
{
public static class MyBlockEventClass
{
@SubscribeEvent
public void onBlockBreak(BlockEvent.HarvestDropsEvent event)
{
if(event.state.getBlock() == Blocks.sand)
{
}
}
public void load()
{
MinecraftForge.EVENT_BUS.register(new MyBlockEventClass());
}
}
I know I have some imports I dont need, but I have it there because I will be doing some other stuff elsewhere and I don't wanna forget the names for now. Ok now I'm trying to make a test event handler to make sand drop sticks when broken. I have not finished, and was trying to correct the many errors I had (mostly fixed importing stuff), however this last one error got me on the ropes and I have no way to fix it.
Gradle says:
myVanillaEdits.java:35: error: cannot find symbol
if(event.state.getBlock() == Blocks.sand)
^
symbol: variable state
location: variable event of type HarvestDropsEvent
1 error
Am I mistakenly using code from another MC version? This makes no sense. I could never find a 'state' variable that extends from HarvestDropsEvent. I just coded it like that because it's what I saw other people do.
0
This is it!!! Thank you so much. I've finally found the answer to my problem at just a glance, and will read it all to learn it all. This is simple the most complete guide I've seen. Once again thank you so much! I'll favorite all of this.
0
Wow I went to the forge forums thinking that was my best bet but I saw replies saying they no longer support 1.7.10 which is ok I guess. I've spent 2-4 hours a day researching this stuff for almost 3 weeks with no luck. On monday it will be my 3rd week and I still can't make an event handler. Something is wrong and not even coping and pasting a practice event handler seems to work. I am missing packages it says, but the internet is void of this information.
I cant find a list of events, a list of imports, or any visual help on google, mcforums, mcreator coding forums, forgeforums, planetminecraft, or youtube. Even if someone helps me create this event I'm still doomed. There is no info I can read from to learn how to use new events.
All I ask if anyone could help me is to show me where I can go to read about this stuff and learn. I can't put 2+2 together because I can't find anywhere to learn it from. My very last hope is reddit. I hope to hear from anyone soon. Thanks
0
Thanks for the reply.
My problem seems to be much bigger than I thought. One problem I keep encountering is that the tutorials tell you how to create an event handler assuming that you know and have done X amount of things. It's really problematic for people who know absolutely nothing about coding like me.
Something I'm beginning to suspect lately:
Do I need to import something for my methods to work?! It keeps saying my method package is not there and that left me thinking. Package? You mean like an import?
1
This is how to find clay in the world:
Getting clay in the world:
Make a hole:
Fill it with water:
Mix water and dirt with a tool:
Mix some more:
Dirt is beginning to get wet. Mix some more:
And some more until it becomes soft like mud:
Now let it sit for a while until you get clay slabs, then break to collect clay:
Getting clay is not guaranteed. There is a higher chance you will fail and instead get mud, instead of clay. If you fail, then find another spot and start over:
The mud returns to dirt blocks after it rains, so that they can be useable once again. You do not mess with the muddy outlines or you will fail to get your clay 100%. Your only job is to mix with a stick and hope u find clay. Get curious and mess with the outline and it will break on you, only to start over.
Clay Pot/Bucket:
-Pot must be submerged under 1 block of water for it to be able to fill up.
-Right clicking a pot full of water will spill the water. Place it where water is desired, then right click.
Clay Pot Cooking:
-Heat sources are fire, lava, and lit furnace. They must be under a pot full of water, and or with carrots to heat up.
-Added tinder sticks as an early fire starter that only works on logs.
0
Thanks! I will keep that in mind. I definitely read your post. I will go back to it when the time comes to see what things I can incorporate. I'm trying to keep the vanilla feel and look, but I'm open to ideas and see how I can do things while keeping it vanilla.
1
2nd module to my 'Harder Mod' series. Harder Wood Link: http://www.minecraftforum.net/forums/mapping-and-modding-java-edition/minecraft-mods/wip-mods/2882568-harder-wood-mod
Ok so with this module I will add a more realistic spin to clay. You will be able to bake in the world pots, jugs, vessels, and some early tools to assist you in your early survival game.
This is an interactive mod. A lot of things will require you to place things in the world, lit things up, and add items to blocks in the world. The recipes can be found with NEI.
Features:
-Cooking Pots
-Water Pots
-Storing Pots (WIP)
-Smelting Pots (WIP)
-Decoration Pots (WIP)
I will release betas once I have fully interconnected my mod's ideas.
0
I've been at it since monday and I've gotten this far:
public class MyEventHandler
{
@SubscribeEvent
public void debark(HarvestDropsEvent event)
{
Right click on birch wood with an axe and replace it with a debarked birch log. Also drop item birch bark on the ground.
}
}
How do I turn that last part to code?
0
Cool I will also be making a clay mod which will allow you to bake in-world pots for gathering water early in game with no iron, storing things, and more. I also plan to make a metal working part with actual metal processing (heating, shaping, smelting). I'm trying to decide if I wanna make it all into a gigantic mod or just make it into modules. It will have compatibility with tinkers and stuff.
0
No... This is a dead mod.