-
Posts
884 -
Joined
-
Last visited
-
Days Won
9
Everything posted by Jay Avery
-
Okay. It was just a suggestion, because I can't see anything else wrong now.
-
I think the problem may be that your resources folder is inside a main folder. It should be directly inside src, like this (with jjmod replaced with your modid):
-
Need help with making block drop item! (1.10)
Jay Avery replied to SorestPegasus's topic in Modder Support
Post your whole Block and Reference classes. -
It's now searching in the place you said you put your json, but apparently can't find it. Can you post a screenshot of your whole source file structure?
-
That's not a full console log - can you post the whole thing?
-
What exactly do you mean by textured dark grey? Is your texture by any chance a dark grey image?
-
You shouldn't use the unlocalized name for this, instead use the registry name: ModelResourceLocation(item.getRegistryName(), "inventory")
-
And the console log?
-
Post the console log and your updated code.
-
Yes, that should work.
-
You can use a spoiler (eye icon) to post blocks of code in collapsible sections.
-
This is the file the game is searching for. You need to make your Item's registry name match the file name of your json.
-
Renders a TE with a moving case (like chests)
Jay Avery replied to TheJavaNoob's topic in Modder Support
Show your code. -
Your ClientProxy#init needs to call super, otherwise it doesn't do anything in the CommonProxy#init.
-
What? Your mod attaches capabilities, but if your mod capability isn't already there then your mod doesn't run...? Post your code to explain what is happening.
-
If you understand java, you should know how to initialise an array: https://docs.oracle.com/javase/tutorial/java/nutsandbolts/arrays.html
-
https://docs.oracle.com/javase/tutorial/
-
The point here is that the problems you are struggling with demonstrate a lack of understanding of basic java. The help you need has nothing to do with the complexities of minecraft and forge code, it only has to do with the basic syntax and function of java code. Failing to initialise a final variable is invalid java Writing a for loop outside of a method is invalid java Trying to access a null variable is invalid java None of these problems are to do with minecraft. You need to be able to understand basic java issues like this before there is any point in you getting help from a forge forum.
-
The 0 doesn't matter, you are trying to access something which you have set to null. To fix that, don't set it to null. Instead set it to something that you want to use, for example an actual array.
-
Cant figure out how to pass Entity targetPos to task AIGoto
Jay Avery replied to clowcadia's topic in Modder Support
So you remove the item from the entity's inventory, target it to a new position, give it back to the entity, and the entity doesn't change it's target? -
private static final KeyBinding[] KeyBindings = null;{ KeyBindings[0] = new KeyBinding("Player Finder", Keyboard.KEY_NUMPAD1, "Frostwave"); You set your KeyBindings array to null, and then try to access the 0 index. But it doesn't have a 0 index, because it's not an array at all, it's null. It is easy to find the source of the problem by looking at your crash report: java.lang.NullPointerException at io.github.TooVeryIcey.Frostwave.Utils.KeyHandler.<init>(KeyHandler.java:19) ~[bin/:?] It's a NullPointerException - something is null where it shouldn't be - at line 19 of the KeyHandler class.
-
Cant figure out how to pass Entity targetPos to task AIGoto
Jay Avery replied to clowcadia's topic in Modder Support
Be more specific: are you unable to use the item a second time? Does it not save the co-ordinates a second time? Does the entity's AI target not change when the item is changed? -
I can't see any obvious reason for it. I'd probably start by throwing printlns all over the place in the capability construction and attachment, to see whether it's actually being made and attached in the first place.
-
If the isAiming() method causes an NPE, that means it's being called on a null object - so the capability must be null there. I'm not sure why that would be though. Try adding a check with hasCapability, so the method is only called if the capability is definitely present. Does the exception happen as soon as you start a world? Possibly the first player tick happens before capabilities are attached (I'm not sure), so it may just need to skip the first tick or few until the capability is present. If the capability is still null once the world is properly started, there must be some other issue with it.
-
Which line is the NPE on? It can't be the isAiming field that's null (a primitive type can't be null no matter what), but it might be the capability itself or something else. Are you attaching the capability to the player with AttachCapabilitiesEvent<Entity>?