Eclipse Tips and Tricks

In this page I will list useful things to know about Eclipse and shortcuts you can use to make modding/programming in general that much easier.

When looking through the Minecraft code, if you want to see what functions a class has Ctrl + click the class name and it will take you to the class where you can browse the functions. If you are typing out a ‘class.function.function.function’ and aren’t quite sure of what the function is called, once you have typed ‘class.’  the list of functions within that class will appear in a box. From this you can search for a function you want, or slowly type and narrow the list down. Once the one you want is selected just press tab of click it. When the functions are listed in the auto-complete box they will show there return type at the end, use this to narrow down your search even further.



Ctrl + Shift + O – organises imports, sometimes you may need to import things manually if there are two classes named the same (e.g. Mincraft.Items ,  MyMod.Items) this can confuse Eclipse.

Ctrl + Shift + Numpad_Divide – this collapses all functions, this is very useful when browsing a class to find a function you are looking for because you only see the function name and parameters.

Ctrl + Shift + F – this will auto format your code, this has obvious usefulness in the fact if you have been coding for a while and it looks a bit messy, it will sort it out. You can customise your format preferences in the Eclipse options, this will allow you to change what auto format will do to your code.

Leave a Reply