-
Posts
274 -
Joined
-
Days Won
5
Everything posted by imacatlolol
-
[1.15.2] Replace water in nether with lava
imacatlolol replied to RobinCirex's topic in Modder Support
I think you can do the same for the Nether's dimension type; override it in the registry. Not sure if it's great for cross-mod compatibility, but it should be a little cleaner. -
1.14.4 - Create Two blocks with only a different face texture
imacatlolol replied to Maschiaccio72's topic in Modder Support
Just register two separate instances of the same class and use different registry names. Vanilla does this a lot, check the Blocks class. -
This is probably a stupid and basic question, but I haven't been able to find an answer on my own. In my own non-forge projects my shutdown hooks (via Runtime#addShutdownHook) are skipped when hitting the stop button in my IDE (IntelliJ IDEA). I have to hit the exit button instead, which is comparatively out of the way. But, when working with Forge, the shutdown hooks (particularly for the dedicated server) will still run when hitting the stop button. I'm not sure if it's Forge's doing or vanilla, but I'm assuming it's Forge. What kind of configuration or thread-based magic is at work here? I'm stupid, it's dependent on running it in debug mode vs normally... I should test things before posting, sorry.
-
I'm afraid you'll need to give us code to even begin to diagnose the problem.
-
If you want to add/change HUD elements, subscribe to RenderGameOverlayEvent and render things there. If you want to change an existing GUI, one of the events in GuiScreenEvent should be enough.
-
What version are you using?
-
GuiMainMenu is not a thing in modern Minecraft, and the version you're using is no longer supported. You need to update to 1.14/1.15.
-
It wants an array of ResourceLocations, so just give it that. If you don't know what a ResourceLocation is, read the docs.
-
1.15 change voxel based on facing(direction)
imacatlolol replied to blinky000's topic in Modder Support
See how the bed does it. Create a shape for every direction and check the facing in getShape. -
@Cadiboo has been making amazing progress on re-implementing default config GUIs, but they're currently not available. Also, they're being targeted for a 1.15.x release and it may take time to be backported to 1.14.4. However! You are able to create your own GUI if you're willing to put in the work. You can see an example of this here.
-
Breakpoints work by freezing the program and allowing you to step through your code one line at a time to see where things fail. This will let you check if your conditions are passing or not. You should learn how debugging works before going further, it will make things much easier for you. Simply google how to debug with your IDE to find a good tutorial.
-
How do you make a item stay in the crafting grid?
imacatlolol replied to gameing's topic in Modder Support
That's what the containerItem thing I mentioned is for. It leaves an item in the crafting table after being crafted, which is what they seem to want. It's also used for other things, like potion bottles and water buckets. -
How do you make a item stay in the crafting grid?
imacatlolol replied to gameing's topic in Modder Support
Use the containerItem method in your item's properties. -
[1.15.2] How do i make an entity change it´s collision-box-size
imacatlolol replied to Drachenbauer's topic in Modder Support
Override Entity#getSize -
I created a set of custom potions and they automatically worked with vanilla items (potion bottles and tipped arrows) as intended. However, the items' translation keys that involve my custom potion effects do not use the namespace of my mod. It makes sense as it's still a vanilla item, but it opens the door to potential conflicts. One solution would be to simply use my mod id in my registry names, but that feel pretty sloppy. Any good workarounds, or should I just ignore it for now?
-
Have you actually checked with your debugger to see if it's really failing the check, or even getting that far in the first place? At this point you might just need to clean up your code, I'm having trouble reading it. You should be doing instanceof checks instead of class equals checks, the == true parts are unnecessary, and your last if statement is redundant.
-
[1.15.2] How to get more Blocks an the same time?
imacatlolol replied to DragonITA's topic in Modder Support
You're using super.onBlockDestroyed incorrectly, that's not how you break blocks. See how PlayerInteractionManager#tryHarvestBlock does it to make sure you do all of the necessary checks when breaking blocks, and how to actually break the blocks properly. (And no, don't actually called tryHarvestBlock, just use it as a reference.) -
Oh, didn't even know that existed, thanks for the correction!
-
[SOLVED] [1.15.2] Unable to launch example mod in eclipse
imacatlolol replied to elzaidir's topic in Modder Support
It's using Java 13 instead of the Java 8 installation you want it to. I don't use Eclipse, but this should tell you what to do to change it to Java 8. -
Decocraft won't work on 1.15.2, it currently only supports up to 1.12.2. You'll have to wait for it to update, or find an alternative mod that is updated for the version you want to play on.
- 1 reply
-
- 1
-
Yes, but you need to filter first in order to guarantee that you find what you need.
-
I'm not a Java expert myself so I'm sure someone else could give a better answer, but there's a few resources I know of. W3Schools' tutorials are pretty good, and they have good examples. Their section on Classes and Object Oriented Programming in general may be particularly useful. Oracle's official documentations have a pretty bare-bones tutorial, if that works for you. If you're a visual learner, there are also many YouTube tutorials that may help explain some confusing aspects of java using examples, too many to list here. And of course, when in doubt, Google can be your best friend when something is confusing. It's no secret that even veteran programmers regularly use Google to make sure they're doing something correctly. I personally learned Java by just looking up random resources to find what worked for me, then I just trial-and-errored my way here. I've gotten pretty good, but it's very easy to fall into bad habits. It's always a good idea to look at other people's code to see how to improve.
-
Uh, okay...
-
Instantiate it during registration just like you do with the normal Item class. Basically call new ItemEffect() instead of new Item() when registering your items. Side note: I would encourage you to learn Java outside of Minecraft modding, as learning Java in this sort of environment can be difficult.