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.

Jedispencer21

Forge Modder
  • Joined

  • Last visited

Everything posted by Jedispencer21

  1. When an Item is enchanted in your inventory, hotbar and such, it has the enchantment glint on it, but when I attempt to render the glint onto the item in the hud, I cannot get it to render. This is what is showing ATM: This is my rendering code:
  2. In your readFromNBT method you put: byte b0 = nbt1.getByte("slot") and in your writeToNBT method you wrote: nbt1.setByte("Slot", (byte) i) Which this in java is two separate strings, so when it reads it from the NBT its trying to find the byte with the name "slot" instead of "Slot"
  3. I Fixed it, instead of passing an Item in my renderItemTexture I pass an ItemStack and I just use stack.getItem() to return the stacks item
  4. So I am creating a HUD that shows your current equipped item/armor and I have it showing the durability on the hud, but it doesn't display properly. Here is what it is doing: This is the code for rendering the hud: This is my string code that should display the proper durability:
  5. Instead of using event.state.getBlock().getUnlocalizedName().equals("tile.oreIron"), why don't you just do, event.state.getBlock() == Blocks.iron_ore
  6. Have you tried using the Item method, Item.getItemFromBlock(BLOCKNAME)
  7. How to create the package.info file?
  8. Could you show some of you code
  9. Show what you have tried, and have you tried using ItemStack#damageItem
  10. Just a recommendation for tiffit, instead of create a new line of code for Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register you should create two methods, one for items and one for blocks. It may look something like: public void registerItemRender(Item item, String location) { Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0 -- if it has not metadata, new ModelResourceLocation(MODID + ":" + location, "inventory"); } public void registerBlockRender(Block block, String location) { Item item = Item.getItemFromBlock(block); Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0 -- if it has not metadata, new ModelResourceLocation(MODID + ":" + location, "inventory"); } If these aren't correct ways then you could try something else, thats a way I do it since using MODID + ":" + item.getUnlocalizedName().substring(5) is wrong. Also is your file structure like this: src main java resources assets modid blockstates name_of_block.json lang models block name_of_block.json item name_of_item.json textures blocks name of block texture in blockstate .png items name of item texture in item .png Long structure but that's how its set-up usually.
  11. I use it for basically the same reason and I have never been told its wrong to use it that way because all of the tutorials that I find/watch use it that way.
  12. So if I should use "item.getUnlocalizedName().substring(5)" to get the unlocalized name, then what should I do? Just type in the name myself?
  13. All right I'll try that out tomorrow cause its getting late here.
  14. Yes, its just for the inventory model that I don't need, cause if you check, vanilla doesn't have an inventory model for fire
  15. So I tried putting the onBlockClicked after the extinguishFire, but it still doesn't work. Also in my console I have "Model defenition for location modid:block_fire#inventory not found, how do I get rid of this?
  16. So what I am trying to do is to get my custom fire block to break like the vanilla one, so far I have it working in survival mode, but it still breaks the block that the fire is on in creative mode. This is my current working code:
  17. So I have figured it, in order to fix this you must create your own SlotCrafting and edit the onPickupFromSlot method. You can copy the entire method from vanilla but you have to change this one line of code: ItemStack[] aitemstack = CraftingManager.getInstance().func_180303_b(this.craftMatrix, player.worldObj) Change the CraftingManager.getInstance() to YourCraftingManager.getInstance()
  18. Most of my code is from the Vanilla Crafting Table so I would assume most of it except for the parts I changed for my crafting table would be the same because I'm sure I use the func_180303_b, would I require to create my own SlotCrafting for it to work?
  19. So the title should say most of it but basically I am updating my mod from 1.7.10 to 1.8 and I have ran into a problem that I didn't have in 1.7.10. When I craft an Item in the table, it doesn't remove the Items from the craftMatrix allowing infinite items to be made. Here is the container code: Block code: Crafting Manager: Shaped Recipes: Shapeless Recipes
  20. Ya, that was the problem. I was thinking that but I never thought to try because in my 1.7.10 version of my mod I initialized my items before my blocks and it worked fine.
  21. So I am trying to update my mod to 1.8 and I am stuck on getting my crop to work. Every time I try to right click on farmland/any other block with my custom seeds, it crashes my game. This is the crash report: This is my items: BlockTomato class: Render and Register class:
  22. So I am new to packets and extended properties and I was wondering if anyone could help me with them. As far as I know, it works... kinda? but the GUI doesn't open when I click my button. Here is my abstract packet class: Here is my packet handler: Here is my class that extends IExtendedEntityProperties: My EntityConstructing class: My OpenGuiPacket: My SyncPlayerPropsPacket: Custom Inventory Container: Custom Inventory Gui:
  23. So I was wondering how to create a custom child mob, I have a mob that has a child mob, but all it is, is a custom zombie, I tried to make my other mob have a child mob but it doesn't work as far as I know. I don't even know if its creating the child its self in the entity class. Here is the Entity Class: Here is the Entity Class it references: Here is the render class:
  24. so if it doesn't exist anymore then whats the point of item and block ID's as they do still exist in 1.8, wouldn't they still conflict with one another? Also can't you still set ID's to your own ID rather than them getting a random ID?
  25. So I have been trying to create a configuration file, but I have never done it, so I have also not been able to find any good tutorials anywhere. I was wondering how to create one.

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.