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 669cc2e

Browse filesBrowse files
committed
Removed remaining CustomModelDataVertical stuff, removed support for CustomName as its pointless, implemented support for Tags, and made 6 directional blocks only require 1 model instead of 3
1 parent 8a0b09d commit 669cc2e
Copy full SHA for 669cc2e

9 files changed

+17
-43
lines changed
+1-3Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
data modify entity @e[type=item,distance=..1,sort=nearest,limit=1] Item.id set from storage custom_blocks:drop_block id
22
data modify entity @e[type=item,distance=..1,sort=nearest,limit=1] Item.tag.display.Name set from storage custom_blocks:drop_block DisplayName
33
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
54
data modify entity @e[type=item,distance=..1,sort=nearest,limit=1] Item.tag.CustomModelData set from storage custom_blocks:drop_block CustomModelData
65
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
86
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
7+
data modify entity @e[type=item,distance=..1,sort=nearest,limit=1] Item.tag.BlockProperties.BaseBlock set from storage custom_blocks:drop_block BaseBlock
108

119
execute if block ~ ~ ~ air run kill @s

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

Copy file name to clipboardExpand all lines: data/custom_blocks/functions/break/copy_block_info_to_storage.mcfunction
+1-3Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,5 @@ data modify storage custom_blocks:drop_block id set from entity @s item.id
22
data modify storage custom_blocks:drop_block DisplayName set from entity @s item.tag.display.CustomName
33
data modify storage custom_blocks:drop_block Lore set from entity @s item.tag.display.Lore
44
data modify storage custom_blocks:drop_block CustomModelData set from entity @s item.tag.CustomModelData
5-
data modify storage custom_blocks:drop_block CustomModelData set from entity @s item.tag.CustomModelDataNorm
6-
data modify storage custom_blocks:drop_block CustomName set from entity @s CustomName
75
data modify storage custom_blocks:drop_block Tags set from entity @s item.tag.BlockProperties.Tags
8-
data modify storage custom_blocks:drop_block SetblockCommand set from entity @s item.tag.BlockProperties.SetblockCommand
6+
data modify storage custom_blocks:drop_block BaseBlock set from entity @s item.tag.BlockProperties.BaseBlock

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

Copy file name to clipboardExpand all lines: data/custom_blocks/functions/break/spawn_drop.mcfunction
+1-3Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@ data remove storage custom_blocks:drop_block id
33
data remove storage custom_blocks:drop_block DisplayName
44
data remove storage custom_blocks:drop_block Lore
55
data remove storage custom_blocks:drop_block CustomModelData
6-
data remove storage custom_blocks:drop_block CustomModelDataVertical
7-
data remove storage custom_blocks:drop_block CustomName
86
data remove storage custom_blocks:drop_block Tags
9-
data remove storage custom_blocks:drop_block SetblockCommand
7+
data remove storage custom_blocks:drop_block BaseBlock
108

119
# Check If Custom Block Has Been Broken Then Store Block Info In Storage
1210
execute as @e[type=item_display,tag=customBlock] at @s if block ~ ~ ~ air run tag @s add spawn_drop

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

Copy file name to clipboardExpand all lines: data/custom_blocks/functions/place/apply_block_info_from_storage.mcfunction
+4-5Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@ data modify entity @s item.tag.display.CustomName set from storage custom_blocks
33
data modify entity @s item.tag.display.Lore set from storage custom_blocks:current_block Lore
44

55
# Set Model
6-
execute as @s run function custom_blocks:place/apply_model
7-
6+
data modify entity @s item.tag.CustomModelData set from storage custom_blocks:current_block CustomModelData
87
data modify entity @s item.tag.BlockEntityTag.Lock set value "CustomBlocks:Block"
9-
data modify entity @s item.tag.BlockProperties.CustomName set from storage custom_blocks:current_block CustomName
108
data modify entity @s item.tag.BlockProperties.Tags set from storage custom_blocks:current_block Tags
11-
data modify entity @s CustomName set from storage custom_blocks:current_block CustomName
12-
data modify entity @s item.tag.BlockProperties.SetblockCommand set from storage custom_blocks:current_block SetblockCommand
9+
data modify entity @s Tags set from storage custom_blocks:current_block Tags
10+
tag @s add customBlock
11+
data modify entity @s item.tag.BlockProperties.BaseBlock set from storage custom_blocks:current_block BaseBlock

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

