Replace the item crafted with a tag [duplicate]

Replace the item crafted with a tag [duplicate] - Screws and repair tools in box near hammer

I made a map that will come out very soon but I have a problem: When the player crafted a crafting table, it cannot be placed!

And also when he/she crafted it, I would like to replace the crafted block with a crafting table with CanPlaceOn.

I think this is used by other maps like The Useless Button.



Best Answer

Create a scoreboard once. It automaticly increments when a player crafts a crafting table:

/scoreboard objectives add craftedTable stat.craftItem.minecraft.crafting_table

Method 1:

Put the following command into repeating command block:

/give @a[score_craftedTable_min=1] minecraft:crafting_table 1 1 {CanPlaceOn:["minecraft:stone"]}

(Have a look at the 1 1!)

Put a chain command block after it:

/scoreboard players remove @a[score_craftedTable_min=1] craftedTable 1

Then another one with this command (to remove the old crafting tables):

/clear @a minecraft:crafting_table 0

The setup should be like that:

enter image description here

The problem is, that your item has no texture:

enter image description here

Everything else will work fine!

Method 2:

(Used in TheUselessButton)

The problems:

  • No multiplayer support
  • Only one item obtainable
  • Bug: You can obtain the item 2 times: One with Can be played On tag and the original (Exists in TheUselessButton)

enter image description here

Put the following command into repeating command block:

/testfor @p[score_craftedTable_min=1]

Then two chain command blocks set on Conditional

1.

/clear @p minecraft:crafting_table

2.

/give @p minecraft:crafting_table

3.

/scoreboard players reset @a[score_craftedTable_min=1] craftedTable



Pictures about "Replace the item crafted with a tag [duplicate]"

Replace the item crafted with a tag [duplicate] - Anonymous man installing window in room
Replace the item crafted with a tag [duplicate] - Crop craftswoman in casual wear sitting at old fashioned sewing machine and stitching pieces of fabric while working in workshop
Replace the item crafted with a tag [duplicate] - Unrecognizable professional male master using cordless screwdriver to install metal hinge on wooden window in light room during repair works



How do you duplicate items in Minecraft with commands?

Open the inventory. Click on the item you want to duplicate to pick it up. Hold your mouse's scroll wheel button and drag it over empty inventory slots to duplicate it as stacks in your inventory.



DUPING ITEMS IN POE!? -How to Duplicate Items ft. Einhar🔥 (Path of Exile Betrayal League Crafting)




Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.

Images: Anete Lusina, Ksenia Chernaya, Andrea Piacquadio, Ksenia Chernaya