Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

HappyKiller1O1

Members
  • Joined

  • Last visited

Everything posted by HappyKiller1O1

  1. I actually already created something like that. I took your last post as I should not be using the onCreated method and instead, make a separate one to handle it.
  2. Hm, how would I go about wrapping access to it? Again, still a bit of a learner when it comes to NBT.
  3. So, I think I've figured out my problem and, this seems to be an error with forge. When I shift click an item out of the crafting result slot, it runs the on created two times on both client and server. But, when just grabbing it out, it creates it once. I'm not sure if this is fixed in later forge versions but, it should be fixed ASAP considering this will be a big damper to my mod that requires the setting of an NBTTagCompound with onCreated.
  4. This is by far, the weirdest error I have ever seen. I was creating a hammer called "CrewHammer" (That's what the item class was called) and, the onCreated method in that class was getting called twice. So, I deleted that class to see if I accidentally used it to define another Item and, this happened: Each path for an error was met with another path by eclipse to the folder on my computer. This glitch seems to be duplicating the item making it impossible to set NBT. The duplicate path says "org.eclipse.jdt.core.external.folders/[my file path to the class with the error]". Has anyone gotten this error before and knows how to go about fixing it?
  5. Ok this is really weird, so I deleted the class to see what errors it gives me and, it should only give three considering the class is only used in three places and, it gave me six. It seems like eclipse is duplicating the paths somehow: Basically it says "org.eclipse.jdt.core.external.folders/src/main/java/com/happykiller/crewmod" which is my main directory... How is this possible??
  6. After updating to 1388, it still seems to run twice. I can try it with another Item to see if it's an error with forge?
  7. KeyHandlers are ALWAYS client side. I think you'd need to send an update packet to the server to update the damage then, update the client. The reason it goes to 35 like it never edited it is because the client is the only object that is changed rather than the variables on the server. Erino would be able to tell you more about how to fix it because he helped me with close to the same problem.
  8. I think my hammer might work a bit differently than yours.
  9. I'm pretty sure you're only updating the display damage (client side) when you need to update the actual damage (server side)
  10. Sorry about that! Didn't realize it needed that to work. Glad you figured it out!
  11. No problem! Just remember, when creating code - think like the code is a person you are talking to.
  12. May I ask why exactly you would want the player to block his sword when at level 100? Just curious.
  13. Derp! That worked, thanks!
  14. This is what I put there: version = "1.7.10-10.13.3.1388"
  15. Ok so, I am trying to update my forge version from 10.13.2.1291 to 10.13.3.1388 but, I keep getting an error that directs me to line 25 in the build.gradle file. It says it is an invalid forge version yet it isn't. Can someone help me?
  16. Just redo your setup with a video from MrCrayFish or something of the sort. If you give up you shouldn't of started at all.
  17. Draco is right, I didn't even notice it but, you have to set your item equal to the class for the item or anything in that class won't be called. You can't just make a class for an item and not initialize your item variable with it.
  18. I'm trying to override it now. I will update my workspace. I know it sets the NBT Compound but I can't retrieve it correctly... in 1.8, you can retrieve the compound that was set from the onBlockDestroyed?
  19. Ok, seriously you need to learn how to program Minecraft mods. Why do you initialize your item in your item class? You have to initialize it under the preInit in your main mod file. Please watch some Minecraft Modding tutorials before posting problems like this.
  20. I tested it completely and it worked just fine. Please post your crafting class, where you initialize your item and, the IronFile class. I will look through it and see what you did wrong. Never give up when a problem arises; if you do, why are you programming? Life is full of problems that need to be solved in order to move on.
  21. No no no no. Remove the ".setContainerItem(iFile)" from your initiation of the Item. Then, the the IronFile item class, put what I showed above to set the container item. After that, registered your shapeless crafting recipe like this: GameRegistry.addShapelessRecipe(new ItemStack(IronRod.iRod, 4), new ItemStack(IronPlate.iPlate, 1), new ItemStack(IronFile.iFile, 1)); This is not meant to be a Java school. I do not like taking people step by step on how to fix their problem so, I encourage you to look harder at your problems and try to fix them yourself.
  22. Just remove the third param in the IronFile Itemstack you created. There is no need to set the metadata to that.
  23. So, I just tested this and it worked. Put this in your item: //Makes it so the item stays in the crafting grid public boolean doesContainerItemLeaveCraftingGrid(ItemStack stack) { return false; } //Tells the game your item has a container item public boolean hasContainerItem() { return true; } //Sets teh container item public ItemStack getContainerItem(ItemStack itemStack) { itemStack.attemptDamageItem(1, itemRand); return itemStack; } I registered my crafting recipe like so: GameRegistry.addRecipe(new ItemStack(Items.stick, 1), "C ", "S ", "S ", 'C', CrewMod.crewHammer, 'S', Items.stick); It should work with shapeless recipes also. EDIT: There is no need for you to use the WILDCARDVALUE param in the IronFile recipe you registered. Make sure to remove that.
  24. Oh I didn't see your recipe under it, my mistake! Why are you using OreDictionary.WILD_CARD_VALUE?
  25. You do know, you are trying to return your IronFile as a result of the crafting, correct? getContainerItem only refers to the item if it is being used to craft the item. I believe ScratchForFun made a battery video that easily made the crafting result be damaged if that is what you want to do.

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.