Here are some common tips for debugging Minecraft/Java
Check capitalization. Make sure your variable names are consistent in their capitalization. For example, mySword.
There is an exception to this in Minecraft modding. Unlocalized names must be lowercase. Unlocalized names are always strings(in quotes): "my_sword", "my_ore", or "zombie_chicken".
Check Spelling. Make sure your spelling is right. Many errors are caused by minor typos. If your code isn't working as intended, make sure you don't have a typo. Especially important in JSON files like recipes. "mincraft:diamond_sword" is not the same as "minecraft:diamond_sword".
Check your imports. After you use a quick fix to import something, if you still get an error, you probably imported the wrong thing. Whenever you have to import something into your Java files, try to prioritize importing from net.minecraft. For most of the objects you need to reference, they are from Minecraft. The one exception being Color. That should be imported from java.awt.color.
Comments
0 comments
Please sign in to leave a comment.