Jump to content

skeddles

Members
  • Posts

    25
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

skeddles's Achievements

Tree Puncher

Tree Puncher (2/8)

2

Reputation

  1. I want to make it so some mobs aren't hostile towards players, such as golems or wolves, even after being attacked. What do I need to do to accomplish this?
  2. Is that registerItems? I moved it there and it seems to work. I was following this guide which tells you to do it the other way.
  3. I thought I did this just how I did last time, but for some reason when I run this code, the register items and renders events in the item class come before the preInit event from my main class. What did I do wrong? showing the order: [13:37:42] [main/INFO] [FML]: Applying holder lookups [13:37:42] [main/INFO] [FML]: Holder lookups applied [13:37:42] [main/INFO]: [STDOUT]: SIGN VARIETY registerItems() <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< [13:37:42] [main/INFO] [FML]: Applying holder lookups [13:37:42] [main/INFO] [FML]: Holder lookups applied [13:37:42] [main/INFO] [FML]: Applying holder lookups [13:37:42] [main/INFO] [FML]: Holder lookups applied [13:37:42] [main/INFO]: [STDOUT]: SIGN VARIETY registerRenders() <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< [13:37:42] [main/INFO] [FML]: Applying holder lookups [13:37:42] [main/INFO] [FML]: Holder lookups applied [13:37:42] [main/INFO] [FML]: Injecting itemstacks [13:37:42] [main/INFO] [FML]: Itemstack injection complete [13:37:42] [Forge Version Check/INFO] [ForgeVersionCheck]: [forge] Found status: UP_TO_DATE Target: null [13:37:42] [Thread-3/INFO] [FML]: Using sync timing. 200 frames of Display.update took 53019200 nanos [13:37:43] [Sound Library Loader/INFO]: Starting up SoundSystem... [13:37:43] [Thread-5/INFO]: Initializing LWJGL OpenAL [13:37:43] [Thread-5/INFO]: (The LWJGL binding of OpenAL. For more information, see http://www.lwjgl.org) [13:37:43] [Thread-5/INFO]: OpenAL initialized. [13:37:43] [Sound Library Loader/INFO]: Sound engine started [13:37:45] [main/INFO] [FML]: Max texture size: 16384 [13:37:45] [main/INFO]: Created: 512x512 textures-atlas [13:37:46] [main/INFO]: [STDOUT]: signvariety:init [13:37:46] [main/INFO]: [STDOUT]: signvariety:preInit [13:37:46] [main/INFO]: [STDOUT]: SIGN VARIETY init() <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< [13:37:46] [main/INFO] [FML]: Injecting itemstacks main java file: package signvariety; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventHandler; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; @Mod(modid = signvariety.MODID, version = signvariety.VERSION) public class signvariety { public static final String MODID = "signvariety"; public static final String VERSION = "1.0.0"; @EventHandler public void preInit(FMLInitializationEvent event) { Items.init(); } } items java file package signvariety; import net.minecraft.client.renderer.block.model.ModelResourceLocation; import net.minecraft.item.Item; import net.minecraftforge.client.event.ModelRegistryEvent; import net.minecraftforge.client.model.ModelLoader; import net.minecraftforge.event.RegistryEvent; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; @Mod.EventBusSubscriber(modid="signvariety") public class Items { private static Item mySign; public static void init () { System.out.println("SIGN VARIETY init() <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"); mySign = new SignItem("mySign"); } @SubscribeEvent public static void registerItems(RegistryEvent.Register<Item> event) { System.out.println("SIGN VARIETY registerItems() <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"); //event.getRegistry().registerAll(mySign); } @SubscribeEvent public static void registerRenders(ModelRegistryEvent event) { System.out.println("SIGN VARIETY registerRenders() <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"); //ModelLoader.setCustomModelResourceLocation(mySign, 0, new ModelResourceLocation(mySign.getRegistryName(), "inventory")); } }
  4. How can I look at what events there are? I found this thread which explains it but I can't figure how to do it with my IDE or what exactly to click. I used IntelliJ. Usually I right click > go to > declaration. //loot tables @SubscribeEvent public static void lootLoad(LootTableLoadEvent evt) { //code }
  5. I want to make it a chance that you get no item from my loot table. I adding the items dynamically, not grabbing them from a json file. How can I add a blank item? Only thing I've found is ItemStack.EMPTY but LootEntryItem wants an Item not an Itemstack. part of my code: ArrayList<LootEntryItem> entries = new ArrayList<LootEntryItem>(); entries.add(new LootEntryItem(abcmExcalibur, 10, 60, new LootFunction[0], new LootCondition[0], "heroicarmory:abcmExcalibur")); LootEntry [] entriesArray = entries.toArray(new LootEntry[entries.size()]); LootPool pool = new LootPool(entriesArray, new LootCondition[0], new RandomValueRange(1), new RandomValueRange(1), "heroicarmorypool"); evt.getTable().addPool(pool); does not work: entries.add(ItemStack.EMPTY ,new LootEntryItem(null, 1169, 60, new LootFunction[0], new LootCondition[0], "heroicarmory:empty"));
  6. I just formatted them poorly like camelCaseStyleName instead of underscore_style_name like people would expect
  7. I'd like to slightly change the (game id) names of items in my mod for the next release. It there a way to add an alias or something so that doing this doesn't break people's old save files when they update?
  8. Not sure if this is possible, but I want to dynamically add options to my config based on loot tables added by any mods. I thought maybe I could create an arraylist and then convert it to an enum? Doesn't seem to work though. Any advice? ArrayList<String> modLootTables = new ArrayList<String>(); //loot tables @SubscribeEvent public static void lootLoadConfig(LootTableLoadEvent evt) { String name = evt.getName().toString(); System.out.println("loot table in config!!!!" + name); entries.add(name); public static float damageScale = 1; } @Name("Loot Tables") public static Enumeration<String> e = Collections.enumeration(modLootTables);
  9. I didn't realize that it could be an array. This code seems to work now. I haven't used arrays before, how does this look? Would there be any performance loss doing it this way, even if there was hundreds or thousands of items? //loot tables @SubscribeEvent public static void lootLoad(LootTableLoadEvent evt) { String name = evt.getName().toString(); if (name.contains("chest")) { LootEntry[] entry = { new LootEntryItem(Items.COOKIE, 1, 60, new LootFunction[0], new LootCondition[0], "test:cookie"), new LootEntryItem(Items.SKULL, 1, 60, new LootFunction[0], new LootCondition[0], "test:skull") }; LootPool pool = new LootPool(entry, new LootCondition[0], new RandomValueRange(1), new RandomValueRange(1), "testpool"); evt.getTable().addPool(pool); } } edit: just realized i need to be able to add to the array at will so probably need an arraylist, workin on that edit: here's what I got now, uses an arraylist and then converts it at the end: ArrayList<LootEntryItem> entries = new ArrayList<LootEntryItem>(); entries.add(new LootEntryItem(Items.COOKIE, 1, 60, new LootFunction[0], new LootCondition[0], "examplemod:cookie")); entries.add(new LootEntryItem(Items.SKULL, 1, 60, new LootFunction[0], new LootCondition[0], "examplemod:skull")); LootEntry [] entriesArray = entries.toArray(new LootEntry[entries.size()]); LootPool pool = new LootPool(entriesArray, new LootCondition[0], new RandomValueRange(1), new RandomValueRange(1), "heroicarmorypool"); evt.getTable().addPool(pool);
  10. I originally created my LootPool by making my LootEntry a LootEntryTable that gets the items from a loot table json, but now I want to do it with code. I figured out how to create a loot entry for a single item by using LootEntryItem instead of LootEntryTable, but how can I make a list of multiple items? //loot tables @SubscribeEvent public static void lootLoad(LootTableLoadEvent evt) { String name = evt.getName().toString(); if (name.contains("chest")) { LootEntry entry = new LootEntryItem(Items.COOKIE, 15, 60, new LootFunction[0], new LootCondition[0], "modpoolcustomtest"); LootPool pool = new LootPool(new LootEntry[] {entry}, new LootCondition[0], new RandomValueRange(1), new RandomValueRange(1), "modpool"); evt.getTable().addPool(pool); } }
  11. I'm making a config file with @Config (and to use with the in game editor, which is where I'm looking at it) It seems to sort the fields alphabetically by @Name. Is there a way to set the order or group them? Is there any way to add headings? Also if you know of an example showing how to use the info set in the config file, that would be helpful.
  12. I was using latest forge for 1.11 and a couple times the game crashed (probably ran out of ram). It's not that bad it happens a lot, but we lost hours of progress. Isn't minecraft supposed to save occasionally? Is there any way I can make it save more or some way to force a save? Any ideas appreciated.
  13. How do I make minecraft open the logging window without going through a launcher, when just running gradlew runClient from command line?
  14. Yup, seems I just need that one little word. Thank you.
×
×
  • Create New...

Important Information

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