Jump to content

Recommended Posts

Posted

I have a problem with a loot table. I am creating a redstone mod and it is complete, except that the custom redstone that I have created does not drop when the redstone wire block is destroyed by the player.

 

I have registered the item from the block, and the item places the wire block correctly.

 

the block and item registry are as follows:

 

@SubscribeEvent
public static void onBlocksRegistry(final RegistryEvent.Register<Block> event) {
    event.getRegistry().register(new BluestoneWireBlock(Block.Properties.create(Material.ROCK, DyeColor.BLUE).hardnessAndResistance(0f, 0f).sound(SoundType.STONE).doesNotBlockMovement()).setRegistryName("bluestone"));
}

 

@SubscribeEvent
public static void onItemsRegistry(final RegistryEvent.Register<Item> event) {
    Item.Properties properties = new Item.Properties()
            .group(setup.itemGroup);
    event.getRegistry().register(createItemBlockForBlock(ModBlocks.BLUESTONE_WIRE, new Item.Properties().group(setup.itemGroup).maxStackSize(64)));
}

private static BlockItem createItemBlockForBlock(Block block, Item.Properties properties) {
    return (BlockItem) new BlockItem(block, properties).setRegistryName(block.getRegistryName());
}

 

and the loot table is as follows:

 

{
  "type": "minecraft:block",
  "pools": [
    {
      "name": "bluestone",
      "rolls": 1,
      "entries": [
        {
          "type": "minecraft:item",
          "name": "rgbstone:bluestone"
        }
      ],
      "conditions": [
        {
          "condition": "minecraft:survives_explosion"
        }
      ]
    }
  ]
}

 

Any help would be greatly appreciated.

 

Thanks in advance!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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.

Announcements



×
×
  • Create New...

Important Information

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