Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 7082267

Browse filesBrowse files
committed
Split commands out into other functions to reduce the number of execute commands. This implements issue #3
1 parent c229352 commit 7082267
Copy full SHA for 7082267
Expand file treeCollapse file tree

24 files changed

+110
-131
lines changed
+11Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
data modify entity @e[type=item,distance=..1,sort=nearest,limit=1] Item.id set from storage custom_blocks:drop_block id
2+
data modify entity @e[type=item,distance=..1,sort=nearest,limit=1] Item.tag.display.Name set from storage custom_blocks:drop_block DisplayName
3+
data modify entity @e[type=item,distance=..1,sort=nearest,limit=1] Item.tag.display.Lore set from storage custom_blocks:drop_block Lore
4+
data modify entity @e[type=item,distance=..1,sort=nearest,limit=1] Item.tag.CustomModelDataVertical set from storage custom_blocks:drop_block CustomModelDataVertical
5+
data modify entity @e[type=item,distance=..1,sort=nearest,limit=1] Item.tag.CustomModelData set from storage custom_blocks:drop_block CustomModelData
6+
data modify entity @e[type=item,distance=..1,sort=nearest,limit=1] Item.tag.BlockEntityTag.Lock set value "CustomBlocks:Block"
7+
data modify entity @e[type=item,distance=..1,sort=nearest,limit=1] Item.tag.BlockProperties.CustomName set from storage custom_blocks:drop_block CustomName
8+
data modify entity @e[type=item,distance=..1,sort=nearest,limit=1] Item.tag.BlockProperties.Tags set from storage custom_blocks:drop_block Tags
9+
data modify entity @e[type=item,distance=..1,sort=nearest,limit=1] Item.tag.BlockProperties.SetblockCommand set from storage custom_blocks:drop_block SetblockCommand
10+
11+
execute if block ~ ~ ~ air run kill @s
+9Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
data modify storage custom_blocks:drop_block id set from entity @s Item.id
2+
data modify storage custom_blocks:drop_block DisplayName set from entity @s Item.tag.display.CustomName
3+
data modify storage custom_blocks:drop_block Lore set from entity @s Item.tag.display.Lore
4+
data modify storage custom_blocks:drop_block CustomModelDataVertical set from entity @s Item.tag.CustomModelDataVertical
5+
data modify storage custom_blocks:drop_block CustomModelData set from entity @s Item.tag.CustomModelData
6+
data modify storage custom_blocks:drop_block CustomModelData set from entity @s Item.tag.CustomModelDataNorm
7+
data modify storage custom_blocks:drop_block CustomName set from entity @s CustomName
8+
data modify storage custom_blocks:drop_block Tags set from entity @s Item.tag.BlockProperties.Tags
9+
data modify storage custom_blocks:drop_block SetblockCommand set from entity @s Item.tag.BlockProperties.SetblockCommand

‎data/custom_blocks/functions/break/spawn_drop.mcfunction

Copy file name to clipboardExpand all lines: data/custom_blocks/functions/break/spawn_drop.mcfunction
+2-31Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -10,36 +10,7 @@ data remove storage custom_blocks:drop_block SetblockCommand
1010

