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.

Featured Replies

Posted

DISCLAMER: I'm new to Minecraft modding and Java, but I have some general understanding of programming and I've used Python and Lua before.

 

• What I've done till now:

- registered the block

- added textures to the block

- added a relevant item for when dropped

 

• Having problems with:

- making the block drop an item when broken, with a certain tool and tier

 

• Code:

public static final RegistryObject<Block> SOME_ORE = BLOCKS.register("some_ore", () -> new OreBlock(BlockBehaviour.Properties.copy(Blocks.IRON_ORE)));

 

• JSON:

- resources/data/somemod/loot_tables/blocks/some_ore.json

{
    "type": "minecraft:block",
    "pools": [
        {
            "rolls": 1,
            "entries": [
                {
                    "type": "minecraft:item",
                    "name": "somemod:some_ore"
                }
            ]
        }
    ]
}

 

- resources/data/somemod/tags/blocks/needs_stone_tool.json

{
    "replace": false,
    "values": [
        "somemod:some_ore"
    ]
}

 

- resources/data/somemod/tags/blocks/mineable/pickaxe.json

{
    "replace": false,
    "values": [
        "somemod:some_ore"
    ]
}

 

• Description:

When the block is placed and I start hitting it with whatever, (doesn't matter, even if you have efficiency 5 diamond pick and haste 255) is always with the same speed and when broken it doesn't drop the relative item.

 

Forge version: 1.18.1-39.0.5

19 minutes ago, HarryBGamer2570 said:

resources/data/somemod/tags/blocks/needs_stone_tool.json

19 minutes ago, HarryBGamer2570 said:

resources/data/somemod/tags/blocks/mineable/pickaxe.json

these are vanilla tags, you need to put them into the minecraft data folder

  • Author
45 minutes ago, Luis_ST said:

these are vanilla tags, you need to put them into the minecraft data folder

this did work, but only fixed the mining speed problem, but it still doesn't drop the item

2 minutes ago, HarryBGamer2570 said:

this did work, but only fixed the mining speed problem, but it still doesn't drop the item

the loot table looks okay, are you sure you use the correct name of the item you want to drop

  • Author
22 minutes ago, Luis_ST said:

the loot table looks okay, are you sure you use the correct name of the item you want to drop

Oops, my bad, I accidentally put both "loot_tables" and "tags" in the "minecraft" folder. Yes thank you very much.

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...

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.