The main reason I say do not learn by making a mod is that when things go wrong or don't work (which will inevitably happen), how will you know whether it is a java issue or a modding issue? So you will ask here and just get told to "go learn Java".
You NEED to be able to read and understand exceptions and be able to debug your own code.
When there is no exception, but it isn't doing what you expected, that is when you come and ask us for assistance.
The people on this forum assume that the person they are helping has java knowledge, so understands what they are telling them to do without writing the code for them.
i starting watching lessons from Stanford university, I'm surprised at how simular it is to minecraft commandblocks using scoreboards with commands, tellraw. and trigger boards etc. at first i felt like what i was learning had no connection to minecraft but I'm starting to see connections. this is the playlist I'm using the following video
I find it to be easy to fallow and somewhat entertaining. i don't know what I'm going to get out of it yet because I'm not finished. but i think when all is said and done i think its an awesome way to learn java. in the first video he does a really good job of explaining why we cant just jump into making programs (in my case mods) because i need to understand the language first
his example "writing code is just like writing an essay. you cant be a good essay writing, without learning the language you want to write in. if you don't learn English, you cant be a good English essay writer. if you don'T know java (or another coding language) you cant write good code"
i had never looked at it that way before i saw the video, and i use to always want to skip java because in my mind. i was thinking "i don't want to learn java, i want to learn forge" but now i kinda understand why learning java is so important first.
watching the video also teaches good coding habits i have better foundation as a future coder because of good habits that im setting for myself
1
For that, you should make your own WorldProvider or BiomeDecorator or whatever. I don't think events will be enough to cancel biomes.
You can cancel some world gen -- look at DecorateBiomeEvent.Decorate.EventType to see what is cancelable. That includes grass, flowers, etc. but not biomes. Also it will be nearly impossible to cancel structures added by other mods because they rarely use events.
1
This is most likely the culprit (in getBlockInSlot) :
Wherever getBlockInSlot is called from, you may have forgotten to check for null before using the return. On line 59, to be exact.
Honestly, why complicate things? Use the getStackInSlot to get an ItemStack. Use the ItemStack to get an item. Use the item to get the block with Block.getBlockByItem(Item in). Then check if there is no block associated with that item and make sure not to continue unless you have an actual block.
Where is getBlockInSlot called from? Also show us getSizeInventory.
1
I get that "skipping X ticks" message a lot when I am loading new chunks or entering a new dimension in my testing environment. Users will not see it unless they have a console, like when using the FTB launcher.
Are you sure it's the entity causing the lag? Like if you kill the entity, does the game immediately speed up again? Does summoning / spawning it immediately cause the game to slow down?
1
Move the this.setCustomNameTag(name); to the constructor, before setting alwaysRenderNameTag to true.
2
It is true that many of the Forge methods he calls have been renamed or slightly changed, but he purposely does not share copy-paste-able code. The "comments" are in the form of the descriptions before and after example code, and he adds a lot of random unusual things in case someone out there has a question about that specific thing.
I suggested Jabelar's tutorial because this person said they had no experience with entity coding.
I would recommend that you look for tutorials for 1.8 and 1.8.9. If you want examples, see my GitHub for Extra Golems. The entity classes seem very complicated at first, but it may be helpful to see how I register the renders in my ClientProxy, as that has changed from 1.7.10 to 1.8+
1
Change the part inside onItemRightClick to an if-else statement like so:
1
This is correct. For some reason, the entity attribute of attack damage is not initialized for most classes. It is recommended to override attackEntityAsMob to actually apply damage instead of relying on the attribute system.
1
Yep, like coolAlias said.
Then to add a custom description, override addInformation in your Item class.
See this GitHub for an example of an item that adds a custom description. This specific one supports language translation, but you do not have to do that right away.
1
Adding a dimension is very involved.
You will need:
- biomes
- world provider
- chunk provider
- gen layer
- gen layer provider
- world chunk manager
- teleporter
I followed techgeek1019's video tutorial when I made my first dimension for 1.7.10.
There are other tutorials to guide you through it, but mainly you should take it step by step.
If it helps to look at example code, here is a link to my 1.7.10 Dinosaur Dimensions GitHub. It's not the best; I took a few shortcuts and don't even use the BiomeDecorator I made because it kept crashing. The only dimension I've done in another version is an empty, void dimension here: Nomadic Tents GitHub. It may help to cross-reference the two to see what is essential and what is not.
The part that kept crashing the most until I figured it out was getInts in GenLayerBiomes.
1
Have you overriden getContainerItem and hasContainerItem in your propane tank item class? That might help -- it won't solve your problem automatically, but it's the only step I'm familiar with...