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

1.16.1-Overriding Vanilla Block Loot Tables


TheDeathlyCow
 Share

Recommended Posts

I've updated my mod from 1.15.2 to 1.16.1, and in my mod I have a custom item drop from birch leaves. The loot table is in src/main/resources/data/minecraft/loot_tables/blocks/birch_leaves.json. This works in 1.14.4 and 1.15.2, and the loot table is valid in 1.16.1 (tested with the /loot command), but for some reason it does not override the birch leaves block loot table anymore.

 

Heres the loot table if that's relevant:

{
  "type": "minecraft:block",
  "pools": [
    {
      "rolls": 1,
      "entries": [
        {
          "type": "minecraft:alternatives",
          "children": [
            {
              "type": "minecraft:item",
              "conditions": [
                {
                  "condition": "minecraft:alternative",
                  "terms": [
                    {
                      "condition": "minecraft:match_tool",
                      "predicate": {
                        "item": "minecraft:shears"
                      }
                    },
                    {
                      "condition": "minecraft:match_tool",
                      "predicate": {
                        "enchantments": [
                          {
                            "enchantment": "minecraft:silk_touch",
                            "levels": {
                              "min": 1
                            }
                          }
                        ]
                      }
                    }
                  ]
                }
              ],
              "name": "minecraft:birch_leaves"
            },
            {
              "type": "minecraft:item",
              "conditions": [
                {
                  "condition": "minecraft:survives_explosion"
                },
                {
                  "condition": "minecraft:table_bonus",
                  "enchantment": "minecraft:fortune",
                  "chances": [
                    0.05,
                    0.0625,
                    0.083333336,
                    0.1
                  ]
                }
              ],
              "name": "minecraft:birch_sapling"
            }
          ]
        }
      ]
    },
    {
      "rolls": 1,
      "entries": [
        {
          "type": "minecraft:item",
          "conditions": [
            {
              "condition": "minecraft:table_bonus",
              "enchantment": "minecraft:fortune",
              "chances": [
                0.02,
                0.022222223,
                0.025,
                0.033333335,
                0.1
              ]
            }
          ],
          "functions": [
            {
              "function": "minecraft:set_count",
              "count": {
                "min": 1.0,
                "max": 2.0,
                "type": "minecraft:uniform"
              }
            },
            {
              "function": "minecraft:explosion_decay"
            }
          ],
          "name": "minecraft:stick"
        }
      ],
      "conditions": [
        {
          "condition": "minecraft:inverted",
          "term": {
            "condition": "minecraft:alternative",
            "terms": [
              {
                "condition": "minecraft:match_tool",
                "predicate": {
                  "item": "minecraft:shears"
                }
              },
              {
                "condition": "minecraft:match_tool",
                "predicate": {
                  "enchantments": [
                    {
                      "enchantment": "minecraft:silk_touch",
                      "levels": {
                        "min": 1
                      }
                    }
                  ]
                }
              }
            ]
          }
        }
      ]
    },
    {
      "rolls": 1,
      "entries": [
        {
          "type": "minecraft:item",
          "conditions": [
            {
              "condition": "minecraft:survives_explosion"
            },
            {
              "condition": "minecraft:table_bonus",
              "enchantment": "minecraft:fortune",
              "chances": [
                0.005,
                0.0055555557,
                0.00625,
                0.008333334,
                0.025
              ]
            }
          ],
          "name": "better-food:green_apple"
        }
      ],
      "conditions": [
        {
          "condition": "minecraft:inverted",
          "term": {
            "condition": "minecraft:alternative",
            "terms": [
              {
                "condition": "minecraft:match_tool",
                "predicate": {
                  "item": "minecraft:shears"
                }
              },
              {
                "condition": "minecraft:match_tool",
                "predicate": {
                  "enchantments": [
                    {
                      "enchantment": "minecraft:silk_touch",
                      "levels": {
                        "min": 1
                      }
                    }
                  ]
                }
              }
            ]
          }
        }
      ]
    }
  ]
}

 