1111
# Check If Custom Block Has Been Broken Then Store Block Info In Storage
1212
execute as @e[type=glow_item_frame,tag=customBlock] at @s if block ~ ~ ~ air run tag @s add spawn_drop
13-
execute as @e[type=glow_item_frame,tag=customBlock,tag=spawn_drop,predicate=custom_blocks:is_placer] at @s run data modify storage custom_blocks:drop_block id set from entity @s Item.id
14-
execute as @e[type=glow_item_frame,tag=customBlock,tag=spawn_drop,predicate=custom_blocks:is_placer] at @s run data modify storage custom_blocks:drop_block DisplayName set from entity @s Item.tag.display.CustomName
15-
execute as @e[type=glow_item_frame,tag=customBlock,tag=spawn_drop,predicate=custom_blocks:is_placer] at @s run data modify storage custom_blocks:drop_block Lore set from entity @s Item.tag.display.Lore
16-
execute as @e[type=glow_item_frame,tag=customBlock,tag=spawn_drop,predicate=custom_blocks:is_placer] at @s run data modify storage custom_blocks:drop_block CustomModelDataVertical set from entity @s Item.tag.CustomModelDataVertical
17-
execute as @e[type=glow_item_frame,tag=customBlock,tag=spawn_drop,predicate=custom_blocks:is_placer] at @s run data modify storage custom_blocks:drop_block CustomModelData set from entity @s Item.tag.CustomModelData
18-
execute as @e[type=glow_item_frame,tag=customBlock,tag=spawn_drop,predicate=custom_blocks:is_placer] at @s run data modify storage custom_blocks:drop_block CustomModelData set from entity @s Item.tag.CustomModelDataNorm
19-
execute as @e[type=glow_item_frame,tag=customBlock,tag=spawn_drop,predicate=custom_blocks:is_placer] at @s run data modify storage custom_blocks:drop_block CustomName set from entity @s CustomName
20-
execute as @e[type=glow_item_frame,tag=customBlock,tag=spawn_drop,predicate=custom_blocks:is_placer] at @s run data modify storage custom_blocks:drop_block Tags set from entity @s Item.tag.BlockProperties.Tags
21-
execute as @e[type=glow_item_frame,tag=customBlock,tag=spawn_drop,predicate=custom_blocks:is_placer] at @s run data modify storage custom_blocks:drop_block SetblockCommand set from entity @s Item.tag.BlockProperties.SetblockCommand
13+
execute as @e[type=glow_item_frame,tag=customBlock,tag=spawn_drop,predicate=custom_blocks:is_placer] at @s run function custom_blocks:break/copy_block_info_to_storage
2214

