Jump to content


  • Posts

  • Joined

  • Last visited

  • Days Won


kiou.23 last won the day on October 16 2021

kiou.23 had the most liked content!


  • Gender

Recent Profile Visitors

4163 profile views

kiou.23's Achievements

Diamond Finder

Diamond Finder (5/8)



  1. we can't know if everything is in the correct location if you don't provide a repository for us to check. but by the log it seems that this file "emeraldarmor:models/item/testitem.json" does not exist
  2. This is a good tutorial: https://github.com/TheGreyGhost/MinecraftByExample/tree/master/src/main/java/minecraftbyexample/mbe31_inventory_furnace
  3. make sure the path is correct. you're using intelliJ, so you may have accidently named a single folder "assets.perry.textures.entity", instead of creating multiple nested directories. only use dots for java packages
  4. does it have the same methods? does it serve the same purpose? this sounds like something you could figure out by yourself
  5. Forge 12.18.3 was for 1.10, which is no longer supported. Please update to a modern version of Minecraft to receive support.
  6. you'll need to be more specific than that not a lot has changed from 1.16.4 to 1.16.5, so your code shouldn't be breaking. However, what may be happening is that you were using mcp mappings, but now the project is with mojmaps. You can try to refactor the code to update the mappings, or just switch back to using mcp mappings (given that this is the actual issue, I'm just assuming it is since you didn't provide more info)
  7. the job of the CapabilityProvider is too handle and expose all the capabilities for an object. In the getCapabilities method, it will check for which capability that is being requested, and provide it. in the Item class, the point of the initCapabilities method, is just to say which CapabilityProvider will handle it's data. so if what you need is an Inventory, you'd have an "InventoryProvider", which when the ITEM_STACK_HANDLER capability was requested, would return the Inventory. and in the item which has this inventory data, it would return this InventoryProvider in initCapabilities. Here's an example: public class BackpackCapabilityProvider implements ICapabilitySerializable<INBT> { // BackpackItemStackHandler is just an extension of ItemStackHandler which makes sure no Backpack can be put in the inventory private BackpackItemStackHandler backpackItemStackHandler; // This instantiates the Inventory only when it is first requested, and then caches it @Nonnull private BackpackItemStackHandler getCachedInventory() { if (backpackItemStackHandler == null) backpackItemStackHandler = new BackpackItemStackHandler(); return backpackItemStackHandler; } private final LazyOptional<IItemHandler> lazyInventory = LazyOptional.of(this::getCachedInventory); // Provides the Inventory @Nonnull @Override public <T> LazyOptional<T> getCapability(@Nonnull Capability<T> cap, Direction side) { if (cap == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) return (LazyOptional<T>)(lazyInventory); // If we needed to provide more than one capability, we'd simply add another check: // if (cap == SOME_OTHER_CAPABILITY) return (otherCapability) return LazyOptional.empty(); } // Saves the Inventory data to an NBT tag, so that it can be saved to disk @Override public INBT serializeNBT() { return CapabilityItemHandler.ITEM_HANDLER_CAPABILITY.writeNBT(getCachedInventory(), null); } // Reads the Inventory data from an NBT tag that was saved to disk @Override public void deserializeNBT(INBT nbt) { CapabilityItemHandler.ITEM_HANDLER_CAPABILITY.readNBT(getCachedInventory(), null, nbt); } }
  8. you don't. You'll check the capability type in the provider; And in your initCapabilities you'll return an instance of said provider. If your item needs more than one capability, just make a Provider which provides multiple capabilties depending on which one is requested.
  9. an IItemStackHandler, not an IInventory, they have a better api
  10. You need a capability, and a capability provider. the capability is just a class which will hold your arbitrary data, for an Inventory, you want an IItemHandler (which handles ItemStacks). forge already has a default implementation of IItemHandler called ItemStackHandler, however you can create your own for custom behaviour. the capability provider is a class which implements ICapabilityProvider (orICapabilitySerializable<INBT> if you need save and load the data between sessions). In it's getCapability method, if the requested capability is your capability (or if it is just an inventory you can use CapabiltiyItemHandler.ITEM_HANDLER_CAPABILITY), and then return a lazy instance of it.
  11. doesn't vanilla already allow you to tp to any player's position?
  12. you're not forced to code in eclipse. other options are IntelliJ, or VSCode (although vscode requires some setup, and therefore is not really recomended)
  13. you can check the code using your IDE, it should have a code navigation feature, which allows you to read class definitions, method references, interface implementations and all that I believe that in IntelliJ you can press double shift to search for files, and in there you can search for the source.
  14. the error points to your FrogEntity constructor: at me.mcartyr.tutorial.entities.FrogEntity.<init>(FrogEntity.java:31) ~[main/:?] {re:classloading} can you post it (and mark what line is line 31)?
  15. I'd start by reading the beehive and the campfire methods... and looking for lines of code that handle the interaction. for instance, does the campfire or the beehive have a tile entity? if so that logic could be handle in the tick method. if not it's probably done through random ticks, which is done in the tickRandomly (iirc) of the block. the beehive was added in a later update, and the logic concerns it's state and doesn't affect the campfire, so I'd assume that it is handled somewhere in beehive related code. reading through the vanilla classes is how to get around and understand, for the most part
  • Create New...

Important Information

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