Skip to content

Commit

Permalink
Move CanPlaceOn to item base
Browse files Browse the repository at this point in the history
  • Loading branch information
NeunEinser committed Oct 19, 2024
1 parent 4f18701 commit ea5b96c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 0 additions & 3 deletions java/server/world/item/block/mod.mcdoc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ dispatch mcdoc:block_item_states[%unknown,%none] to struct {

type BlockItemComponents = (
super::ItemBaseComponents |
"can_place_on" |
"block_entity_data" |
"block_state" |
)
Expand All @@ -35,8 +34,6 @@ dispatch minecraft:item_component[%blockitem] to BlockItemComponents
/// An item that can be placed as a block
dispatch minecraft:item[%blockitem] to struct BlockItem {
...super::ItemBase,
/// List of blockstates that this block item can be placed on.
CanPlaceOn?: [#[block_predicate] string],
BlockEntityTag?: BlockEntityData,
/// Blockstate that the placed block will have.
BlockStateTag?: mcdoc:block_item_states[[%parent.id]],
Expand Down
3 changes: 3 additions & 0 deletions java/server/world/item/mod.mcdoc
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@ dispatch minecraft:data_component[use_remainder] to ItemStack
enum(string) ItemBaseComponents {
AttributeModifiers = "attribute_modifiers",
CanBreak = "can_break",
CanPlaceOn = "can_place_on",
CustomData = "custom_data",
CustomModelData = "custom_model_data",
Damage = "damage",
Expand Down Expand Up @@ -371,6 +372,8 @@ struct ItemBase {
Unbreakable?: boolean,
/// List of the block states that can be destroyed by this item when holding it in adventure mode.
CanDestroy?: [#[block_predicate] string],
/// List of blockstates that this block item can be placed on.
CanPlaceOn?: [#[block_predicate] string],
/// Tag that describes the custom model an item will take.
/// Used by the `custom_model_data` model overrides predicate.
/// Has certain restrictions due to float conversion.
Expand Down

0 comments on commit ea5b96c

Please sign in to comment.