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.

Draco18s

Members
  • Joined

  • Last visited

Everything posted by Draco18s

  1. You never create (and register) an item version of your block.
  2. I'm not sure what your use-case is, still. Like, why are you checking every item in the player's inventory to see if that results in a valid craft? What's the point? I don't see any reason why the player would ever use an item that "automatically crafts everything in their inventory into whatever it can."
  3. Are you trying to fill actual grid slots, or are you just checking to see if the player can craft a given item? (Also, don't forget you can split stacks: that bread in your example could actually fill both slots!)
  4. You're probably better off doing this the other way around: Loop over the recipes list and see if the player has the required items.
  5. I'm at a loss. Put a breakpoint on line 327 of ContainerEnchantment (net.minecraft.inventory) just before it calls EnchantmentHelper.buildEnchantmentList(...) and stick your item in and trace the code to see what it does and why it doesn't call canApply for your item.
  6. Have you overriden getItemEnchantability in your Item? The base value is 0, which means not enchantable.
  7. Try overriding canApplyAtEnchantingTable in your enchantment too.
  8. I think that's supposed to be Enchantment#canApplyAtEnchantingTable Edit: return stack.getItem() == ItemList.ENCHANT_CRAFTING_ITEM ? true:false; There is no reason to do this. You can simply do this: return stack.getItem() == ItemList.ENCHANT_CRAFTING_ITEM; Second, make your max enchantibility a larger number. As is, you've said "this is only valid at exactly 3 levels." Too high and it'll get skipped.
  9. Does the death event actually fire client-side? (for non-this-client-player entities, that is) I'm not sure it does.
  10. Well, yes. The dedicated server has no idea what a JFrame is.
  11. MinecraftForge.EVENT_BUS.register(new EventKill(frame)); Hmm, what's this frame object, looking up... JFrame frame; Oh, it's null. Got it.
  12. Why have you uploaded the compiled class files in raw format rather than using any text pasting service like PasteBin or Gist?
  13. And the ore dictionary for recipes.
  14. That is a pointer to an array of floats. You need to cast it to the object type returned by inventoryHandsDropChances that you can see in the code (either float[] or List<float>, I'm not looking at it right now), then you can use it.
  15. .....er, sorry, I misread something twice. Not all awake. Ignore that.
  16. Compiling outputs multiple files (on obfuscated, one non), are you sure you grabbed the right one?
  17. Note that localization only works on the client side. You cannot translate on the server.
  18. If the data your TE is storing can fit within 4 bits, then absolutely you can compress that into metadata. You'll be having to create a BlockState for it anyway.
  19. Read your god damn crash report. Caused by: com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Unterminated object at line 5 column 4
  20. EntityJoinedWorldEvent is probably the best
  21. Just because they're not null when you open up a save game and toss them around doesn't mean they aren't null when you initialize your creative tab. Item myItem; Tab myTab; preInit() { myTab = new Tab(myItem); myItem = new Item(); } In the above (heavily simplified) code, myTab is initialized with a null item. Why because it hasn't been created yet even though the item itself exists later and you can pick it up and toss it, the tab's item is still null.
  22. Where are you running your code? Client or server?
  23. So. This is what vectors are for. The player has a vector that is their "front" called "LookVec" (Search the EntityPlayer class). Take that vector, multiply by 0.5 (or 0.2 or whatever), add their current position, and voila. You have the spot a half-block in front of them.
  24. That is both the only way AND the correct solution, as you have discovered.

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.