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
Are you certain the ItemStack[] is empty? I mean, maybe the server knows the items but the client doesn't, and the client is the one with the GUI. Add some printouts to be sure.
1
First, properly learn Java. "Hacking" MCreator to do this will only result in horrible, messy, disastrous code.
Second, always state which version of Minecraft you are modding for. In 1.7.10 and 1.8.x, use IEntityExtendedProperties to save a value to a specific player. In 1.9 and beyond, use the Capabilities system. You do not have to give the player an item to use these systems, so don't worry about that.
Third, post code on Pastebin or Gist and link to it here instead of posting directly on the forums. Make sure it has proper formatting and the .java extension for proper syntax highlighting.
Fourth, learn how to work with Forge before you try this. You will just get confused if you dive into modding too fast. Once you know Java, practice by making basic blocks, items, event handlers, etc. until you know how to navigate the IDE to find what you need.
1
Um...
Well...
I'm pretty sure there is...
open the MovingObjectPosition class and search for anything that returns an EnumFacing. Or any variable that is of type EnumFacing.
objectMouseOver is a MovingObjectPosition, correct?
1
ModelLoader.setCustomModelResourceLocation should be called from preInit, not init.
1
Exactly like you would check any equality:
Or, since you want any horizontal to work:
1
First off, if you insist on using the Minecraft class (mc) put everything inside a statement if(world.isRemote) or something similar. You should be able to access the working world object without the Minecraft class, or it kind of defeats the purpose.
Second, I think the objectMouseOver is a RayTrace or MovingObjectPosition object, correct? Just check that objectMouseOver.sideHit is equal to EnumFacing.WEST
To have your code run if it is any horizontal side, make sure it is not equal to EnumFacing.UP or EnumFacing.DOWN.
Or, check that EnumFacing.HORIZONTAL contains the sideHit.
1
Block#onActivated is what you are thinking of
1
Add the "particle" tag with your texture
1
I have a tutorial on Complex Structure Generation that may be useful depending on the size of your structure. It requires an array of "relative" locations that are passed into a helper method -- that helper method makes each BlockPos for you.
Either way, you will end up creating a lot of temporary BlockPos instances... there's not really a way to avoid that, so don't worry too much.
Each chunk can only handle around 1000 block updates per second, so if you set more than a hundred blocks you should consider using a Timer. That is, generate segments of your structure every few hundred milliseconds, which gives the game time to update the client.
1
I think you can use player.boundingBox . If it complains about "not visible" then boundingBox is not public, but I think it will work.