Edited by TheDeathlyCow
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • So, basically, my animations aren't working. I have everything setup, I followed their documentation and it just doesn't work. I checked my if statements with System.out.println and the line is getting printed but the animation isn't playing. Entity Class: https://github.com/Skizzium/Project-Apple/blob/Animations-FG1.17.1/src/main/java/com/skizzium/projectapple/entity/boss/skizzik/Skizzik.java#L278-L288 Model Class: https://github.com/Skizzium/Project-Apple/blob/Animations-FG1.17.1/src/main/java/com/skizzium/projectapple/entity/boss/skizzik/client/model/SkizzikModel.java Renderer Class: https://github.com/Skizzium/Project-Apple/blob/Animations-FG1.17.1/src/main/java/com/skizzium/projectapple/entity/boss/skizzik/client/renderer/SkizzikRenderer.java Animation JSON: https://github.com/Skizzium/Project-Apple/blob/Animations-FG1.17.1/src/main/resources/assets/skizzik/geo/skizzik/skizzik.geo.json
    • "I'd rather use ugly hacks than a proper API". WHY. This is why we can't have nice things.
    • does anybody know how to fix this? (Im not too tech savy and dont know alot) basically i made anew modpack today. Tried to create a new world and it crashes every time with this as the crash exit code : ---- Minecraft Crash Report ---- // I let you down. Sorry Time: 24/09/21 18:12 Description: Starting integrated server java.lang.NullPointerException: Starting integrated server     at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:770) ~[guava-21.0.jar:?] {}     at com.google.common.collect.ImmutableCollection$ArrayBasedBuilder.add(ImmutableCollection.java:477) ~[guava-21.0.jar:?] {}     at com.google.common.collect.ImmutableList$Builder.add(ImmutableList.java:758) ~[guava-21.0.jar:?] {}     at com.google.common.collect.CollectCollectors$$Lambda$2173/998099820.accept(Unknown Source) ~[?:?] {}     at java.util.stream.ReduceOps$3ReducingSink.accept(ReduceOps.java:169) ~[?:1.8.0_51] {}     at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) ~[?:1.8.0_51] {}     at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) ~[?:1.8.0_51] {}     at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1374) ~[?:1.8.0_51] {}     at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:512) ~[?:1.8.0_51] {}     at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:502) ~[?:1.8.0_51] {}     at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708) ~[?:1.8.0_51] {}     at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:1.8.0_51] {}     at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499) ~[?:1.8.0_51] {}     at net.minecraft.world.biome.provider.BiomeProvider.<init>(SourceFile:38) ~[?:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B}     at org.infernalstudios.infernalexp.world.dimension.ModNetherBiomeProvider.<init>(ModNetherBiomeProvider.java:63) ~[?:2.2.0] {re:mixin,re:classloading}     at org.infernalstudios.infernalexp.util.NoiseChunkGeneratorUtil.lambda$null$0(NoiseChunkGeneratorUtil.java:39) ~[?:2.2.0] {re:mixin,re:classloading}     at org.infernalstudios.infernalexp.util.NoiseChunkGeneratorUtil$$Lambda$2595/1435857604.apply(Unknown Source) ~[?:?] {}     at com.mojang.serialization.codecs.RecordCodecBuilder$Instance.lambda$ap3$6(RecordCodecBuilder.java:286) ~[datafixerupper-4.0.26.jar:?] {re:classloading}     at com.mojang.serialization.codecs.RecordCodecBuilder$Instance$$Lambda$932/1229281613.apply(Unknown Source) ~[?:?] {}     at com.mojang.serialization.codecs.RecordCodecBuilder$2.encode(RecordCodecBuilder.java:112) ~[datafixerupper-4.0.26.jar:?] {}     at com.mojang.serialization.codecs.KeyDispatchCodec.encode(KeyDispatchCodec.java:92) ~[datafixerupper-4.0.26.jar:?] {}     at com.mojang.serialization.MapCodec$MapCodecCodec.encode(MapCodec.java:96) ~[datafixerupper-4.0.26.jar:?] {}     at com.mojang.serialization.Encoder.encodeStart(Encoder.java:14) ~[datafixerupper-4.0.26.jar:?] {re:classloading}     at com.mojang.serialization.codecs.FieldEncoder.encode(FieldEncoder.java:24) ~[datafixerupper-4.0.26.jar:?] {}     at com.mojang.serialization.MapCodec$1.encode(MapCodec.java:39) ~[datafixerupper-4.0.26.jar:?] {}     at com.mojang.serialization.codecs.RecordCodecBuilder$Instance$4.encode(RecordCodecBuilder.java:223) ~[datafixerupper-4.0.26.jar:?] {}     at com.mojang.serialization.codecs.RecordCodecBuilder$2.encode(RecordCodecBuilder.java:112) ~[datafixerupper-4.0.26.jar:?] {}     at com.mojang.serialization.MapCodec$MapCodecCodec.encode(MapCodec.java:96) ~[datafixerupper-4.0.26.jar:?] {}     at com.mojang.serialization.Encoder.encodeStart(Encoder.java:14) ~[datafixerupper-4.0.26.jar:?] {re:classloading}     at com.mojang.serialization.codecs.BaseMapCodec.encode(BaseMapCodec.java:52) ~[datafixerupper-4.0.26.jar:?] {re:classloading}     at net.minecraftforge.common.LenientUnboundedMapCodec.encode(LenientUnboundedMapCodec.java:75) ~[?:?] {re:classloading}     at net.minecraftforge.common.LenientUnboundedMapCodec.encode(LenientUnboundedMapCodec.java:22) ~[?:?] {re:classloading}     at com.mojang.serialization.Encoder$1.encode(Encoder.java:25) ~[datafixerupper-4.0.26.jar:?] {}     at com.mojang.serialization.Codec$2.encode(Codec.java:76) ~[datafixerupper-4.0.26.jar:?] {}     at net.minecraft.util.registry.SimpleRegistryCodec.encode(SourceFile:28) ~[?:?] {re:classloading}     at net.minecraft.util.registry.SimpleRegistryCodec.encode(SourceFile:11) ~[?:?] {re:classloading}     at com.mojang.serialization.Encoder$1.encode(Encoder.java:25) ~[datafixerupper-4.0.26.jar:?] {}     at com.mojang.serialization.Codec$2.encode(Codec.java:76) ~[datafixerupper-4.0.26.jar:?] {}     at com.mojang.serialization.Encoder.encodeStart(Encoder.java:14) ~[datafixerupper-4.0.26.jar:?] {re:classloading}     at com.mojang.serialization.codecs.FieldEncoder.encode(FieldEncoder.java:24) ~[datafixerupper-4.0.26.jar:?] {}     at com.mojang.serialization.MapCodec$1.encode(MapCodec.java:39) ~[datafixerupper-4.0.26.jar:?] {}     at com.mojang.serialization.codecs.RecordCodecBuilder$Instance$6.encode(RecordCodecBuilder.java:296) ~[datafixerupper-4.0.26.jar:?] {}     at com.mojang.serialization.codecs.RecordCodecBuilder$2.encode(RecordCodecBuilder.java:112) ~[datafixerupper-4.0.26.jar:?] {}     at com.mojang.serialization.MapCodec$MapCodecCodec.encode(MapCodec.java:96) ~[datafixerupper-4.0.26.jar:?] {}     at com.mojang.serialization.Encoder$1.encode(Encoder.java:25) ~[datafixerupper-4.0.26.jar:?] {}     at com.mojang.serialization.Codec$2.encode(Codec.java:76) ~[datafixerupper-4.0.26.jar:?] {}     at com.mojang.serialization.Encoder.encodeStart(Encoder.java:14) ~[datafixerupper-4.0.26.jar:?] {re:classloading}     at net.minecraft.world.storage.ServerWorldInfo.func_237370_a_(SourceFile:250) ~[?:?] {re:classloading,pl:accesstransformer:B}     at net.minecraft.world.storage.ServerWorldInfo.func_230411_a_(SourceFile:231) ~[?:?] {re:classloading,pl:accesstransformer:B}     at net.minecraft.world.storage.SaveFormat$LevelSave.func_237288_a_(SaveFormat.java:341) ~[?:?] {re:computing_frames,re:mixin,re:classloading}     at net.minecraft.world.storage.SaveFormat$LevelSave.func_237287_a_(SaveFormat.java:336) ~[?:?] {re:computing_frames,re:mixin,re:classloading}     at net.minecraft.client.Minecraft.loadWorld(Minecraft.java:1740) ~[?:?] {re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,pl:mixin:APP:abnormals_core.mixins.json:client.MinecraftMixin,pl:mixin:APP:outer_end.mixins.json:BackgroundMusicMixin,pl:mixin:APP:randompatches.mixins.json:client.MinecraftMixin,pl:mixin:APP:betterendforge.mixins.json:MinecraftMixin,pl:mixin:A,pl:runtimedistcleaner:A}     at net.minecraft.client.Minecraft.func_238192_a_(Minecraft.java:1685) ~[?:?] {re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,pl:mixin:APP:abnormals_core.mixins.json:client.MinecraftMixin,pl:mixin:APP:outer_end.mixins.json:BackgroundMusicMixin,pl:mixin:APP:randompatches.mixins.json:client.MinecraftMixin,pl:mixin:APP:betterendforge.mixins.json:MinecraftMixin,pl:mixin:A,pl:runtimedistcleaner:A}     at net.minecraft.client.gui.screen.CreateWorldScreen.func_195352_j(CreateWorldScreen.java:260) ~[?:?] {re:classloading,pl:runtimedistcleaner:A}     at net.minecraft.client.gui.screen.CreateWorldScreen.lambda$init$11(CreateWorldScreen.java:205) ~[?:?] {re:classloading,pl:runtimedistcleaner:A}     at net.minecraft.client.gui.screen.CreateWorldScreen$$Lambda$13249/653350518.onPress(Unknown Source) ~[?:?] {}     at net.minecraft.client.gui.widget.button.Button.func_230930_b_(SourceFile:33) ~[?:?] {re:classloading,pl:accesstransformer:B,re:mixin,pl:accesstransformer:B}     at net.minecraft.client.gui.widget.button.AbstractButton.func_230982_a_(SourceFile:16) ~[?:?] {re:classloading,re:mixin}     at net.minecraft.client.gui.widget.Widget.func_231044_a_(Widget.java:136) ~[?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A}     at net.minecraft.client.gui.INestedGuiEventHandler.func_231044_a_(SourceFile:27) ~[?:?] {re:computing_frames,re:mixin,re:classloading}     at net.minecraft.client.MouseHelper.func_198033_b(MouseHelper.java:87) ~[?:?] {re:mixin,pl:runtimedistcleaner:A,re:classloading,pl:mixin:APP:randompatches.mixins.json:client.keybindings.MouseHelperMixin,pl:mixin:A,pl:runtimedistcleaner:A}     at net.minecraft.client.MouseHelper$$Lambda$12852/788532761.run(Unknown Source) ~[?:?] {}     at net.minecraft.client.gui.screen.Screen.func_231153_a_(Screen.java:427) ~[?:?] {re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:computing_frames,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,pl:mixin:APP:quark.mixins.json:client.ScreenMixin,pl:mixin:A,pl:runtimedistcleaner:A}     at net.minecraft.client.MouseHelper.func_198023_a(MouseHelper.java:85) ~[?:?] {re:mixin,pl:runtimedistcleaner:A,re:classloading,pl:mixin:APP:randompatches.mixins.json:client.keybindings.MouseHelperMixin,pl:mixin:A,pl:runtimedistcleaner:A}     at net.minecraft.client.MouseHelper.func_228030_c_(MouseHelper.java:181) ~[?:?] {re:mixin,pl:runtimedistcleaner:A,re:classloading,pl:mixin:APP:randompatches.mixins.json:client.keybindings.MouseHelperMixin,pl:mixin:A,pl:runtimedistcleaner:A}     at net.minecraft.client.MouseHelper$$Lambda$12851/2033249737.run(Unknown Source) ~[?:?] {}     at net.minecraft.util.concurrent.ThreadTaskExecutor.execute(ThreadTaskExecutor.java:111) ~[?:?] {re:mixin,pl:accesstransformer:B,xf:OptiFine:default,re:computing_frames,pl:accesstransformer:B,xf:OptiFine:default,re:classloading,pl:accesstransformer:B,xf:OptiFine:default}     at net.minecraft.client.MouseHelper.func_228028_b_(MouseHelper.java:180) ~[?:?] {re:mixin,pl:runtimedistcleaner:A,re:classloading,pl:mixin:APP:randompatches.mixins.json:client.keybindings.MouseHelperMixin,pl:mixin:A,pl:runtimedistcleaner:A}     at net.minecraft.client.MouseHelper$$Lambda$10760/310858279.invoke(Unknown Source) ~[?:?] {}     at org.lwjgl.glfw.GLFWMouseButtonCallbackI.callback(GLFWMouseButtonCallbackI.java:36) ~[lwjgl-glfw-3.2.2.jar:build 10] {}     at org.lwjgl.system.JNI.invokeV(Native Method) ~[lwjgl-3.2.2.jar:build 10] {}     at org.lwjgl.glfw.GLFW.glfwWaitEventsTimeout(GLFW.java:3174) ~[lwjgl-glfw-3.2.2.jar:build 10] {}     at com.mojang.blaze3d.systems.RenderSystem.limitDisplayFPS(SourceFile:127) ~[?:?] {re:mixin,re:classloading}     at net.minecraft.client.Minecraft.func_195542_b(Minecraft.java:999) [?:?] {re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,pl:mixin:APP:abnormals_core.mixins.json:client.MinecraftMixin,pl:mixin:APP:outer_end.mixins.json:BackgroundMusicMixin,pl:mixin:APP:randompatches.mixins.json:client.MinecraftMixin,pl:mixin:APP:betterendforge.mixins.json:MinecraftMixin,pl:mixin:A,pl:runtimedistcleaner:A}     at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:607) [?:?] {re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,pl:mixin:APP:abnormals_core.mixins.json:client.MinecraftMixin,pl:mixin:APP:outer_end.mixins.json:BackgroundMusicMixin,pl:mixin:APP:randompatches.mixins.json:client.MinecraftMixin,pl:mixin:APP:betterendforge.mixins.json:MinecraftMixin,pl:mixin:A,pl:runtimedistcleaner:A}     at net.minecraft.client.main.Main.main(Main.java:184) [?:?] {re:classloading,pl:runtimedistcleaner:A}     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_51] {}     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_51] {}     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_51] {}     at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_51] {}     at net.minecraftforge.fml.loading.FMLClientLaunchProvider.lambda$launchService$0(FMLClientLaunchProvider.java:51) [forge-1.16.5-36.2.5.jar:36.2] {}     at net.minecraftforge.fml.loading.FMLClientLaunchProvider$$Lambda$489/929856893.call(Unknown Source) [forge-1.16.5-36.2.5.jar:36.2] {}     at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-8.0.9.jar:?] {}     at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [modlauncher-8.0.9.jar:?] {}     at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [modlauncher-8.0.9.jar:?] {}     at cpw.mods.modlauncher.Launcher.run(Launcher.java:82) [modlauncher-8.0.9.jar:?] {re:classloading}     at cpw.mods.modlauncher.Launcher.main(Launcher.java:66) [modlauncher-8.0.9.jar:?] {re:classloading}    
    • I think I've got it. Or at least a base to start working from. if (toolRef.getHarvestLevel(heldItems, ToolType.AXE, playerRef, blockState) <= 0) { event.setCanceled(true); } I've implemented it into my existing onBlockBreak event, because I was having issues to get it working for the HarvestCheck event. For a weird reason it wouldn't accept the BlockState reference inside the getHarvestLevel() method, when I was using it on HarvestCheck event. I'd still prefer any kind of reflection method though. Was way less complicated.
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

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