Copy file name to clipboardExpand all lines: data/custom_blocks/functions/place/apply_model.mcfunction
-13Lines changed: 0 additions & 13 deletions
This file was deleted.
+7-8Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
# Places The Base Block Armor Stand
2-
execute if block ~ ~ ~ command_block[facing=north] align xyz positioned ~0.5 ~0.5 ~0.5 summon item_display run data merge entity @s {item:{id:"minecraft:stone",Count:1b},brightness:{block:0,sky:15},transformation:{scale:[1.003,1.003,1.003]},Rotation:[-180.0f,0.0f],Tags:["customBlock","placing"]}
3-
execute if block ~ ~ ~ command_block[facing=south] align xyz positioned ~0.5 ~0.5 ~0.5 summon item_display run data merge entity @s {item:{id:"minecraft:stone",Count:1b},brightness:{block:0,sky:15},transformation:{scale:[1.003,1.003,1.003]},Rotation:[0.0f,0.0f],Tags:["customBlock","placing"]}
4-
execute if block ~ ~ ~ command_block[facing=east] align xyz positioned ~0.5 ~0.5 ~0.5 summon item_display run data merge entity @s {item:{id:"minecraft:stone",Count:1b},brightness:{block:0,sky:15},transformation:{scale:[1.003,1.003,1.003]},Rotation:[-90.0f,0.0f],Tags:["customBlock","placing"]}
5-
execute if block ~ ~ ~ command_block[facing=west] align xyz positioned ~0.5 ~0.5 ~0.5 summon item_display run data merge entity @s {item:{id:"minecraft:stone",Count:1b},brightness:{block:0,sky:15},transformation:{scale:[1.003,1.003,1.003]},Rotation:[90.0f,0.0f],Tags:["customBlock","placing"]}
6-
execute if block ~ ~ ~ command_block[facing=up] align xyz positioned ~0.5 ~0.5 ~0.5 summon item_display run data merge entity @s {item:{id:"minecraft:stone",Count:1b},brightness:{block:0,sky:15},transformation:{scale:[1.003,1.003,1.003]},Rotation:[0.0f,0.0f],Tags:["customBlock","placing","up"]}
7-
execute if block ~ ~ ~ command_block[facing=down] align xyz positioned ~0.5 ~0.5 ~0.5 summon item_display run data merge entity @s {item:{id:"minecraft:stone",Count:1b},brightness:{block:0,sky:15},transformation:{scale:[1.003,1.003,1.003]},Rotation:[0.0f,0.0f],Tags:["customBlock","placing","down"]}
2+
execute if block ~ ~ ~ command_block[facing=north] align xyz positioned ~0.5 ~0.5 ~0.5 summon item_display run data merge entity @s {item:{id:"minecraft:stone",Count:1b},brightness:{block:0,sky:15},transformation:{scale:[1.003,1.003,1.003]},Rotation:[0.0f,0.0f],Tags:["customBlock","placing"]}
3+
execute if block ~ ~ ~ command_block[facing=south] align xyz positioned ~0.5 ~0.5 ~0.5 summon item_display run data merge entity @s {item:{id:"minecraft:stone",Count:1b},brightness:{block:0,sky:15},transformation:{scale:[1.003,1.003,1.003]},Rotation:[-180.0f,0.0f],Tags:["customBlock","placing"]}
4+
execute if block ~ ~ ~ command_block[facing=east] align xyz positioned ~0.5 ~0.5 ~0.5 summon item_display run data merge entity @s {item:{id:"minecraft:stone",Count:1b},brightness:{block:0,sky:15},transformation:{scale:[1.003,1.003,1.003]},Rotation:[90.0f,0.0f],Tags:["customBlock","placing"]}
5+
execute if block ~ ~ ~ command_block[facing=west] align xyz positioned ~0.5 ~0.5 ~0.5 summon item_display run data merge entity @s {item:{id:"minecraft:stone",Count:1b},brightness:{block:0,sky:15},transformation:{scale:[1.003,1.003,1.003]},Rotation:[-90.0f,0.0f],Tags:["customBlock","placing"]}
6+
execute if block ~ ~ ~ command_block[facing=up] align xyz positioned ~0.5 ~0.5 ~0.5 summon item_display run data merge entity @s {item:{id:"minecraft:stone",Count:1b},brightness:{block:0,sky:15},transformation:{scale:[1.003,1.003,1.003]},Rotation:[0.0f,90.0f],Tags:["customBlock","placing","up"]}
7+
execute if block ~ ~ ~ command_block[facing=down] align xyz positioned ~0.5 ~0.5 ~0.5 summon item_display run data merge entity @s {item:{id:"minecraft:stone",Count:1b},brightness:{block:0,sky:15},transformation:{scale:[1.003,1.003,1.003]},Rotation:[0.0f,-90.0f],Tags:["customBlock","placing","down"]}
88

