Thanks for the feedback, I am making a mod that is one mod for all, constantly adding to it / fixing it so there is no need to make mod packs etc. still could if you want though.
ok so I'm still having issues with my problem in the link below is my mess around mod please I looked in the IBlockventState again I'm new to modding and I want to learn as much as I can so if you could help explaine to me how its not workingI would be greatfull also did I use the wrong bus kuz I feel like I did.
few things:
1. like how you need the annotations @EventHandler for forge to run your initialization methods, you also need @SubscribeEvent in order for your methods to get called.
2. you need to name your methods the appropriate method as the API states. e.g. if you want it to be called when a block is destroyed you need to call it
public void onBlockDestroyedEvent(HarvestDropsEvent event) {
//code here
}
Hello everyone, welcome to my first mod! (name incomplete, maybe 'Level'?).
I am a amateur coder first time Minecraft Modder, decided to put my university knowledge to a practical project so decided to make a Minecraft Mod! My idea for a mod is completely from scratch, for the hardcore fans that are sick of the punch trees, make pick, go mining style of play. However it isn't just harder and slightly more realistic, it also incorporates a massive leveling system with a level for nearly every single aspect of play, you wake up and you have unlocked the perception skill, you take your first step you unlock the agility skills, you find a stick, you unlock the gathering skill etc etc. Still in development so there is a lot of ideas being tossed up in the air.
If you would like to watch my mod in action / an update of my progress I will be uploading videos to youtube as a summery of what I have done since the last video (I will try to do them once a week).
Cheers, Statphantom.
To Do:
Add some fibrous plans (Jute Cotton etc.) to world gen.
Get some good textures
Add panning for metals
Add camp fires
Add bark building blocks for homes
Create skills / levels GUI
Done:
Added string / rope from tensile weeds
tall grass drops tensile weeds on occation
Saved skills variables through death
Created 3 skills for testing
Crafting table
New wood axe mechanics
Add bark from trees
Sticks can only be gathered from grass that has leaves above it
Language file
Learned texture placement
Remove tree punching
Add sticks from grass
NEW: If you would like to help me develop my mod in any way, support me, or have an ideas then please post here, I will read everything.
PARTNER: Also if you would like to be a development partner on this project please message me, I cant offer anything in terms of money since this is a non-monetized home project however I will give you credit for everything you do and IF this project ever becomes monetized I would definitely split it with you.
While I don't mind, generally when your questions don't directly relate to the topic or go far beyond the original scope, you should start your own thread, which indeed you already have on Minecraftforge.net.
The reason for this is that people reading the comments are generally looking for information specifically related to the tutorial, not for long help threads. Speaking of which, if you encounter multiple issues, it's usually better to start a new topic for each specific issue - it makes it much easier for people to help you, and even for multiple people to help you with different problems, since they don't have to wade through a lot of mostly unrelated information.
certainly, I will keep my development discussion on my minecraftforge thread but will still reply to this one with a direct question about your event topics
I thought this forum was for help on eventhandlers? sure we have gone a bit off-topic from event handlers but I thought we were within the accepted parameters of discussion
You just have your item declared. You need to declare an EntityItem and within the parameters of the EntityItem you set your item to be the result. Also, Block.spawnAsEntity is the wrong method. You want event.world.spawnEntityInWorld(//YourEntityItemHere);
I got told to use Block.spawnAsEntity in order to get it to spawn on the block I click on otherwise it spawns under my feed, I want to basically mimic the visual of wheat breaking from a mature wheat seed.
Something like that ought to work.You can do a lot with enough knowledge of the various Minecraft and Forge classes, and that comes by scrupulously searching through both code sources whenever you run into a problem. If you want to get better, you need to spend lots of time reading and experimenting, with experimenting being the more important of the two.
When you experiment, use LOTS of println statements to see what is going on in your code, rather than typing some code and thinking 'oh, that didn't work' - why didn't it work? What, exactly, was it doing? Debugging should be your best friend.
Thanks, yea I have been doing exactly that, I have created a custom item, I can craft it, I made a simple function that will turn a grass block into dirt block, if clicked on top with an empty hand. but heres where I'm stuck now.
I can after this, get an item to spawn in the world, but I would like my created item to spawn but I cant find out how to do that since dropItem only accepts "Items". also it drops at my feet and I would like it to drop on the block I right clicked on, this is my code so far.....
@SubscribeEvent
public void onPlayerClickEvent(PlayerInteractEvent event) {
if (event.action == Action.RIGHT_CLICK_BLOCK) {
if (event.entityPlayer.getCurrentEquippedItem() == null) {
if (event.world.getBlockState(event.pos).getBlock() == Blocks.grass && event.face == event.face.UP) {
if (!event.world.isRemote) {
event.world.setBlockState(event.pos, Blocks.dirt.getDefaultState());
event.entity.dropItem(Items.stick, 1);
}
}
}
}
}
I want to replace event.entity.dropItem(Items.stick, 1); line with a line that can spawn my custom item (public class SharpStick extends Item) on top of the block I right clicked. any help with this? thanks.
so my previous example works for 'mining' but not for one click events. for that I still need to use a PlayerInteractEvent, so if I want to do something like "right clicking on a grass block turns it to dirt" I still need a way to get the block that I right click on, so still need help lol
I understand that. If you're starting a new mod then it's perfectly fine but if you have a huge mod already it really is a pain, especially when it's not your primary job to make a mod. It's hard to justify all that time when you know you're just going to have to do it all again in two months.
No doubt at all, maybe oneday when I get better I could even help out I am really passionate about coding and gaming so this is a perfect middle ground for me to learn, but like you, job and university does take precedence.
Oh, are you in 1.8? I've done very little with that. I opened my mod in it and had 12,000 errors and after about 3 hours I still had about 7,000 errors so I decided since 1.9 seems relatively close and it looks like they actually finished the features that are only half way finished in 1.8 I'd wait. I'm sure PlayerInteractEvent still works but the event you're using should work fine. However, what you have there looks like it will make every block except for logs impossible to break. Also, that code will make it so the block won't be able to be broken ever. Even with a tool.
correct, I am just experimenting seeing how things act / react, this isn't something for people to play this is for my own knowledge
yea 1.8 I am using, I want to mod for the latest version so I will move on to 1.9 when it is out but learning in 1.8 will still give me good insight into mod development
0
Video will be live shortly
https://youtu.be/gbznHyj0xNs
0
Thanks for the feedback, I am making a mod that is one mod for all, constantly adding to it / fixing it so there is no need to make mod packs etc. still could if you want though.
0
NEW VIDEO:
0
sorry, shouldn't have used the word 'need'. it 'should'
0
few things:
1. like how you need the annotations @EventHandler for forge to run your initialization methods, you also need @SubscribeEvent in order for your methods to get called.
2. you need to name your methods the appropriate method as the API states. e.g. if you want it to be called when a block is destroyed you need to call it
1
Hello everyone, welcome to my first mod! (name incomplete, maybe 'Level'?).
I am a amateur coder first time Minecraft Modder, decided to put my university knowledge to a practical project so decided to make a Minecraft Mod! My idea for a mod is completely from scratch, for the hardcore fans that are sick of the punch trees, make pick, go mining style of play. However it isn't just harder and slightly more realistic, it also incorporates a massive leveling system with a level for nearly every single aspect of play, you wake up and you have unlocked the perception skill, you take your first step you unlock the agility skills, you find a stick, you unlock the gathering skill etc etc. Still in development so there is a lot of ideas being tossed up in the air.
If you would like to follow on my learning experiences and help me mod you can find my forge post. here: http://www.minecraftforge.net/forum/index.php/topic,34061.0.html
If you would like to watch my mod in action / an update of my progress I will be uploading videos to youtube as a summery of what I have done since the last video (I will try to do them once a week).
Cheers, Statphantom.
To Do:
Add some fibrous plans (Jute Cotton etc.) to world gen.
Get some good textures
Add panning for metals
Add camp fires
Add bark building blocks for homes
Create skills / levels GUI
Done:
Added string / rope from tensile weeds
tall grass drops tensile weeds on occation
Saved skills variables through death
Created 3 skills for testing
Crafting table
New wood axe mechanics
Add bark from trees
Sticks can only be gathered from grass that has leaves above it
Language file
Learned texture placement
Remove tree punching
Add sticks from grass
NEW: If you would like to help me develop my mod in any way, support me, or have an ideas then please post here, I will read everything.
PARTNER: Also if you would like to be a development partner on this project please message me, I cant offer anything in terms of money since this is a non-monetized home project however I will give you credit for everything you do and IF this project ever becomes monetized I would definitely split it with you.
0
certainly, I will keep my development discussion on my minecraftforge thread but will still reply to this one with a direct question about your event topics
0
I thought this forum was for help on eventhandlers? sure we have gone a bit off-topic from event handlers but I thought we were within the accepted parameters of discussion
0
I got told to use Block.spawnAsEntity in order to get it to spawn on the block I click on otherwise it spawns under my feed, I want to basically mimic the visual of wheat breaking from a mature wheat seed.
but will try the rest of what you say, thanks.
0
how exactly do i do this? been messing around a lot but cant work it out.
this compiles but error when attempting to drop the item.
0
Thanks, yea I have been doing exactly that, I have created a custom item, I can craft it, I made a simple function that will turn a grass block into dirt block, if clicked on top with an empty hand. but heres where I'm stuck now.
I can after this, get an item to spawn in the world, but I would like my created item to spawn but I cant find out how to do that since dropItem only accepts "Items". also it drops at my feet and I would like it to drop on the block I right clicked on, this is my code so far.....
I want to replace event.entity.dropItem(Items.stick, 1); line with a line that can spawn my custom item (public class SharpStick extends Item) on top of the block I right clicked. any help with this? thanks.
0
so my previous example works for 'mining' but not for one click events. for that I still need to use a PlayerInteractEvent, so if I want to do something like "right clicking on a grass block turns it to dirt" I still need a way to get the block that I right click on, so still need help lol
0
No doubt at all, maybe oneday when I get better I could even help out I am really passionate about coding and gaming so this is a perfect middle ground for me to learn, but like you, job and university does take precedence.
0
correct, I am just experimenting seeing how things act / react, this isn't something for people to play this is for my own knowledge
yea 1.8 I am using, I want to mod for the latest version so I will move on to 1.9 when it is out but learning in 1.8 will still give me good insight into mod development
0
this worked!
Maybe PlayerInteractEvent has been depreciated? Unsure