Jump to content

Choonster

Moderators
  • Posts

    5117
  • Joined

  • Last visited

  • Days Won

    75

Everything posted by Choonster

  1. You're adding entry1 to the event's LootTable twice, both times to the "main" LootPool. You never add p1 to the event's LootTable. No two loot entries in a loot pool can have the same name (and any loot entry will always have the same name as itself), so this is what causes the error.
  2. Post the GlistreModEventHooks class, the class where you register your items and the class of the ancient book item.
  3. There's no Item registered with this name, are you sure you typed it correctly? Forge requires that each LootEntry in a LootPool has a unique entry name. The entry name defaults to the name of entry's item or loot table, but you can specify a custom entry name through JSON or the LootEntry subclass constructor if you want to have multiple entries for the same item/loot table.
  4. When writing to NBT, iterate through the HashSet and add a tag for each entry to the NBTTagList. When reading from NBT, iterate through the NBTTagList and add an entry for each tag to the HashSet. Note that you don't need to store the NBTTagList in a field or use it at runtime in any way, just read it from/write it to the NBTTagCompound argument of the TileEntity#readFromNBT/writeToNBT methods. Forge patches NBTTagList to implement Iterable<NBTTagBase>, but you can't really do much with an NBTTagBase without casting it to the appropriate subtype so it's not all that useful. Instead, you'll probably want to use a numeric for loop with NBTTagList#tagCount and NBTTagList#getStringTagAt.
  5. Use your IDE's Find Usages/Find References tool on the NetworkManager class to look for fields that store an instance of it.
  6. NetHandlerPlayClient#handleCustomPayload is the method called when the client receives a custom payload packet from the server, it doesn't send the packet to the server. Use NetworkManager#sendPacket to send a packet to the server. S3FPacketCustomPayload is the custom payload packet sent from the server to the client, hence the S at the start of its name. You need to send the client-to-server custom payload packet that has a C at the start of its name (called CPacketCustomPayload in modern versions).
  7. A HashSet is just a collection of values, so you can save it to an NBTTagList. If all you're storing in the HashSet is the enchantment types (i.e. Enchantment instances), you can save the registry names to the NBTTagList.
  8. Running Minecraft through IDEA doesn't use the runClient task, you need to add the arguments to the IDEA run configuration.
  9. I'm not too sure, that looks right to me. Are you getting any errors in the log? Try stepping through ForgeBlockStateV1.Variant.Deserializer#deserialize to see if it's recognising your transforms.
  10. You can use your own recipe classes with the JSON system by creating an IRecipeFactory and specifying it in your _factories.json file. You can see some example IRecipe and IRecipeFactory implementations here and the corresponding _factories.json file here.
  11. No, unlocalised names should only be used for display/translation purposes. They're not unique and can change at any time. Instead, compare the Item instances directly (e.g. stack.getItem() == MyModItems.FOO_BAR) or check if the Item is an instance of the appropriate class (e.g. stack.getItem() instanceof ItemFooBar). This also applies to other registry entries like Blocks and Enchantments. Don't use numeric IDs, they can be different in every save. Use EnchantmentHelper.getEnchantments to get the Enchantments on an ItemStack. The Vanilla Enchantment instances are stored in the Enchantments class. Recipes are managed by a Forge registry, register them in the appropriate registry event; just like you do for Blocks, Items, etc. The name argument of addShapelessRecipe is the registry name of the recipe and the group argument is the recipe's group name. Recipes with the same group name are displayed in the same button in the recipe book. You should move your recipes to the JSON system rather than hardcoding them.
  12. You've got your fromBytes and toBytes implementations around the wrong way. fromBytes needs to read the data from the byte buffer into the fields of the packet; toBytes needs to write the data from the fields of the packet into the byte buffer.
  13. You can specify display transformations in Forge's blockstates format, but not in the Vanilla model format like you're doing. I explain how to do this here.
  14. This is an issue with Blood Magic, it was fixed in version 1.12.2-2.2.1-83 of the mod. Update to the latest version.
  15. Are there any errors in the log? Try setting breakpoints in EntityLiving#dropLoot, LootTableManager#getLootTableFromLocation and LootTableManager.Loader#load and stepping through them when a Shulker dies.
  16. Vanilla's implementation is in various places in ModelBakery (look for uses of ModelBakery.MODEL_GENERATED), but Forge replaces this with ItemLayerModel.
  17. This isn't possible in 1.8. Update to 1.11.2+ (ideally 1.12.2) and subscribe to ClientChatEvent.
  18. To specify NBT for an ingredient, use an ingredient of type minecraft:item_nbt and specify the NBT data in the "nbt" property. To specify NBT for a result, simply specify the NBT data in the "nbt" property. You can see an example of a recipe that results in a spawner here.
  19. So that Baby Zombies drop roughly 2.5x more experience from the super call in EntityZombie#getExperiencePoints. If you mean assets/<mod_id>/loot_tables/..., then yes.
  20. Though it should be noted that this affects the loot table globally rather than for just a single entity.
  21. You can set the EntityLiving#deathLootTable field using reflection to change an entity's loot table. You can also subscribe to LivingDropsEvent to change the item dropped by an entity. You can set the EntityLiving#experienceValue field using reflection to change the amount of experience dropped by an entity, though some entities set this field after the initial spawn (e.g. Baby Zombies do this on death). You can also subscribe to LivingExperienceDropEvent to change the amount of experience dropped by an entity.
  22. I didn't know that, because you haven't said anything about that before now. Why do you have two copies of the Forge JAR? You only need one. Add quotation mark characters (") directly before and after the JAR file name.
  23. You should be using Java 8, not Java 7. Unless you need Java 9 for non-Minecraft things, you should uninstall that as well. You can either specify the full path to java.exe in the command or remove the other versions of Java form the PATH environment variable and add Java 8.
  24. Either rename the JAR to remove the " (2)" from the name or wrap the name in quotation marks in the batch script. Once you've done that, either run the command or the batch script.
  25. Change minecraft_server.1.10.2.jar to the name of the Forge JAR file.
×
×
  • Create New...

Important Information

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