Skip to content

Commit

Permalink
Updated to 1.21.4. Fixes #7
Browse files Browse the repository at this point in the history
  • Loading branch information
BJTMastermind committed Dec 17, 2024
1 parent 93d31d5 commit d877972
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 21 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ To use the Custom Blocks API simply include it alongside your datapack and ensur
### Give Command
If your pack includes a custom give command this is what the function should look like with this API:
```mcfunction
give @s dropper[item_name='{"text":"A Name"}',\
give @s dropper[item_name='{"text":"A Name"}',\
lore=['{"text":"A Lore","italic":false,"color":"red"}'],\
custom_model_data=1,\
lock="custom_blocks:block",\
lock={"minecraft:custom_name": "'custom_blocks:block'"},\
custom_data={\
block_properties:{\
Tags:["some_tag_for_this_block"],\
Expand All @@ -29,7 +29,7 @@ To set up your custom blocks with this API simple add the custom models to one o

<hr>

<b>Make Sure To Include</b> the lock component and set its value to <b>"custom_blocks:block"</b><br>
<b>Make Sure To Include</b> the lock component and set its value to <b>"'custom_blocks:block'"</b><br>
This tells the API that your block uses this Custom Blocks API system.

Then add your custom block name, an optional lore for the block, and add your custom blocks custom_model_data value.
Expand All @@ -40,7 +40,7 @@ For help on how to set these up see the above give command for an example.

## Minimum Minecraft Version

* 1.21
* 1.21.4

## About This Project

Expand Down
3 changes: 0 additions & 3 deletions data/custom_blocks/function/main.mcfunction
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
execute as @a run function custom_blocks:place/set_storage

# Update old lock "CustomBlocks:Block" to "custom_blocks:block"
execute as @a if items entity @s weapon.* #custom_blocks:placers[minecraft:lock="CustomBlocks:Block"] run item modify entity @s weapon.mainhand custom_blocks:update_lock
12 changes: 6 additions & 6 deletions data/custom_blocks/function/place/check_for_block.mcfunction
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Detects Custom Block And Places It
execute at @a run fill ~5 ~6 ~5 ~-5 ~-4 ~-5 command_block[facing=north]{auto:1b,Command:"function custom_blocks:place/place_block with storage custom_blocks:current_block base_block"} replace #custom_blocks:placers[facing=north]{Lock:"custom_blocks:block"}
execute at @a run fill ~5 ~6 ~5 ~-5 ~-4 ~-5 command_block[facing=south]{auto:1b,Command:"function custom_blocks:place/place_block with storage custom_blocks:current_block base_block"} replace #custom_blocks:placers[facing=south]{Lock:"custom_blocks:block"}
execute at @a run fill ~5 ~6 ~5 ~-5 ~-4 ~-5 command_block[facing=east]{auto:1b,Command:"function custom_blocks:place/place_block with storage custom_blocks:current_block base_block"} replace #custom_blocks:placers[facing=east]{Lock:"custom_blocks:block"}
execute at @a run fill ~5 ~6 ~5 ~-5 ~-4 ~-5 command_block[facing=west]{auto:1b,Command:"function custom_blocks:place/place_block with storage custom_blocks:current_block base_block"} replace #custom_blocks:placers[facing=west]{Lock:"custom_blocks:block"}
execute at @a run fill ~5 ~6 ~5 ~-5 ~-4 ~-5 command_block[facing=up]{auto:1b,Command:"function custom_blocks:place/place_block with storage custom_blocks:current_block base_block"} replace #custom_blocks:placers[facing=up]{Lock:"custom_blocks:block"}
execute at @a run fill ~5 ~6 ~5 ~-5 ~-4 ~-5 command_block[facing=down]{auto:1b,Command:"function custom_blocks:place/place_block with storage custom_blocks:current_block base_block"} replace #custom_blocks:placers[facing=down]{Lock:"custom_blocks:block"}
execute at @a run fill ~5 ~6 ~5 ~-5 ~-4 ~-5 command_block[facing=north]{auto:1b,Command:"function custom_blocks:place/place_block with storage custom_blocks:current_block base_block"} replace #custom_blocks:placers[facing=north]{lock:{components:{"minecraft:custom_name":'"custom_blocks:block"'}}}
execute at @a run fill ~5 ~6 ~5 ~-5 ~-4 ~-5 command_block[facing=south]{auto:1b,Command:"function custom_blocks:place/place_block with storage custom_blocks:current_block base_block"} replace #custom_blocks:placers[facing=south]{lock:{components:{"minecraft:custom_name":'"custom_blocks:block"'}}}
execute at @a run fill ~5 ~6 ~5 ~-5 ~-4 ~-5 command_block[facing=east]{auto:1b,Command:"function custom_blocks:place/place_block with storage custom_blocks:current_block base_block"} replace #custom_blocks:placers[facing=east]{lock:{components:{"minecraft:custom_name":'"custom_blocks:block"'}}}
execute at @a run fill ~5 ~6 ~5 ~-5 ~-4 ~-5 command_block[facing=west]{auto:1b,Command:"function custom_blocks:place/place_block with storage custom_blocks:current_block base_block"} replace #custom_blocks:placers[facing=west]{lock:{components:{"minecraft:custom_name":'"custom_blocks:block"'}}}
execute at @a run fill ~5 ~6 ~5 ~-5 ~-4 ~-5 command_block[facing=up]{auto:1b,Command:"function custom_blocks:place/place_block with storage custom_blocks:current_block base_block"} replace #custom_blocks:placers[facing=up]{lock:{components:{"minecraft:custom_name":'"custom_blocks:block"'}}}
execute at @a run fill ~5 ~6 ~5 ~-5 ~-4 ~-5 command_block[facing=down]{auto:1b,Command:"function custom_blocks:place/place_block with storage custom_blocks:current_block base_block"} replace #custom_blocks:placers[facing=down]{lock:{components:{"minecraft:custom_name":'"custom_blocks:block"'}}}
3 changes: 0 additions & 3 deletions data/custom_blocks/function/setup.mcfunction
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
gamerule commandBlockOutput false
gamerule logAdminCommands false

# Remove old scoreboard objective
# `scoreboard objectives remove cbCalcModel` is now deprecated and will be removed in a future version
scoreboard objectives remove cbCalcModel dummy
4 changes: 0 additions & 4 deletions data/custom_blocks/item_modifier/update_lock.json

This file was deleted.

2 changes: 1 addition & 1 deletion pack.mcmeta
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"pack": {
"pack_format": 48,
"pack_format": 61,
"description": "Allows you to add new blocks easily"
}
}

0 comments on commit d877972

Please sign in to comment.