Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/23/19 in all areas

  1. Now it says extrautils2 is crashing the game. Try to remove it.
    1 point
  2. It says that there is a NullPointerException in a Botania class. Try to remove Botania. Also you could test if it also crashes with only Botania installed and then ask the Botania creator for help. Here you could send the issue to the Botania creator: https://github.com/Vazkii/Botania/issues
    1 point
  3. Your mod is also technically a resource pack and a data pack. You basically treat your src/main/resources/ folder as both of them. That means you can add a custom loot table JSON file using the minecraft namespace.
    1 point
  4. It's not that the order of the properties that matters. Let's look at this line for a second: new Item(newItem.Properties().group(gobber2)).setRegistryName(location("gobber2_goo")).food(FoodList.gooFood) If I space it out a bit so we can read it a little more easily (you can keep spacing as it was in the actual code): new Item( // start constructing item properties new Item.Properties().group(gobber2) // finish constructing item properties ).setRegistryName(location("gobber2_goo")).food(FoodList.gooFood) that middle line is creating the Properties object. You were calling the food method on the Item object. You're right that food is a thing in Item, but it's just a variable not a method. As it happens, all the Properties::food method does is tell the Properties object to put your Food into that field, as you can see in the Item constructor you posted. Comparing to your working one: new Item( // start constructing item properties new Item.Properties().food(FoodList.gooFood).group(gobber2) // finish constructing item properties ).setRegistryName(location("gobber2_goo")) Now you're (correctly) calling the food method on the Item.Properties object. The only actual difference from your working one is the placement of a single bracket, which is determining what object you're calling the methods on. Changing the order works fine, you can apply properties to the Item.Properties object in whatever order you like (each method returns the Item.Properties object allowing you to "chain" the method calls like you have here). For example, this would also work: new Item( // start constructing item properties new Item.Properties().group(gobber2).food(FoodList.gooFood) // finish constructing item properties ).setRegistryName(location("gobber2_goo")) If you had more changes to properties, like rarity or max stack size, you could put them in there too in any order. Hopefully understanding this will help clear up future problems. Also, if you click the button that looks like < > at the top of your editor when you're posting, you can post code in the style that I'm using here, which will make your post look a lot cleaner.
    1 point
×
×
  • Create New...

Important Information

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