Jump to content
Search In
  • More options...
Find results that contain...
Find results in...


  • Posts

  • Joined

  • Last visited

Everything posted by TheGoldenProof

  1. New(ish) to modding, just decided to get back into it. All I've done so far is set up some of the mod information (mainly just the mod id and stuff) but whenever I try to launch it, it crashes with this error: pastebin I've also tried just running the default examplemod that extracts with the mdk and i get the same error.
  2. I know how to check if a mod is loaded, Loader.isModLoaded(), but if I want to run code with classes from the mod, I can't if the mod isn't there. Here's what I have right now that checks if the mod is loaded: and here's where I use it: But it wont work because the "IRpgPlayer" and "RpgPlayerProvider" classes don't exist when the mod isn't loaded, so it causes a compiler error ("Unresolved Compilation Problems"), so technically the try-catch doesnt do anything because the problem is before it figures that out. I know that this is possible because so many other mods have cross-mod compatibility.
  3. I forgot the static part, added it. Now, whenever I try to join a world I get a really unhelpful crash report
  4. basically what the title says. I have it set that it should spawn in every blacksmith chest but it doesn't. EventHandler ^ assets/saom/loot_tables/village_blacksmith.json ^
  5. Thanks for the help I got it fixed but I forgot to post it. I forgot the @Mod.EventBusSubscriber tag on the class
  6. I'm trying to do something whenever I kill the Wither boss using LivingDeathEvents and as far as I can tell, the wither boss is an EntityLivingBase, but the event never fires. @SubscribeEvent public static void onLivingDeath(LivingDeathEvent event) { if (event.getEntity() instanceof EntityWither || event.getEntityLiving() instanceof EntityWither) { SAOM.info("IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII"); //Testing if its firing when I kill it, prints to the console } } Also, I'm not sure the difference between event.getEntity() and event.getEntityLiving(). Is one the thing that killed it and one the thing that was killed, or are they both the same thing?
  7. I have 0 understanding of json so I'm trying to avoid it as much as possible. Is there any way I could do it without?
  8. I'm trying to make wither bosses drop this item (ModItems.ELUCIDATOR) and its not working. What am I doing wrong? @SubscribeEvent public void loadLootTables(LootTableLoadEvent event) { if (event.getName().toString().equals("minecraft:entities/wither")) { LootFunction[] funcs = {}; LootCondition[] conds = {}; LootEntry[] loots = { new LootEntryItem(ModItems.ELUCIDATOR, 99999, 7, funcs, conds, "elucidator") //just using 99999 as a test weight to make sure its actually working and I'm not really unlucky }; LootPool pool = new LootPool(loots, conds, new RandomValueRange(1, 1), new RandomValueRange(0), "saomodpool"); event.getTable().addPool(pool); } }
  9. Sometimes I just have to type out my questions in order for my brain to figure everything out and make the connections. I think I have it figured out now, but this is what I was going to ask: So now I have in my GigasCedarBranch class: is this right? my serialize and deserialize are in the spoiler here I'm realizing this isn't going to work. this is my capability storage class's readNBT and writeNBT and I'm pretty sure that I didn't finish whatever I was doing and I'm not sure where I got this from.
  10. The capability provider is an instance of ICapabilitySerializable So does this mean I'll have to do networking? I feel like what you're trying to say here is an easier method than using packets but I don't understand what you're saying. All the items are from my mod except the obsidian, and when you say sent and recieved how do you send and recieve?
  11. I want to add 1 to the value in a capability on an item of mine, but it isn't working. I have a MarbleBlock and when you throw a piece of Obsidian and a GigasCedarBranch on it and right-click the block with an empty hand, It adds one to the counter in the capability. every twenty progress points (20 clicks or progress % 20 == 0) I want it to destroy the obsidian, and if its 60 (and above, just to be safe), I want to destroy the GigasCedarBranch and give me a different item (ModItems.BLACK_ONE) On second thought, this may be a server/client syncing issue, because it will eat the obsidian but the progress on the tooltip on the branch doesn't update and the item will never turn into the other. I have no idea how to do anything with client and server stuff, so if it is the problem, I'm going to need a lot of help.
  12. I'm kindof new to this but I think every block is also an item and so you have to have an item json in the right places
  13. I blindly stumbled my way through making a capability and I have no idea if it did it right. I'm putting a couple questions into one post. How do I make my capability save a different value for each itemstack. The code I have right now seems like it would make every Item (of its type) the same thing. (I think, doesn't minecraft only have one instance of every item but its used in different itemstacks?) How would I add a tooltip that will change (specifically when I craft it with a specific Item)? Current capability code: Here's a little background
  14. So my type is byte, but in my callable class: public class CapabilityFactory implements Callable<Byte>{ @Override public Byte call() throws Exception { return new Byte(); } } is says "The Constructor Byte() is undefined" because there's no empty constructor, only of (byte var1) and (String var1), so how would I make it return an instance of Byte?
  15. I wan't this special stick to be sharpened into a sword, but I need it to be crafted with something multiple times, so I wan't to store how many times its been "sharpened" yes.
  16. When I was reading through the Forge Documentation I got to the Capabilities section. It seemed like whatever capabilities were, they were useful. I need to use something to store information about an ItemStack, and so I think Capabilities are the best way to do that. I started re-reading the forge documentation on it, and I have read it at least 10 times, but It is a complete word salad. I also couldn't find much on how to make them online anywhere, so I guess here is the best place to go next. If someone could explain Capabilities and how I would attach a capability to an ItemStack or send me a really good link I would be very happy. Thanks
  17. Ok good. Now that makes sense to me. Thank you. I don't totally understand what you're arguing against here but I think I get your point. Use the object holder.
  18. I know its not, but they're kind of close (they share a forge page) so i figured I should use them anyway. I think i get it now though. Its kindof the opposite of what I said. It "Overwrites" it (more accurately replaces "null") with the object specified if its in the registry for whatever type of object it is. So to use this, I would have to add my items to the registry in the registry event thing, and then in the place where I declare Items, declare them null and let it fill in with the registry entry i just made?
  19. I hear that I should definitely be using it, but I don't really understand what it is. I read the forge documentation on it and registries (because i'm also trying to get rid of static instantiations) but I'm still kind of confused. Is it basically just a way to access object from another class? You would do @ObjectHolder("domain:object_your_overridding") unless you already specified the domain above the class, and that would allow you to overwrite that object, correct? On the forge page it has this in its example: @ObjectHolder("ender_eye") public static final Item eye_of_ender = null; // Type Item means that the Item registry will be queried. // As the annotation has the value "ender_eye", that overrides the field's name. // As the domain is not explicit, "minecraft" is inherited from the class. // Object to be injected: "minecraft:ender_eye" from the Item registry. Would that override/overwrite (is there a difference?) minecraft's ender_eye object (I'm assuming the Ender Eye item) with whatever you set eye_of_ender to? Or do i have this totally wrong?
  20. It was because I wasn't using ItemStack#isEmpty() so It's working now.
  21. Thanks, I didn't really mean what I said, I was just frustrated. I have a decent understanding of java stuff but I definitely don't know everything, because there is SO much to learn. In fact I am, however I was impatient and started reading the alicization books (9+) and now I'm on 12
  22. k i guess ill just stop and think about how many hours of my life i just wasted
  23. I'm new at modding (you can tell) and so I don't know what registry events are or how to instantiate my objects in them Also somewhat new to java and eclipse. I've never used Eclipse's debugger and I have heard of streams but I don't really know what they are. I'll look into streams and try the debugger but if you could explain how to do the registry thing a little more that would be great
  24. The way I want this to work: You throw the dragon bone ax on top of a Gigas Cedar Log and right-click the log with an empty hand and it gives you a Gigas Cedar Branch if you are above y = 200. Log method @Override public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) { AxisAlignedBB above = new AxisAlignedBB(pos.up()); boolean hasAxe = false; List<EntityItem> entities = worldIn.getEntitiesWithinAABB(EntityItem.class, above); for(EntityItem ei : entities) { if (ei.getItem().getItem().equals(ModItems.DRAGON_BONE_AXE)) { hasAxe = true; } } if (pos.getY() > 200 && playerIn.inventory.getCurrentItem() == ItemStack.EMPTY && hasAxe) { playerIn.addItemStackToInventory(new ItemStack(ModItems.GIGAS_CEDAR_BRANCH, 1)); } return false; } Dragon Bone Ax code (unnecessary variables and stuff excluded) public class ModItems { public static final List<Item> ITEMS = new ArrayList<Item>(); //Tooltips //Object Priorities public static final int P_DRAGON_BONE_AXE = 10; //Materials public static final ToolMaterial M_DRAGON_BONE = EnumHelper.addToolMaterial("m_dragon_bone", P_DRAGON_BONE_AXE, P_DRAGON_BONE_AXE*60, P_DRAGON_BONE_AXE/4.0f, P_DRAGON_BONE_AXE/3.0f, 10); //Tools public static final ItemAxe DRAGON_BONE_AXE = new ToolAxe("dragon_bone_axe", M_DRAGON_BONE, P_DRAGON_BONE_AXE, SAOM.saoModTab); //Items } but it doesn't work
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.