Jump to content

Novârch

Members
  • Posts

    422
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Novârch

  1. Why do you even need this? Maybe there is a better way to accomplish what you want.
  2. Make your own thread and post what you've tried.
  3. As I said, the cap variable isn't equal to your capability because your capability is null in your IDE, it gets a value at runtime through magic annotation bs (@CapabilityInject).
  4. Okay, a few things. Provider#getCapability should return this, capability == CAPABILITY ? lazyOptional.cast() : LazyOptional.empty() You should use LazyOptional#cast instead of a real cast. Btw, the reason it says that's always false is because it's currently null, it only gets a value at runtime through magic annotation bs. As for your serialize and deserialize NBT methods, you shouldn't write to the capability, you should write to its storage, something like this, @Override public INBT serializeNBT() { return CAPABILITY.getStorage().writeNBT(CAPABILITY, lazyOptional.orElseThrow(() -> new IllegalArgumentException("LazyOptional is empty!")), null); } @Override public void deserializeNBT(INBT nbt) { CAPABILITY.getStorage().readNBT(CAPABILITY, lazyOptional.orElseThrow(() -> new IllegalArgumentException("LazyOptional is empty!")), null, nbt); } Edit: ...I have no idea what happened to the second example's formatting...
  5. Or in the words of LexManos,
  6. There is none. As I said, take a look at how vanilla does it (WolfModel, WolfRenderer, etc.).
  7. Look at how vanilla makes models, or use a model creator like Blockbench. Remember that your model won't render if you don't override createSpawnPacket and return NetworksHooks.getEntitySpawningPacket(this).
  8. Export to .json from Blockbench to this file path Project/src/main/resources/assets/"insert modid here"/models/item/"item_name_here".json.
  9. It is, on an unrelated note, you shouldn't post log files directly to GitHub, instead post them to https://gist.github.com/.
  10. You should, but just in case you need some vanilla assets, you can use a ResourceLocation with "minecraft" as the first parameter, than the path of the asset.
  11. I need a file called debug.log. Edit: For some reason this got posted twice? Forum glitches.
  12. That should work, is it possible you just missed the message? Pro tip if you're logging in a spammy log, do something like this to ensure you can see you're message, for (int i = 0; i < 1000; i++) LogManager.getLogger().debug("Common setup fired!"); Please remove it before publishing your mod though.
  13. You're trying to register a String to the Event bus, I can't even fathom why someone would do this. Please post your debug.log, before you ask where it's located, your OS's file explorer has a search function.
  14. If this isn't your mod, you should report this to the dev, Forge has nothing to do with independent mods.
  15. You still have to specify them in the build.gradle.
  16. RegistryEvent, don't use vanilla registration if there is a Forge version available.
  17. 1.12 is no longer supported on this forum. Please update to a modern version of Minecraft to receive support.
  18. https://github.com/Tavi007/ElementalCombat/blob/1390c4b3be278d93c6be25369ac14cb8f7e74b68/1.15.2/src/main/java/Tavi007/ElementalCombat/StartupCommon.java#L26 Your FMLCommonSetupEvent isn't annotated with @SubscribeEvent , it's never called. https://github.com/Tavi007/ElementalCombat/blob/1390c4b3be278d93c6be25369ac14cb8f7e74b68/1.15.2/src/main/java/Tavi007/ElementalCombat/events/AttachCapabilityEvent.java#L14 For events to be called, you have to register them to the event bus by calling IEventBus#register, you never call MinecraftForge.EVENT_BUS.register(new AttachCapabilityEvent), so it doesn't fire. Maybe you can put the ResourceLocation as a parameter in your constructor? I haven't worked with particles myself, just an assumption. I don't think you should, they're all small issues that can be tackled in one post instead of spamming the forums with small 1 reply threads. Edit: Dzuchun is also correct, though you don't have to use @Mod.EventBusSubscriber if you're methods aren't static, but you still have to register an instance of your class. Edit 2: Btw, you can't really have both FMLCommonSetupEvent and ServerAboutToStartEvent in the same @Mod.EventBusSubscriber annotated class as they fire on separate buses, FMLCommonSetupEvent fires on the mod bus, ServerAboutToStartEvent on the Forge bus. Edit 3: This is from the Forge discord,
  19. You could try using AnvilRepairEvent and set the tool's NBT there manually.
  20. You're missing an IItemTier, float attackDamage and a float attackSpeed, all of these things are basic Java and you do not need to ask about them. Please look at the constructor, unless you're blind it has everything you need, your IDE should even give you a warning and tell you what you didn't put into the constructor. In short, please learn basic Java before modding.
  21. Show the class your event is in, I suspect you didn't call IEventBus#addListener(Consumer<T extends Event>) or annotate it with @SubscribeEvent.
  22. This class from MrCrayfish's Backpacked mod might be useful, it renders a backpack attached to the player.
×
×
  • Create New...

Important Information

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