Skip to content

[Feature] Ability to use Minecraft's block tag feature to avoid redundant/excessive typing in config and allow easier customization #1967

Description

@ninjakitty844

What are datapacks or block tags?

Minecraft has a feature called datapacks. These allow you to add/change things in Minecraft without actually altering its code or adding plugins. They can add recipes, run commands, and alter certain game behaviors. Datapacks have a feature called block tags, which are essentially a way to group block ids together so that you do not have to list every block id individually every time you want to perform an action on a group of blocks.

Here are some of Minecraft's default block tags (built-in):

#minecraft:standing_signs
{ "values": [ "minecraft:oak_sign", "minecraft:spruce_sign", "minecraft:birch_sign", "minecraft:acacia_sign", "minecraft:jungle_sign", "minecraft:dark_oak_sign", "minecraft:crimson_sign", "minecraft:warped_sign", "minecraft:mangrove_sign", "minecraft:bamboo_sign", "minecraft:cherry_sign" ] }

#minecraft:wall_signs
{ "values": [ "minecraft:oak_wall_sign", "minecraft:spruce_wall_sign", "minecraft:birch_wall_sign", "minecraft:acacia_wall_sign", "minecraft:jungle_wall_sign", "minecraft:dark_oak_wall_sign", "minecraft:crimson_wall_sign", "minecraft:warped_wall_sign", "minecraft:mangrove_wall_sign", "minecraft:bamboo_wall_sign", "minecraft:cherry_wall_sign" ] }

#minecraft:signs
{ "values": [ "#minecraft:standing_signs", "#minecraft:wall_signs" ] }
Note: As seen here, block tags can contain other block tags! Convenient for organization :]

Why should Medieval Factions respect block tags?

If you wanted to put all regular signs in your configuration file (for example, in the list of the blocks placeable during war), you would have to manually type out every single sign block id:
"minecraft:oak_sign", "minecraft:spruce_sign", "minecraft:birch_sign", "minecraft:acacia_sign", "minecraft:jungle_sign", "minecraft:dark_oak_sign", "minecraft:crimson_sign", "minecraft:warped_sign", "minecraft:mangrove_sign", "minecraft:bamboo_sign", "minecraft:cherry_sign" "minecraft:oak_wall_sign", "minecraft:spruce_wall_sign", "minecraft:birch_wall_sign", "minecraft:acacia_wall_sign", "minecraft:jungle_wall_sign", "minecraft:dark_oak_wall_sign", "minecraft:crimson_wall_sign", "minecraft:warped_wall_sign", "minecraft:mangrove_wall_sign", "minecraft:bamboo_wall_sign", "minecraft:cherry_wall_sign"

BUT, if the Medieval Factions plugin respected block tags, you could simply type: "#minecraft:signs"
That's it, one line :]
It's because that block tag already contains every single regular sign block id.

And block tags are extremely convenient; if one doesn't exist the way you want it to, you can just create a new one or customize an existing one by adding or removing certain block ids from it.

More use cases

One thing I would like to do is be able to add "#minecraft:climbable" to the list of blocks one can place in enemy territory during war. This block tag includes ladders, scaffolding, vines, and (not by default, but with my custom datapack) chains! (BTW, this does actually function and make chains climbable, it's neat!)

For another example of something I would like to do;
I would like to add my custom block tag "#minecraft:cannon_barrel" to the list of blocks placeable in enemy territory.

#minecraft:cannon_barrel
{ "values": [ "#minecraft:light_cannon_barrel", "#minecraft:heavy_cannon_barrel" ] }

#minecraft:light_cannon_barrel
{ "values": [ "minecraft:polished_blackstone" ] }

#minecraft:heavy_cannon_barrel
{ "values": [ "minecraft:obsidian" ] }

This way, if I ever change which blocks are used to construct light or heavy cannons, I only need to update the "#minecraft:light_cannon_barrel" and "#minecraft:heavy_cannon_barrel" block tags. I won't even have to update my Medieval Factions configuration because I already put "#minecraft:cannon_barrel" as the placeable block, and it contains the tags I just changed :]

And if I wanted gates to only be made out of fences, I could make a whitelist for allowed gate blocks and just put "#minecraft:fences".

Overall block tags just make things a lot easier, and I hope to be able to use them in Medieval Factions at some point, even if only to avoid a lot of redundant typing, LOL!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions