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

Code of the block:

public class BlockMcbbsWiki extends Block {
    public BlockMcbbsWiki(){
        super((Properties.of(Material.STONE)
                .strength(2.5F, 10.0F)
                .requiresCorrectToolForDrops()));
    }
}

and the loot table (in src/main/resources/data/mcbbswiki/loot_tables/blocks):

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

I want to make BlockMcbbsWiki drops itself if I use pickaxes leveled at least level 3(diamond), or nothing if the tool is not right. 

But now, it drops nothing with any tools. And there isn't a method that can set a harvest level limit in Blocks class.

Please help me.

 

Mod code: https://github.com/QWERTY770/MCBBS-Wiki-Mod

Harvest Level & Harvest Tool were moved to Tags because of vanilla.
They're now requires<Tier>Tool (eg requiresIronTool) and mineable/<Tool> (It's a directory, eg mineable/pickaxe).

  • Author
30 minutes ago, uSkizzik said:

Harvest Level & Harvest Tool were moved to Tags because of vanilla.
They're now requires<Tier>Tool (eg requiresIronTool) and mineable/<Tool> (It's a directory, eg mineable/pickaxe).

Thanks!

 

By the way, could you tell me what's wrong with this custom advancement JSON?

{
  "display": {
    "icon": {
      "item": "mcbbswiki:item_mcbbswiki_chestplate_level1"
    },
    "title": {
      "translate": "advancements.mcbbswiki.armor_level1.title"
    },
    "description": {
      "translate": "advancements.mcbbswiki.armor_level1.description"
    },
    "frame": "goal"
  },
  "parent": "mcbbswiki:ingot",
  "criteria": {
    "armor_level1_1": {
      "trigger": "minecraft:inventory_changed",
      "conditions": {
        "items": [
          {
            "item": "mcbbswiki:item_mcbbswiki_helmet_level1"
          }
        ]
      }
    },
    "armor_level1_2": {
      "trigger": "minecraft:inventory_changed",
      "conditions": {
        "items": [
          {
            "item": "mcbbswiki:item_mcbbswiki_chestplate_level1"
          }
        ]
      }
    },
    "armor_level1_3": {
      "trigger": "minecraft:inventory_changed",
      "conditions": {
        "items": [
          {
            "item": "mcbbswiki:item_mcbbswiki_leggings_level1"
          }
        ]
      }
    },
    "armor_level1_4": {
      "trigger": "minecraft:inventory_changed",
      "conditions": {
        "items": [
          {
            "item": "mcbbswiki:item_mcbbswiki_boots_level1"
          }
        ]
      }
    }
  },
  "requirements": [
    ["armor_level1_1"],
    ["armor_level1_2"],
    ["armor_level1_3"],
    ["armor_level1_4"]
  ],
  "rewards": {
    "loot": [
      "mcbbswiki:advancements/tools_level1"
    ],
    "experience": 100
  }
}

I expect the advancement could be made if I get all the four armors

But actually, when I get any items, I will make the advancement.

That's too strange. Could you help me?

15 minutes ago, QWERTY 52 38 said:

Thanks!

 

By the way, could you tell me what's wrong with this custom advancement JSON?

{
  "display": {
    "icon": {
      "item": "mcbbswiki:item_mcbbswiki_chestplate_level1"
    },
    "title": {
      "translate": "advancements.mcbbswiki.armor_level1.title"
    },
    "description": {
      "translate": "advancements.mcbbswiki.armor_level1.description"
    },
    "frame": "goal"
  },
  "parent": "mcbbswiki:ingot",
  "criteria": {
    "armor_level1_1": {
      "trigger": "minecraft:inventory_changed",
      "conditions": {
        "items": [
          {
            "item": "mcbbswiki:item_mcbbswiki_helmet_level1"
          }
        ]
      }
    },
    "armor_level1_2": {
      "trigger": "minecraft:inventory_changed",
      "conditions": {
        "items": [
          {
            "item": "mcbbswiki:item_mcbbswiki_chestplate_level1"
          }
        ]
      }
    },
    "armor_level1_3": {
      "trigger": "minecraft:inventory_changed",
      "conditions": {
        "items": [
          {
            "item": "mcbbswiki:item_mcbbswiki_leggings_level1"
          }
        ]
      }
    },
    "armor_level1_4": {
      "trigger": "minecraft:inventory_changed",
      "conditions": {
        "items": [
          {
            "item": "mcbbswiki:item_mcbbswiki_boots_level1"
          }
        ]
      }
    }
  },
  "requirements": [
    ["armor_level1_1"],
    ["armor_level1_2"],
    ["armor_level1_3"],
    ["armor_level1_4"]
  ],
  "rewards": {
    "loot": [
      "mcbbswiki:advancements/tools_level1"
    ],
    "experience": 100
  }
}

I expect the advancement could be made if I get all the four armors

But actually, when I get any items, I will make the advancement.

That's too strange. Could you help me?

Never dealt with advancements before.
Also, I recommend using data gen.

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.