May 24, 2012 at 3:07 pm #1705TriggerHappyNDBMember
Quick question for you code jockeys out there:
Have any of you taken a stab at modding for Minecraft, and do you know how difficult it is to add new features?
I realize this is a very vague question, but I’ve been coding on and off for a few years now and would like to take a stab at developing a Minecraft mod of my very own to test some ideas I’ve had. I know how to add new blocks and change their properties and other simple things like that, but what I don’t know is how hard it is to add new “features”, like causing a right-click on a particular object to trigger special behavior in that object.
If anyone can tell me whether or not it’s possible to do this without extensive knowledge of Java, I’d appreciate it–it may save me a lot of headache to know that I probably can’t finish what I start if that is indeed the case.May 24, 2012 at 4:50 pm #1706NefyoniModerator
coderj has a blog thingyMay 24, 2012 at 6:31 pm #1707Coder JMember
For the server, adding click-on actions is pretty easy (intercept onClick or onInteract events, don’t have the API in front of me). Adding blocks is more problematic as that requires client modification as well as a server plugin (most servers don’t like doing that, as you now depend on the user installing the mod correctly and everything being updated pretty promptly or you get left behind the version curve).
Great example of plugins that work with interaction of blocks are WorldGuard (checks to see if a player has permission to interact with a block in an area, cancels the action if not), DeadBolt (using signs, checks to see if the player has permission to interact with objects, if not cancels the action), and Stargate (sign is clickable to scroll through destinations, button used to only activate the gate but can now be connected to redstone to do other things…. still no redstone activation of the gate, though 🙁 ).
I’m slowly updating my blog @ http://bukkit.coder-j.net/blog with how to write Bukkit plugins; one more on permissions, then I’m moving on to basic object interaction.May 24, 2012 at 10:00 pm #1713TriggerHappyNDBMember
I’m shocked and appalled that I forgot about your blog before posting this Coder. That has (or will have) a lot of the answers I’m looking for. Sorry about that.
I guess that makes sense about needing client-side modification for additional blocks–the server can’t mandate what blocks do and don’t exist for a user’s local files. Kind of a bummer, but I didn’t really consider this something that would be deployed on the (or any SMP) server anyway. I don’t give my ideas enough credit to think other people will actually find them useful or interesting lol. I think my main goal is to provide a proof of concept while building some practical skills in Java and general coding.
Either way, thanks for the tips. I’ll be watching your blog for some more ideas and tutorials!May 24, 2012 at 10:39 pm #1716Coder JMember
Well… there are exceptions to the rules (at least, regarding new blocks/entities); with Bukkit it is possible to ‘cheat’ and treat some blocks as different (or combinations of blocks), which has been made easier since we can now attach metadata to blocks and entities (I’m still playing around with this). Spout, which can use Bukkit plugins, has it’s own client wrapper which allows for new blocks and textures without a lot of client-side mucking about…. but it’s still a pain since you have to make sure players use the Spoutcraft client (still seems to have a lot of issues, or at least to me).
- You must be logged in to reply to this topic.