Players in Adventure mode can use some items even without CanPlaceOn tag
The bug
Players in Adventure mode can use some items which create entities on use even if the items do not have the CanPlaceOn tag. This is inconsistent with other items like armor stands, paintings and item frames which require this tag.
Affected items
| Item | Note |
|---|---|
| fireworks | - |
| minecart | Could be used for rail type distinction |
| boat | |
| lead |
Steps to reproduce
- Switch to Adventure mode
/gamemode adventure
- Give yourself one of the affected items
- Try to place them
Created Issue:
Players in adventuremode can place firework rockets
Players in adventuremode are able to place firework rockets wherever they please without them having the "canPlaceOn" tag.
Steps to reproduce:
- go into adventure mode
- /give @p minecraft:fireworks 64
- place them wherever.
Players inadventuremode canplace firework rocketsPlayers in Adventure mode can use some items even without CanPlaceOn tag
Players in adventuremode are able to place firework rockets wherever they please without them having the "canPlaceOn" tag.
Steps to reproduce:
- go into adventure mode
- /give @p minecraft:fireworks 64
- place them wherever.
The bug
Players in Adventure mode can use some items which create entities on use even if the items do not have the CanPlaceOn tag. This is inconsistent with other items like armor stands, paintings and item frames which require this tag.
Affected items
Item Note fireworks - minecart Could be used for rail type distinction boat Problem: Would probably not work with water
lead Problem: Player may not have lead item anymore when using it on a fence
Steps to reproduce
- Switch to Adventure mode
/gamemode adventure- Give yourself one of the affected items
- Try to place them
Water and lava buckets can be placed at the edge of the reach distance in adventure mode. 18w20c
relates to
The bug
Use of items from offhand with uses (potions food bows etc..) require CanPlaceOn NBT tags to be useable whilst looking at blocks in adventure mode.
Additionally when these items have the required NBT to be use-able on, if being used from the offhand slot they also require an item in the players mainhand that also has the required CanPlaceOn NBT.
Despite 1.12 items with no NBT would always be useable despite their NBT in any case while in adventure mode.
The current functionality in the snapshots would also mean that CanPlaceOn is more akin to being CanUseOn rather than only handling placing which would still be inconsistent as you can use these items to interact with noteblocks chests and any other items still.
This could be a problem due to MC-116254.
How to reproduce
- Give yourself a standard item with a use that is not placing related, such as a golden apple or potion
/give @s golden_apple
- Attempt to eat the apple while in adventure mode and looking at a block
- Now give yourself the same item but with CanPlaceOn NBT for the blocks you are looking at
/give @s golden_apple{CanPlaceOn:["minecraft:stone"]} - Note that you can now consume the apple while looking at the block
- Now place the apple in your offhand slot and place any item without a use into your mainhand, such as a stick or diamond
- Switching between mainhand and offhand note that you can only consume the apple while your mainhand is empty
- Now give yourself an item without a use with CanPlaceOn NBT for the blocks you are looking at
/give @s stick{CanPlaceOn:["minecraft:stone"]} - Note that you can again consume the apple with the new NBT'd stick in your mainhand
Additionally the same results will be return with other items that have right click uses when used in place of the stick in this example such as a bow, drinkable/throwable potion though in previous versions it would be expected that you would be using the mainhanded item initially anyway.
This is correct behavior, the fix of MC-116254.
MC-116254 was fixed.
They're not blocks.
Neither is flint and steel, and they require it.
However, flint and steel places a fire block. It might be better to compare it with armor stands which cannot be placed in Adventure mode.
Should this report then be made more generic to contain boats and minecarts as well (in theory leads too, but once you clicked a mob you do not have the item anymore, therefor CanPlaceOn could not be used)? This is partwise described in
MC-2978.Go ahead.
Seems fixed by 17w47b.