99
# Updates The Base Block To Include All The Block Info From Storage
1010
execute as @e[type=item_display,tag=placing] at @s run function custom_blocks:place/apply_block_info_from_storage
1111

1212
# Remove Temporary Tag And Set Base Block
1313
setblock ~ ~ ~ stone
14-
setblock ~ ~ ~ command_block{Command:""}
15-
execute as @e[type=item_display,tag=placing] at @s run function custom_blocks:place/set_base_block
14+
execute as @e[type=item_display,tag=placing] at @s run function custom_blocks:place/set_base_block with storage custom_blocks:current_block BaseBlock
1615

1716
# Resets Storage After Player Places Custom Block Or Deselects It
1817
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
+1-3Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,5 @@ data remove storage custom_blocks:current_block id
33
data remove storage custom_blocks:current_block DisplayName
44
data remove storage custom_blocks:current_block Lore
55
data remove storage custom_blocks:current_block CustomModelData
6-
data remove storage custom_blocks:current_block CustomModelDataVertical
7-
data remove storage custom_blocks:current_block CustomName
86
data remove storage custom_blocks:current_block Tags
9-
data remove storage custom_blocks:current_block SetblockCommand
7+
data remove storage custom_blocks:current_block BaseBlock
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
data modify block ~ ~ ~ Command set from storage custom_blocks:current_block SetblockCommand
2-
data merge block ~ ~ ~ {auto:1b}
1+
$setblock ~ ~ ~ command_block{Command:"setblock ~ ~ ~ $(value)",auto:1b}
32
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
+1-3Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,11 @@ execute as @a[gamemode=creative,predicate=!custom_blocks:selected_placer] run fu
33

44
# Saves All Block Info Into A Storage For When Placing
55
data modify storage custom_blocks:current_block CustomModelData set from entity @s SelectedItem.tag.CustomModelData
6-
data modify storage custom_blocks:current_block CustomModelDataVertical set from entity @s SelectedItem.tag.CustomModelDataVertical
76
execute if entity @s[predicate=custom_blocks:selected_placer] run data modify storage custom_blocks:current_block id set from entity @s SelectedItem.id
87
data modify storage custom_blocks:current_block DisplayName set from entity @s SelectedItem.tag.display.Name
98
data modify storage custom_blocks:current_block Lore set from entity @s SelectedItem.tag.display.Lore
10-
data modify storage custom_blocks:current_block CustomName set from entity @s SelectedItem.tag.BlockProperties.CustomName
119
data modify storage custom_blocks:current_block Tags set from entity @s SelectedItem.tag.BlockProperties.Tags
12-
data modify storage custom_blocks:current_block SetblockCommand set from entity @s SelectedItem.tag.BlockProperties.SetblockCommand
10+
data modify storage custom_blocks:current_block BaseBlock set from entity @s SelectedItem.tag.BlockProperties.BaseBlock
1311

1412
# Runs The Check Block Function
1513
function custom_blocks:place/check_for_block

0 commit comments

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