Minecraft Data Packs / Technology

Head Blocks - Custom Block Framework

  • check_circle Functions
  • 1,771 views, 7 today
  • 84 downloads, 0 today
  • 14
  • 12
  • 8
imalittlhigh's Avatar imalittlhigh
Level 61 : High Grandmaster Sweetheart
109
This Datapack is a framework to add Blocks with custom textures.
You can add any texture of any playerhead as a block.
The created block will not be darkened by blocks placed next to it or inside of it.

The creation of this framework Datapack has been inspired by KawaMood




You can, of course use this pack in your own packs and projects ^^
(Just copy the headblocks folder into the data folder in your datapack. You can just adress the functions as you would normally [​/function headblocks:blocks/place/water] from your datapack. Just remember to also put the function "headblocks/meta/load" into your "minecraft:tags/functions/load.json)





To add a custom block, create a new mcfunction in blocks/place and give it your block name (or copy one of the 2 existing functions).

Head Blocks - Custom Block Framework Minecraft Data Pack

Copy the command from one of the example functions, and adjust the "Properties:{textures:[{Value:"TEXTUREHERE"}]} to your head texture.
[​There are comments to explain the function in the example block mcfunctions too]

Head Blocks - Custom Block Framework Minecraft Data Pack

You can get the texture value from this website (there are other websites too)



If you want to place the block, just run the function you created at the block you want to place it at.
(for the water block for example: "/execute at @s run functon headblocks:blocks/place/water")
(if you place blocks dynamically, its better to use: "/execute at @s align xyz run ....")



To remove a block, run the function headblocks:blocks/remove/block at the block you want to remove your custom block from (this is the block it is displayed at).



Creating a Head Block only creates the texture! you can place any other block "inside" of the texture.
(Think of a custom crafting table, different barrel types, ...)


Every Head Block is one entity! The entity is only being processed by this datapack, if a player is within 100 blocks of it to reduce lag.



If you want the datapack to be more verbose with its actions, do "/scoreboard players set %debug headblocks.dummy 1". With this the datapack will announce what it does in chat. (It will announce to everyone)
If you want to reduce the datapacks chat output, just do "/scoreboard players set %debug headblocks.dummy 0". With that the chat output will be removed.



If you want to remove all Head Block entities, do "/function headblocks:meta/remove_all" to remove all entities this datapack has added. Keep in mind, that only loaded entities can be killed, so there might be some left in unloaded chunks.

The only other thing this datapack adds is a scoreboard called headblocks.dummy if you want to remove the pack, simply remove this scoreboard and all headblock entities in your world.
CompatibilityMinecraft 1.20
Tags

1 Update Logs

Update #1 : by imalittlhigh 10/15/2023 9:14:00 amOct 15th, 2023

added project implementation "guide"

Create an account or sign in to comment.

1
11/16/2023 7:24 pm
Level 50 : Grandmaster Miner
iqraer
iqraer's Avatar
west.mcfunction
9. execute as @s[tag=headblocks.light.east] run tp @s ~-2.0002 ~ ~
need to replace
9. execute as @s[tag=headblocks.light.east] run tp @s ~-1.0002 ~ ~
1
11/17/2023 3:40 am
Level 61 : High Grandmaster Sweetheart
imalittlhigh
imalittlhigh's Avatar
have you tested that? cause im pretty sure i tested all directions. And since its from the east to west, and needs to "switch" sides 2 blocks should be correct
1
10/15/2023 2:38 pm
Level 54 : Grandmaster Dinosaur
DinoDesmond
DinoDesmond's Avatar
Is there a way to use 8 heads like kawamood?
2
10/16/2023 9:51 am
Level 61 : High Grandmaster Sweetheart
imalittlhigh
imalittlhigh's Avatar
no, i made this pack to only use one head to save on performance a bit. If you want to use 6 heads (one for each side of the block) you have to skew the blocks' sides a bit and if you make them thin, the display-entity disappears very quickly if you move away.
If you dont make the sides thin, you get a lot of z fighting (which also looks bad)

Thats why i made this with only one head ^^
2
10/16/2023 10:56 amhistory
Level 54 : Grandmaster Dinosaur
DinoDesmond
DinoDesmond's Avatar
Did 8 heads really cause that much lag? Very cool data pack nonetheless
2
10/17/2023 3:10 am
Level 61 : High Grandmaster Sweetheart
imalittlhigh
imalittlhigh's Avatar
the lag isnt the real problem ^^ Its 8x the entities, so it accumulates much faster.
The problem is, that the custom block just disappears as soon as youre like 20 blocks away :D (And the Z fighting)

Might work on some sort of custom block face framework (to replace one face of a block with texture)
Also are we talking about the same thing? like replacing each face of a block with a plane of one of the sides of a head? Cause ur saying 8 heads, but blocks have 6 planes
2
10/17/2023 10:30 am
Level 54 : Grandmaster Dinosaur
DinoDesmond
DinoDesmond's Avatar
I’m talking about how kawamood does it, since a head is 1/8 of a block you can use a normal size head display for each corner of a block.
2
10/17/2023 11:40 am
Level 61 : High Grandmaster Sweetheart
imalittlhigh
imalittlhigh's Avatar
aaah ^^ yeah that would work.
But you could only rly use textures that repeat tho.
Might look into doing the 8 head thing ^^
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome