Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

kemika1girl

Members
  • Joined

  • Last visited

  1. well, i have read this documentation many times and now even more in the main class i call: public static <T> void registerCapabilities(Class<T>, Capability.IStorage<T>, Callable<? extends T>) { CapabilityManager.INSTANCE.register(IThirst.class, new ThirstStorage(), ThirstHandler::new); } and get this error: error: <identifier> expected public static <T> void registerCapabilities(Class<T>, Capability.IStorage<T>, Callable<? extends T>) what does it mean?
  2. i'm trying to add thirst system using capabilities to my mod, however i don't really understand how to do it even though i read the documentation. i already have a class which contains the thirst logic (which is pretty similar to the hunger), but how do i attach it to the player?
  3. yes, my modifier is there i have good news: my modifiers started working, the problem was my plant_fiber_from_grass.json was in the resources/data/primitivetools/ and not in the resources/data/primitivetools/loot_modifiers so it was just my carelessness thanks you very much for the help!
  4. oh, thanks! so, there is the new code for global modifiers: @Mod.EventBusSubscriber(modid = PrimitiveTools.MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD) public class GrassDrops { @SubscribeEvent public static void registerModifiers(RegistryEvent.Register<GlobalLootModifierSerializer<?>> event) { event.getRegistry().register( new GrassDropSerializer().setRegistryName(PrimitiveTools.MOD_ID, "plant_fiber_from_grass") ); } public static class GrassDropSerializer extends GlobalLootModifierSerializer<GrassDropModifier> { @Override public GrassDropModifier read(ResourceLocation location, JsonObject object, ILootCondition[] ailootcondition) { return new GrassDropModifier(ailootcondition); } } private static class GrassDropModifier extends LootModifier { protected GrassDropModifier(ILootCondition[] conditionsIn) { super(conditionsIn); } @Nonnull @Override protected List<ItemStack> doApply(List<ItemStack> generatedLoot, LootContext context) { generatedLoot.add(new ItemStack(Items.STICK)); return generatedLoot; } } } when i entered the world, i caught a new error: [23:39:40] [Server thread/ERROR] [ne.mi.co.lo.LootModifierManager/]: Couldn't parse loot modifier primitivetools:plant_fiber_from_grass java.lang.NullPointerException: null at net.minecraftforge.common.loot.LootModifierManager.deserializeModifier(LootModifierManager.java:129) ~[?:?] {re:classloading} at net.minecraftforge.common.loot.LootModifierManager.lambda$apply$0(LootModifierManager.java:118) ~[?:?] {re:classloading} at java.util.ArrayList.forEach(ArrayList.java:1257) ~[?:1.8.0_251] {} at net.minecraftforge.common.loot.LootModifierManager.apply(LootModifierManager.java:116) ~[?:?] {re:classloading} at net.minecraftforge.common.loot.LootModifierManager.apply(LootModifierManager.java:57) ~[?:?] {re:classloading} at net.minecraft.client.resources.ReloadListener.lambda$reload$1(ReloadListener.java:14) ~[?:?] {re:classloading} at java.util.concurrent.CompletableFuture.uniAccept(CompletableFuture.java:670) ~[?:1.8.0_251] {} at java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:646) ~[?:1.8.0_251] {} at java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:456) ~[?:1.8.0_251] {} at net.minecraft.resources.AsyncReloader.lambda$null$3(AsyncReloader.java:66) ~[?:?] {re:classloading} at net.minecraft.util.concurrent.TickDelayedTask.run(TickDelayedTask.java:20) [?:?] {re:classloading} at net.minecraft.util.concurrent.ThreadTaskExecutor.run(ThreadTaskExecutor.java:140) [?:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.util.concurrent.RecursiveEventLoop.run(RecursiveEventLoop.java:22) [?:?] {re:classloading} at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:759) [?:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:141) [?:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.util.concurrent.ThreadTaskExecutor.driveOne(ThreadTaskExecutor.java:110) [?:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.server.MinecraftServer.driveOneInternal(MinecraftServer.java:742) [?:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.server.MinecraftServer.driveOne(MinecraftServer.java:736) [?:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.util.concurrent.ThreadTaskExecutor.driveUntil(ThreadTaskExecutor.java:123) [?:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.server.MinecraftServer.loadDataPacks(MinecraftServer.java:1583) [?:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.server.MinecraftServer.loadDataPacks(MinecraftServer.java:457) [?:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.server.integrated.IntegratedServer.loadAllWorlds(IntegratedServer.java:77) [?:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.server.integrated.IntegratedServer.init(IntegratedServer.java:99) [?:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:638) [?:?] {re:classloading,pl:accesstransformer:B} at java.lang.Thread.run(Thread.java:748) [?:1.8.0_251] {} obviously, no new drop appeared and i don't know what's the problem since global loot modifiers is something new for me.
  5. hi, i created a loot table which overrides already existing vanilla table and caught this problem: error: method onLootLoad in class PlantFiberLootTable cannot be applied to given types; PlantFiberLootTable.onLootLoad(); ^ required: LootTableLoadEvent found: no arguments reason: actual and formal argument lists differ in length and there is the code: @Mod.EventBusSubscriber public class PlantFiberLootTable { @SubscribeEvent public static void onLootLoad(LootTableLoadEvent event) { if (event.getName().equals(new ResourceLocation("minecraft:blocks/grass"))) { event.getTable(). addPool(LootPool.builder(). addEntry(TableLootEntry.builder(new ResourceLocation("primal", "grass"))).build()); } } } however, even if i try just to replace vanilla table with my own, nothing happens. what did i do wrong?
  6. really, now it works thanks you very much!
  7. @vemerion strange, but seems like nothing happens after i added the code.. did i do something wrong? @Mod.EventBusSubscriber(modid = Atmospheric.MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD) @Mod("atmospheric") public class Atmospheric { public static final String MOD_ID = "atmospheric"; Minecraft minecraft = Minecraft.getInstance(); private static int musicTimer = 10; @SubscribeEvent public static void onTick(TickEvent.ClientTickEvent event) { if (event.phase == TickEvent.Phase.END && event.side == LogicalSide.CLIENT) { if (musicTimer-- <= 0 && Minecraft.getInstance() != null && Minecraft.getInstance().player != null) { musicTimer = 10; Minecraft.getInstance().player.playSound(AtmosphericSoundEvents.SOLACE_1, 2f, 1f); Minecraft.getInstance().getMusicTicker().stop(); } } } }
  8. ah, thanks! yes, vanilla music can start playing, but i will try to make vanilla music stop playing if mine is already playing
  9. I have already registered all the sound events, but i have never worked with tick events. Could you explain me how it works or give an example code?
  10. How can i make my music play at the background, like the vanilla soundtrack? I want to not just replace the vanilla soundtrack with my own, as in a resourcepack, but add new tracks to it
  11. oh, sorry, if i knew where to see this debug.log, I'd publish it thanks for the github explanation, i knew about it but wasn't registered on it! And of course, here is my code: https://gist.github.com/kemika1girl/17fa633cf87fc720315a3f4b995e2393
  12. Hi all, I just finished work on generating the very first ore in my mod, after which i went to check how it works. Minecraft loaded succesfully, but when i created a new world, the game suddenly crashed. Here is my crash report: https://pastebin.com/tiGkrMBa. I don't know, what's the problem, so i'm asking for help.
  13. Thanks for your answer, i will try it
  14. Hi all! I'm just starting to develop my own mod on 1.15.2, and now i'm interested in creating a special book for the mod like the thaumonomicon from thaumcraft or the journal from astral sorcery. The problem is that I don't know how to create guis in 1.15.2. I tried to find examples of code or tutorial, but found almost nothing. I will be grateful for any help.

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.