Jump to content

Leaderboard

Popular Content

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

  1. Items.BREAD.setCreativeTab(null) Is the same as ForgeRegistries.ITEMS.get(new ResourceLocation("minecraft","bread")) Yes. Well, probably. You need the right event type. Sort of. The method signature needs to match in order for it to be called. If you don't have an Event type as the only parameter, then no event call will ever invoke your method because the signature would never match.
    1 point
  2. https://github.com/BurntRouter/ATimeMod2/blob/dev/src/main/java/com/router/atimemod2/init/ModEntities.java#L22 I have seen many ways to access registries in my time on these forums, but this one is the best worst one yet I think. Don't do that. Registry entries must be instantinated in appropriate registry events and registered there. What you are doing here will never work. Also Why? Why would your registry event handler extend a registry entry?
    1 point
  3. Don't do anything you are doing with your items/blocks/entities/registry entries. They must be instantinated in the appropriate registry event, and registered using the registry instance passed in that event. If you are ever accessing registries like that you are doing everything wrong. And yeah, your issue is using static fields. In your ClientProxy the itemrenderer is stored in a static field, or rather it is obtained by a static field. By the time that executes it is null, so you are passing null to the renderer thus making it crash with an NPE. Don't obtain references in static fields like that, don't use static initializers, don't access registries like that, use appropriate events.
    1 point
  4. Override Block#getHarvestLevel. Override their entries in the blocks registry by registering a new block with the same registry name as the old one. This works with many registries, not just blocks. However do consider using events before doing this. Overriding blocks won't really work well if multiple mods are overriding the same block. Maybe an event can do what you want. https://minecraft.gamepedia.com/Advancements#JSON_Format Forge doesn't change the way datapacks register advancements or much about them really. You would do the same things you would when making a datapack. Can't actually answer #4 since i've never really worked with the recipe book, but I don't think many players care since pretty much everybody uses JEI anyway. In theory it should assign a recipe to a tab based on the creative tab of the resulting item. It is possible, but not with that mindset. It is a very invasive way that creates a ton of compatibility issues and is not going to be supported here. Use forge events or if something can't be acheived by an event/registry override/inserting other object into a field consider making a PR instead.
    1 point
  5. Set JAVA_HOME environment variable via system settings (see here for a guide) and then restart your PC. Make sure it is set to a JDK 1.8 installation, e.g. C:\Program Files\Java\jdk_1.8-something-i-don't-remember\ If you still have troubles, try Command Prompt rather than Powershell. Powershell should work but I don't personally know.
    1 point
  6. Hey @warframeza002, still having issues? I understand that going into these things new can be tough.
    1 point
  7. Forge for 1.13.2 is mostly done. However, Forge is built on top of Mojang’s minecraft code which doesn’t have “simple and clear interfaces, factories and classes for the rapid development of modifications”. Minecraft is not built with modding in mind at all and doesn’t have any code related to mods at all. Forge has many of these things though like event subscribing and Modder-friendly extensions to the vanilla system (like registries & capabilities). The documentation for vanilla methods is usually lacking or non-existent, but Forges methods are usually well documented. The Forge documentation (at https://mcforge.readthedocs.io/en/latest) hasn’t been (fully) updated for 1.13.2 yet. The Forge team is mostly focussed on fixing major bugs in 1.13 and preparing for 1.14. In future please upload your code as a working GitHub repository. People on these forums are unlikely to download random files from people they don’t know, and people on mobile can’t open zip files.
    1 point
  8. Your class isn’t annotated with @EventBusSubscriber and your method isn’t static so everything should work, but here’s this just in case. You want the method Event#setCancelled(boolean) which translates to the code event.setCancelled(true/false); Your method should also begin with a lowercase (onEntitySpawn rather than OnEntitySpawn) and probably should be called onEntityJoinWorld because it’s not the same as spawning.
    1 point
  9. Double colons (e.g. SomeClass::SomeMethod) has a similar meaning, but I'll be honest that I haven't seen the distinction clarified for me. Just pointing out that you might see that sometimes too.
    1 point
  10. Hajjdajkdacljnvxkvlksjhlajncklhsciaukbkuawulhcakucjnsllhcahcjnakulcna.
    1 point
×
×
  • Create New...

Important Information

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