-
Posts
1283 -
Joined
-
Last visited
-
Days Won
2
Everything posted by jeffryfisher
-
MC Crashes when I join a server / world with my mod (1.8.9)
jeffryfisher replied to ConorTheDev's topic in Modder Support
You can't have that on the server. I think you need to hide your method implementation in your client proxy. -
[HELP] how to connect between two players?
jeffryfisher replied to ohadguetta's topic in Modder Support
Look at how chat handles whispering, and then do something similar. -
NoClassDefFoundError accessing Forge classes
jeffryfisher replied to Redempt's topic in Modder Support
"Client" suggests that this class does not exist on the server. Since you pulled the error out of its context, I'll assume your error was generated on the server until you show otherwise. -
When you get an error report like that, read up from the bottom to the lower-most "caused-by". Then read down until you see one of your own methods, usually the site of the bad programming. Click on the line number to jump into your code. If it's not obvious what's null there, then set a breakpoint or two (work your way up the call stack) and rerun in the debugger, stepping one line at a time (and into each call in the erroneous stack) and examining the values involved.
-
First, a general bit of advice: Do a dirt-simple "my first mod" to climb the Forge setup and mod-structure learning curve. Perhaps introduce your "moon stone". An experienced programmer should be able to come up to full speed in about two weeks working half-time. Having been through the gauntlet once, you'll then be ready to plan and research something with more "meat". Second: Use your IDE to jump into some of the vanilla classes to see how they do what they do. When contemplating a mod, look for a vanilla game element that does something similar. Quite often you can even subclass a vanilla class so it does much of the heavy lifting for you, freeing you to focus on what makes your game element special. Math Zombie: Sounds deadly, especially for newly-spawned players who have enough trouble against vanilla zombies. I would spawn them only in a special location (or near a special block), and I would invent a math sword that opens a text box when right-clicked into air. The answer could then be typed and subsequently beaten into the zombie's head. To simplify things, all of your math zombies could display the same problem until somebody answers it. Magpies: Stealing from player inventory sounds vicious. I'm not sure that's a good idea unless the "magpie" stays in the area (and stays away from lava). Otherwise the game could become too unpleasant to play (I would not want to return to a world where I can never keep my hard-earned diamonds). For magpie model and starting behavior, see bats. Detector: See discussions on "x-ray mods" for how OP they can be. YMMV. Just be sure your mod relies on server consent. Client-only mods that peek at supposedly hidden blocks can get you banned from most servers. Monster warning: Sting glowed when orcs were near, so it would be reasonable for your sword to glow for one monster, and no monster type needs detection more than the creeper (if you want to know why, then just sneak up behind one of your kids during a Minecraft session and make a soft hiss...). I recommend designing an enchantment that detects creepers, with higher level enchants detecting at greater range. Then invent your moonstone sword and make it enchantable by that enchantment in addition to other sword enchants. Teleporter: See command blocks (which can be activated by pressure plates). Fireballs: See Fire charges. Lembas: Hunger became trivial a few versions ago. Food now lasts so long that one stack of cooked chicken might last longer than a player would want to play in a world. Your mod would need to dial-up hunger to 1.6.4 levels to make Lembas meaningful. Trident: Sounds OP, but you could make a meteor-metal trident "sword" and then create enchants for it to do what potions and helm enchants do now. Thor's Hammer (aka Mjolnir): I'm not sure how to use the hammer to aim the lightning, but I know you can find the weather in the world class so see how a lightning bolt entity is spawned. Emojis: Little bang for the effort. I recommend typing them the old-fashioned way with punctuation marks. Flyable bats? You mean ridable, like giant eagles? Also consider: Wargs ("horses" shaped like large wolves), palantir (very advanced), Sauron boss, mythril... Before starting, you might also search at CurseForge to see what mods are already out there waiting to be downloaded. Good luck!
-
[1.12.2]Custom armor item not taking damage
jeffryfisher replied to GiantNuker's topic in Modder Support
Then I give up. Until you can describe an experience in the debugger, I can't help you (and I'm traveling for the next week, so I won't be able to check again for a while). Good luck! -
[1.12.2]Custom armor item not taking damage
jeffryfisher replied to GiantNuker's topic in Modder Support
Tell us about your experience in the debugger. Which methods did you step through? Did you set a breakpoint inside the method that calculates and applies damage to armor? What happened? -
[1.12.2]Custom armor item not taking damage
jeffryfisher replied to GiantNuker's topic in Modder Support
Set breakpoints and run/step some damage cases in the debugger. Tell us what you learn. -
[SOLVED][1.8] With built JAR, it crashes with NoClassDefFoundError
jeffryfisher replied to jabelar's topic in Modder Support
Thanks for the clarification; I hadn't paid attention to different kinds of names being treated differently. -
[SOLVED][1.8] With built JAR, it crashes with NoClassDefFoundError
jeffryfisher replied to jabelar's topic in Modder Support
Most modders who raise NoClassDefFoundError when going from Eclipse to jar have made a different (and simple) mistake: They used Eclipse's export command to build their jars (Jabelar is an experienced modder who did use gradlew build, so that wasn't the problem this time). Without gradle, a mod that works in Eclipse will turn into a jar that fails in a mod folder. This is because Eclipse's export does not reobfuscate class names (or not correctly). The pretty class names we use in the editor will not be found in production-released Minecraft, hence the NoClassDefFoundError <-- EDIT: Oops, method not found errors, my bad. Therefore, most modders finding this thread need to learn this: Modders must use gradle to make their jars so that the reobfuscation is done correctly. -
[SOLVED][1.11.2] Ore generation per biome
jeffryfisher replied to Mikerman50's topic in Modder Support
Sorry, I've been doing this so long that I forgot how special words like "step" might have no meaning to someone who has never used a debugger before. "Step" implies setting and triggering a breakpoint, and then using the debugger's step controls to execute one line or method call at a time. You can step into or over each line of the program, and at each line, you can examine all of the currently set fields and local variables. This forum teaches Minecraft and Forge. It is not a Java help desk, never mind being an intro to programming class. If I understand that correctly, it means that you should know how to use the essential tools of programming, which include the debugger, hence my signature. There's lots online about Eclipse. You should be able to find several video tutorials on how to use the debugger. Fire up your own Eclipse, play an Eclipse tutorial video, and follow along. -
[SOLVED][1.11.2] Ore generation per biome
jeffryfisher replied to Mikerman50's topic in Modder Support
Next time you get inexplicable run-time behavior, step through your code at least once in the debugger before running for help. You'd see something like a test that's always true before posting it. You really don't want to admit that around here (see the warnings on the forum and in mods' signatures). Find someone near you to help with programming and Eclipse (or other IDE) expertise so that the problems you bring here will be specific to the idiosyncrasies of Minecraft and Forge. -
[1.12] AnvilRepairEvent: Keep item in left slot
jeffryfisher replied to IceMetalPunk's topic in Modder Support
The best I can come up with is to somehow attach a hopper to the side (input2) of the anvil and preferentially drop the token on that hopper if it's there. However, that may be even worse than the tick handler hack. Hmmm... I wonder how much work it will be to rig an anvil for hopper connections (probably need to invent a custom anvil). Then you could input a hopper full of tokens plus a chest full of gold swords to be uncrafted into chests full of gold ingots -
[1.12] AnvilRepairEvent: Keep item in left slot
jeffryfisher replied to IceMetalPunk's topic in Modder Support
Aha, very good. My memory is almost a year rusty. How would your game play work if you got rid of the hacky tick handler and simply dropped the input item as an item entity? Or, what if you returned the item to player inventory, possibly the player's off-hand if empty? -
[1.12] AnvilRepairEvent: Keep item in left slot
jeffryfisher replied to IceMetalPunk's topic in Modder Support
IIRC, anvil repair is called when something is changed in an input slot. There's another call stack when the anvil's output is removed from the output slot. I suggest that you explore the anvil code to find what method handles removal. Set a breakpoint and step through. You might not be able to modify what stack(s) are left in the input slots, but you might be able to save enough data in one part of the process that you can drop an extra item that you want preserved. -
[1.10.2] [UNSOLVABLE] Make the player light like a torch?
jeffryfisher replied to Differentiation's topic in Modder Support
Unfortunately, the torch gives light as a block, whereas (in programming terms) a player is an entity + itemstacks in various inventory slots. That's why the proposed solutions involve unseen blocks. That reminds me, my own to-do list includes a helmet with a miner's lamp on it (or I might do a helm enchantment). -
(SOLVED) [1.11.2] player.getHeldItem(hand) always returning Air
jeffryfisher replied to saxon564's topic in Modder Support
Did you step through each in the debugger? Get in there and watch how the value gets assigned (or left with air as a default because it's not being assigned). -
Issues with trying to modify vanilla classes
jeffryfisher replied to powns's topic in Modder Support
1) Step through your code in the debugger and tell us what you learn. Remember that in your console, you can click on the line number of an exception to be taken to the line that cracked. It's often useful to set a breakpoint just upstream. 2) Post the log file so we can see the full exception, "caused by", stack etc -
Read the trinary expression again VERY carefully so you understand the RESULT of each logical subexpression. If that doesn't give you an aha moment, then run it in the debugger so you can step it. If necessary, write your own nested if-then-else statements to break it down to where you can grasp it.
-
Your ClientProxy class is not related to anything. This suggests that you're not just new to Java, but you're new to object-oriented programming. First, you need to go find tutorials on O-O programming and Java before this forum can help you. Second, you need to build a cache of bookmarks to useful Java references / forums. Learn to go to those for fundamental Java questions before coming here with more advanced questions peculiar to Forge hooks, mod structure etc. PS: Another good way to learn is to explore the Minecraft source code itself. When planning a mod, try to see how vanilla Minecraft does things before asking. And if you don't know how to use Eclipse to do that, then there is an Eclipse site out there to help you learn that tool of the trade.
-
[1.10.2] NullPointerExeption when using onItemRightClick
jeffryfisher replied to Geometrically's topic in Modder Support
In general, when you have one of these errors, you may click on the java line number to open up the code and highlight the statement so you can see what thing(s) might be null. If it's not obvious, then you can set a breakpoint and run to that line in the debugger so you can examine everything for what's null.