2315
# Apply Block Info To Item
24-
execute as @e[type=glow_item_frame,tag=customBlock,tag=spawn_drop] at @s run data modify entity @e[type=item,distance=..1,sort=nearest,limit=1] Item.id set from storage custom_blocks:drop_block id
25-
execute as @e[type=glow_item_frame,tag=customBlock,tag=spawn_drop] at @s run data modify entity @e[type=item,distance=..1,sort=nearest,limit=1] Item.tag.display.Name set from storage custom_blocks:drop_block DisplayName
26-
execute as @e[type=glow_item_frame,tag=customBlock,tag=spawn_drop] at @s run data modify entity @e[type=item,distance=..1,sort=nearest,limit=1] Item.tag.display.Lore set from storage custom_blocks:drop_block Lore
27-
# Set Model If Normal
28-
execute as @e[type=glow_item_frame,tag=customBlock,tag=spawn_drop,tag=!up,tag=!down] at @s run data modify entity @e[type=item,distance=..1,sort=nearest,limit=1] Item.tag.CustomModelDataVertical set from storage custom_blocks:drop_block CustomModelDataVertical
29-
execute as @e[type=glow_item_frame,tag=customBlock,tag=spawn_drop,tag=!up,tag=!down] at @s run data modify entity @e[type=item,distance=..1,sort=nearest,limit=1] Item.tag.CustomModelData set from storage custom_blocks:drop_block CustomModelData
30-
# Set Model To Normal If Up
31-
execute as @e[type=glow_item_frame,tag=customBlock,tag=spawn_drop,tag=up,tag=!down] at @s run data modify entity @e[type=item,distance=..1,sort=nearest,limit=1] Item.tag.CustomModelDataVertical set from storage custom_blocks:drop_block CustomModelDataVertical
32-
execute as @e[type=glow_item_frame,tag=customBlock,tag=spawn_drop,tag=up,tag=!down] at @s run data modify entity @e[type=item,distance=..1,sort=nearest,limit=1] Item.tag.CustomModelData set from storage custom_blocks:drop_block CustomModelData
33-
# Set Model To Normal If Down
34-
execute as @e[type=glow_item_frame,tag=customBlock,tag=spawn_drop,tag=!up,tag=down] at @s run data modify entity @e[type=item,distance=..1,sort=nearest,limit=1] Item.tag.CustomModelDataVertical set from storage custom_blocks:drop_block CustomModelDataVertical
35-
execute as @e[type=glow_item_frame,tag=customBlock,tag=spawn_drop,tag=!up,tag=down] at @s run data modify entity @e[type=item,distance=..1,sort=nearest,limit=1] Item.tag.CustomModelData set from storage custom_blocks:drop_block CustomModelData
36-
37-
execute as @e[type=glow_item_frame,tag=customBlock,tag=spawn_drop] at @s run data modify entity @e[type=item,distance=..1,sort=nearest,limit=1] Item.tag.BlockEntityTag.Lock set value "CustomBlocks:Block"
38-
execute as @e[type=glow_item_frame,tag=customBlock,tag=spawn_drop] at @s run data modify entity @e[type=item,distance=..1,sort=nearest,limit=1] Item.tag.BlockProperties.CustomName set from storage custom_blocks:drop_block CustomName
39-
execute as @e[type=glow_item_frame,tag=customBlock,tag=spawn_drop] at @s run data modify entity @e[type=item,distance=..1,sort=nearest,limit=1] Item.tag.BlockProperties.Tags set from storage custom_blocks:drop_block Tags
40-
execute as @e[type=glow_item_frame,tag=customBlock,tag=spawn_drop] at @s run data modify entity @e[type=item,distance=..1,sort=nearest,limit=1] Item.tag.BlockProperties.SetblockCommand set from storage custom_blocks:drop_block SetblockCommand
41-
42-
# Kill Glow Item Frame
43-
execute as @e[type=glow_item_frame,tag=customBlock,tag=spawn_drop] at @s if block ~ ~ ~ air run kill @s
44-
45-
16+
execute as @e[type=glow_item_frame,tag=customBlock,tag=spawn_drop] at @s run function custom_blocks:break/apply_block_info_to_item
-2Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
11
# Checks if the item frame has a custom block placed by the player in it then updates the item
22
execute as @e[type=#custom_blocks:item_frames,tag=!updated,predicate=custom_blocks:frame_item_player_placed] run function custom_blocks:item_frame/update_item_in_frame
3-
4-
+1-3Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Resets compare storage
22
data remove storage custom_blocks:nbt_compare
33

4-
# Get nbt tags to compare and save result to #match in cbCompareResult
4+
# Get nbt tags to compare and save result to #match in cbCompareResult
55
execute at @e[type=#custom_blocks:item_frames,tag=updated,predicate=!custom_blocks:frame_item_player_placed] as @e[type=item,predicate=custom_blocks:is_placer,distance=..3,limit=1] run data modify storage custom_blocks:nbt_compare nbt set from entity @s Item.tag.CustomModelData
66
execute store success score #match cbCompareResult at @e[type=#custom_blocks:item_frames,tag=updated,predicate=!custom_blocks:frame_item_player_placed] as @e[type=item,predicate=custom_blocks:is_placer,distance=..3,limit=1] run data modify storage custom_blocks:nbt_compare nbt set from entity @s Item.tag.BlockProperties.FrameModel
77

@@ -11,5 +11,3 @@ execute if score #match cbCompareResult matches 0 at @e[type=#custom_blocks:item
1111
# Reset cbCompareResult and remove tag from item frame
1212
scoreboard players set #match cbCompareResult 1
1313
execute as @e[type=#custom_blocks:item_frames,tag=updated,predicate=!custom_blocks:frame_item_player_placed] run tag @s remove updated
14-
15-

‎data/custom_blocks/functions/item_frame/update_item_in_frame.mcfunction

Copy file name to clipboardExpand all lines: data/custom_blocks/functions/item_frame/update_item_in_frame.mcfunction
-2Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,3 @@ data modify entity @s Item.tag.CustomModelData set from entity @s Item.tag.Block
66
data modify entity @s Item.tag.displayName set from entity @s Item.tag.display.Name
77
data modify entity @s Item.tag.display.Name set value ""
88
tag @s add updated
9-
10-

‎data/custom_blocks/functions/item_frame/update_item_out_frame.mcfunction

Copy file name to clipboardExpand all lines: data/custom_blocks/functions/item_frame/update_item_out_frame.mcfunction
+1-3Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,4 @@
44
data modify entity @s Item.tag.CustomModelData set from entity @s Item.tag.CustomModelDataNorm
55
data modify entity @s Item.tag.display.Name set from entity @s Item.tag.displayName
66
data remove entity @s Item.tag.CustomModelDataNorm
7-
data remove entity @s Item.tag.displayName
8-
9-
7+
data remove entity @s Item.tag.displayName

‎data/custom_blocks/functions/main.mcfunction

Copy file name to clipboardExpand all lines: data/custom_blocks/functions/main.mcfunction
-2Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,3 @@ function custom_blocks:break/spawn_drop
33

44
function custom_blocks:item_frame/check_add_item_from_frame
55
function custom_blocks:item_frame/check_removed_item_from_frame
6-
7-
+16Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
data modify entity @s Item.id set from storage custom_blocks:current_block id
2+
data modify entity @s Item.tag.display.CustomName set from storage custom_blocks:current_block DisplayName
3+
data modify entity @s Item.tag.display.Lore set from storage custom_blocks:current_block Lore
4+
5+
# Set Model If Normal
6+
execute as @s[tag=!up,tag=!down] run function custom_blocks:place/apply_model_normal
7+
8+
# Set Model If Vertical
9+
execute as @s[tag=up,tag=!down] run function custom_blocks:place/apply_model_vertical
10+
execute as @s[tag=!up,tag=down] run function custom_blocks:place/apply_model_vertical
11+
12+
data modify entity @s Item.tag.BlockEntityTag.Lock set value "CustomBlocks:Block"
13+
data modify entity @s Items.tag.BlockProperties.CustomName set from storage custom_blocks:current_block CustomName
14+
data modify entity @s Items.tag.BlockProperties.Tags set from storage custom_blocks:current_block Tags
15+
data modify entity @s CustomName set from storage custom_blocks:current_block CustomName
16+
data modify entity @s Item.tag.BlockProperties.SetblockCommand set from storage custom_blocks:current_block SetblockCommand
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
data modify entity @s Item.tag.CustomModelData set from storage custom_blocks:current_block CustomModelData
2+
data modify entity @s Item.tag.CustomModelDataVertical set from storage custom_blocks:current_block CustomModelDataVertical
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
data modify entity @s Item.tag.CustomModelDataNorm set from storage custom_blocks:current_block CustomModelData
2+
data modify entity @s Item.tag.CustomModelData set from storage custom_blocks:current_block CustomModelDataVertical

‎data/custom_blocks/functions/place/check_for_block.mcfunction

Copy file name to clipboardExpand all lines: data/custom_blocks/functions/place/check_for_block.mcfunction
-2Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,3 @@ execute at @a run fill ~5 ~6 ~5 ~-5 ~-4 ~-5 command_block[facing=east]{auto:1b,C
55
execute at @a run fill ~5 ~6 ~5 ~-5 ~-4 ~-5 command_block[facing=west]{auto:1b,Command:"function custom_blocks:place/place_block"} replace #custom_blocks:placers[facing=west]{Lock:"CustomBlocks:Block"}
66
execute at @a run fill ~5 ~6 ~5 ~-5 ~-4 ~-5 command_block[facing=up]{auto:1b,Command:"function custom_blocks:place/place_block"} replace #custom_blocks:placers[facing=up]{Lock:"CustomBlocks:Block"}
77
execute at @a run fill ~5 ~6 ~5 ~-5 ~-4 ~-5 command_block[facing=down]{auto:1b,Command:"function custom_blocks:place/place_block"} replace #custom_blocks:placers[facing=down]{Lock:"CustomBlocks:Block"}
8-
9-

‎data/custom_blocks/functions/place/place_block.mcfunction

Copy file name to clipboardExpand all lines: data/custom_blocks/functions/place/place_block.mcfunction
+8-27Lines changed: 8 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,18 @@
11
# Places The Base Block Armor Stand
2-
execute if block ~ ~ ~ command_block[facing=north] align xyz positioned ~0.5 ~ ~0.5 run summon glow_item_frame ~ ~ ~ {Fixed:1b,Invisible:1b,Item:{id:"minecraft:stone",Count:1b},Facing:2b,Tags:["customBlock","placing"]}
3-
execute if block ~ ~ ~ command_block[facing=south] align xyz positioned ~0.5 ~ ~0.5 run summon glow_item_frame ~ ~ ~ {Fixed:1b,Invisible:1b,Item:{id:"minecraft:stone",Count:1b},Facing:3b,Tags:["customBlock","placing"]}
4-
execute if block ~ ~ ~ command_block[facing=east] align xyz positioned ~0.5 ~ ~0.5 run summon glow_item_frame ~ ~ ~ {Fixed:1b,Invisible:1b,Item:{id:"minecraft:stone",Count:1b},Facing:5b,Tags:["customBlock","placing"]}
5-
execute if block ~ ~ ~ command_block[facing=west] align xyz positioned ~0.5 ~ ~0.5 run summon glow_item_frame ~ ~ ~ {Fixed:1b,Invisible:1b,Item:{id:"minecraft:stone",Count:1b},Facing:4b,Tags:["customBlock","placing"]}
6-
execute if block ~ ~ ~ command_block[facing=up] align xyz positioned ~0.5 ~ ~0.5 run summon glow_item_frame ~ ~ ~ {Fixed:1b,Invisible:1b,Item:{id:"minecraft:stone",Count:1b},Facing:0b,Tags:["customBlock","placing","up"]}
7-
execute if block ~ ~ ~ command_block[facing=down] align xyz positioned ~0.5 ~ ~0.5 run summon glow_item_frame ~ ~ ~ {Fixed:1b,Invisible:1b,Item:{id:"minecraft:stone",Count:1b},Facing:1b,Tags:["customBlock","placing","down"]}
2+
execute if block ~ ~ ~ command_block[facing=north] align xyz positioned ~0.5 ~ ~0.5 run summon glow_item_frame ~ ~ ~ {Fixed:1b,Invisible:1b,Silent:1b,Item:{id:"minecraft:stone",Count:1b},Facing:2b,Tags:["customBlock","placing"]}
3+
execute if block ~ ~ ~ command_block[facing=south] align xyz positioned ~0.5 ~ ~0.5 run summon glow_item_frame ~ ~ ~ {Fixed:1b,Invisible:1b,Silent:1b,Item:{id:"minecraft:stone",Count:1b},Facing:3b,Tags:["customBlock","placing"]}
4+
execute if block ~ ~ ~ command_block[facing=east] align xyz positioned ~0.5 ~ ~0.5 run summon glow_item_frame ~ ~ ~ {Fixed:1b,Invisible:1b,Silent:1b,Item:{id:"minecraft:stone",Count:1b},Facing:5b,Tags:["customBlock","placing"]}
5+
execute if block ~ ~ ~ command_block[facing=west] align xyz positioned ~0.5 ~ ~0.5 run summon glow_item_frame ~ ~ ~ {Fixed:1b,Invisible:1b,Silent:1b,Item:{id:"minecraft:stone",Count:1b},Facing:4b,Tags:["customBlock","placing"]}
6+
execute if block ~ ~ ~ command_block[facing=up] align xyz positioned ~0.5 ~ ~0.5 run summon glow_item_frame ~ ~ ~ {Fixed:1b,Invisible:1b,Silent:1b,Item:{id:"minecraft:stone",Count:1b},Facing:0b,Tags:["customBlock","placing","up"]}
7+
execute if block ~ ~ ~ command_block[facing=down] align xyz positioned ~0.5 ~ ~0.5 run summon glow_item_frame ~ ~ ~ {Fixed:1b,Invisible:1b,Silent:1b,Item:{id:"minecraft:stone",Count:1b},Facing:1b,Tags:["customBlock","placing","down"]}
88

99
# Updates The Base Block To Include All The Block Info From Storage
10-
execute as @e[type=glow_item_frame,tag=placing] at @s run data modify entity @s Item.id set from storage custom_blocks:current_block id
11-
execute as @e[type=glow_item_frame,tag=placing] at @s run data modify entity @s Item.tag.display.CustomName set from storage custom_blocks:current_block DisplayName
12-
execute as @e[type=glow_item_frame,tag=placing] at @s run data modify entity @s Item.tag.display.Lore set from storage custom_blocks:current_block Lore
13-
# Set Model If Normal
14-
execute as @e[type=glow_item_frame,tag=placing,tag=!up,tag=!down] at @s run data modify entity @s Item.tag.CustomModelData set from storage custom_blocks:current_block CustomModelData
15-
execute as @e[type=glow_item_frame,tag=placing,tag=!up,tag=!down] at @s run data modify entity @s Item.tag.CustomModelDataVertical set from storage custom_blocks:current_block CustomModelDataVertical
16-
# Set Model If Facing Up
17-
execute as @e[type=glow_item_frame,tag=placing,tag=up,tag=!down] at @s run data modify entity @s Item.tag.CustomModelDataNorm set from storage custom_blocks:current_block CustomModelData
18-
execute as @e[type=glow_item_frame,tag=placing,tag=up,tag=!down] at @s run data modify entity @s Item.tag.CustomModelData set from storage custom_blocks:current_block CustomModelDataVertical
19-
# Set Model If Facing Down
20-
execute as @e[type=glow_item_frame,tag=placing,tag=!up,tag=down] at @s run data modify entity @s Item.tag.CustomModelDataNorm set from storage custom_blocks:current_block CustomModelData
21-
execute as @e[type=glow_item_frame,tag=placing,tag=!up,tag=down] at @s run data modify entity @s Item.tag.CustomModelData set from storage custom_blocks:current_block CustomModelDataVertical
22-
23-
execute as @e[type=glow_item_frame,tag=placing] at @s run data modify entity @s Item.tag.BlockEntityTag.Lock set value "CustomBlocks:Block"
24-
execute as @e[type=glow_item_frame,tag=placing] at @s run data modify entity @s Items.tag.BlockProperties.CustomName set from storage custom_blocks:current_block CustomName
25-
execute as @e[type=glow_item_frame,tag=placing] at @s run data modify entity @s Items.tag.BlockProperties.Tags set from storage custom_blocks:current_block Tags
26-
execute as @e[type=glow_item_frame,tag=placing] at @s run data modify entity @s CustomName set from storage custom_blocks:current_block CustomName
27-
execute as @e[type=glow_item_frame,tag=placing] at @s run data modify entity @s Item.tag.BlockProperties.SetblockCommand set from storage custom_blocks:current_block SetblockCommand
10+
execute as @e[type=glow_item_frame,tag=placing] at @s run function custom_blocks:place/apply_block_info_from_storage
2811

2912
# Remove Temporary Tag And Set Base Block
3013
setblock ~ ~ ~ stone
3114
setblock ~ ~ ~ command_block{Command:""}
32-
execute as @e[type=glow_item_frame,tag=placing] at @s run data modify block ~ ~ ~ Command set from storage custom_blocks:current_block SetblockCommand
33-
execute as @e[type=glow_item_frame,tag=placing] at @s run data merge block ~ ~ ~ {auto:1b}
34-
execute as @e[type=glow_item_frame,tag=placing] at @s run tag @e[type=glow_item_frame,tag=placing] remove placing
15+
execute as @e[type=glow_item_frame,tag=placing] at @s run function custom_blocks:place/set_base_block
3516

3617
# Resets Storage After Player Places Custom Block Or Deselects It
3718
execute as @a[gamemode=!creative,predicate=!custom_blocks:selected_placer] run function custom_blocks:place/reset_storage

‎data/custom_blocks/functions/place/reset_storage.mcfunction

Copy file name to clipboardExpand all lines: data/custom_blocks/functions/place/reset_storage.mcfunction
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,3 @@ data remove storage custom_blocks:current_block CustomModelDataVertical
77
data remove storage custom_blocks:current_block CustomName
88
data remove storage custom_blocks:current_block Tags
99
data remove storage custom_blocks:current_block SetblockCommand
10-
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
data modify block ~ ~ ~ Command set from storage custom_blocks:current_block SetblockCommand
2+
data merge block ~ ~ ~ {auto:1b}
3+
tag @s remove placing

‎data/custom_blocks/functions/place/set_storage.mcfunction

Copy file name to clipboardExpand all lines: data/custom_blocks/functions/place/set_storage.mcfunction
-3Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,5 @@ data modify storage custom_blocks:current_block CustomName set from entity @s Se
1111
data modify storage custom_blocks:current_block Tags set from entity @s SelectedItem.tag.BlockProperties.Tags
1212
data modify storage custom_blocks:current_block SetblockCommand set from entity @s SelectedItem.tag.BlockProperties.SetblockCommand
1313

14-
1514
# Runs The Check Block Function
1615
function custom_blocks:place/check_for_block
17-
18-
+5-5Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"condition": "entity_properties",
3-
"entity": "this",
4-
"predicate": {
5-
"nbt": "{Item:{tag:{BlockEntityTag:{Lock:\"CustomBlocks:Block\"}}}}"
6-
}
7-
}
3+
"entity": "this",
4+
"predicate": {
5+
"nbt": "{Item:{tag:{BlockEntityTag:{Lock:\"CustomBlocks:Block\"}}}}"
6+
}
7+
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.