Skip to content

Storage Barrel

NorthWestTrees edited this page Oct 2, 2023 · 14 revisions

Description

The storage barrel is made for (loose/bulk goods). Things such as raw crops like potatoes or carrots, ores such as raw iron, or dust and small goods such as sugar, glowstone dust or other small contents that might be suited for barrel storage.

Tutorials

  • MoreBlox: Barrel Storage | 2.0.0
  • MoreBlox: Custom Barrels | 2.0.0

Features

Opening/Closing

You can open and close the barrel by sneaking plus right-clicking the block.
This will play a sound and update the model for the block.
Most mechanics will only happen when the barrel is in the open state.

Unsupported Items

Any items that are not supported for the type of block or are not the same resource as the lowest slot id will be dropped on the ground next to the block.

Appearance

The block has two states open and closed. The top texture changes depending on the block being open or closed. When the block is open a custom texture of the resource using the same colour palette is displayed on the top of the barrel. When it's closed custom text is overlayed on the top of the barrel with the name of the resource.

Mechanics

Some blocks have unique properties and mechanics that can be used. When barrels are open some mechanics run.

  • Barrels that store breeding items can be used to breed entities in a 16x16x16 area of the barrel.
  • If mob griefing is enabled and the breeding mechanics are disabled then some barrels will attract entities.
  • Gunpowder can be ignited using flint and steel or fire chargers when in the open state,
    this will then explode with a power depending on the amount of gunpowder in the barrel.
  • Glint Textures are applied to models that are enchanted. This is mainly a texture feature.
  • Some blocks such as glow berries, glowstone or glow ink sac items give off a bit of light when open.

Crafting Recipe

You can use the crafting helper (green book) to view the recipe for this item in the "Storage Table".

Block States

Each type has two versions (open and closed).

  • Resource - (The item that can be stored)
  • Added - (When the resource block was added)
  • Updated - (When changes were made to the block)
  • Light - (If the block gives off light)
  • Attracted - (The entity attracted to the block)
  • Explodable - (If the block can be ignited)
  • Glint - (If the block has a glint effect)
  • Breedable - (Animals that are supported for breeding mode)
Resource Added Updated Light Attracted Explodeable Glint Breedable
Amethyst Shard 2.0.0 2.0.0
Apple 2.0.0 2.0.0
Baked Potato 2.0.0 2.0.0
Beetroot 2.0.0 2.0.0 Pig
Blaze Powder 2.0.0 2.0.0
Bonemeal 2.0.0 2.0.0
Carrot 2.0.0 2.0.0 Rabbit Pig, Rabbit
Charcoal 2.0.0 2.0.0
Chorus Fruit 2.0.0 2.0.0
Clay Ball 2.0.0 2.0.0
Coal 2.0.0 2.0.0
Cocoa Bean 2.0.0 2.0.0
Diamond 2.0.0 2.0.0
Echo Shard 2.0.0 2.0.0
Emerald 2.0.0 2.0.0
Empty 2.0.0 2.0.0
Enchanted Golden Apple 2.0.0 2.0.0 Open
Feather 2.0.0 2.0.0
Flint 2.0.0 2.0.0
Ghast Tear 2.0.0 2.0.0
Glistering Melon Slice 2.0.0 2.0.0
Glow Berry 2.0.0 2.0.0 Open Foxes Fox
Glow Ink Sac 2.0.0 2.0.0 Open
Glowstone Dust 2.0.0 2.0.0 Open
Gold Nugget 2.0.0 2.0.0
Golden Apple 2.0.0 2.0.0
Golden Carrot 2.0.0 2.0.0 Donkey, Horse, Pig, Rabbit
Gunpowder 2.0.0 2.0.0 Open
Honey Bottle 2.0.0 2.0.0
Honeycomb 2.0.0 2.0.0
Ink Sac 2.0.0 2.0.0
Iron Nugget 2.0.0 2.0.0
Kelp 2.0.0 2.0.0
Lapis Lazuli 2.0.0 2.0.0
Lava Bucket 2.0.0 2.0.0 Open
Magma Cream 2.0.0 2.0.0
Melon Slice 2.0.0 2.0.0
Milk Bucket 2.0.0 2.0.0
Nether Star 2.0.0 2.0.0 Open
Netherite Scrap 2.0.0 2.0.0
Phantom Membrane 2.0.0 2.0.0
Poisonous Potato 2.0.0 2.0.0
Potato 2.0.0 2.0.0 Pig
Prismarine Crystal 2.0.0 2.0.0
Prismarine Shard 2.0.0 2.0.0
Pufferfish 2.0.0 2.0.0
Quartz 2.0.0 2.0.0
Rabbit Foot 2.0.0 2.0.0
Raw Cod 2.0.0 2.0.0 Cat, Ocelot
Raw Copper 2.0.0 2.0.0
Raw Gold 2.0.0 2.0.0
Raw Iron 2.0.0 2.0.0
Raw Salmon 2.0.0 2.0.0 Cat
Redstone 2.0.0 2.0.0
Slime 2.0.0 2.0.0 Frog
Rotten Flesh 2.0.0 2.0.0 Wolf
Scute 2.0.0 2.0.0
Slime 2.0.0 2.0.0
Snowball 2.0.0 2.0.0
Sugar 2.0.0 2.0.0
Sweet Berries 2.0.0 2.0.0 Foxes Fox
Tropical Fish 2.0.0 2.0.0
Water Bucket 2.0.0 2.0.0
Wheat 2.0.0 2.0.0 Cow, Goat, Llama, Mooshroom, Sheep, Trader Llama

MoreBlox Tags

Name Block Item Entity Notes
barrels X X Block tag is used for right-click mechanics. Used to assign NBT variables when the block is placed.
barrels/mechanics/igniter X Used in the right click procedure for explosion
barrels/allowed_items X Supported items for the barrel inventory
empty X An empty tag used for disabling entity mechanics
barrels/attracted/berries X Used to attract foxes to the open berry blocks
barrels/attracted/carrots X Used to attract rabbits to the open berry blocks
barrels/breeding/potato X Used for breeding animals that use wheat for breeding
barrels/breeding/carrot X Used for breeding animals that use wheat for breeding
barrels/breeding/golden_carrot X Used for breeding animals that use wheat for breeding
barrels/breeding/beetroot X Used for breeding animals that use wheat for breeding
barrels/breeding/sweet_berry X Used for breeding animals that use wheat for breeding
barrels/breeding/glow_berry X Used for breeding animals that use wheat for breeding
barrels/breeding/wheat X Used for breeding animals that use wheat for breeding
barrels/breeding/slime X Used for breeding animals that use wheat for breeding
barrels/breeding/raw_cod X Used for breeding animals that use wheat for breeding
barrels/breeding/raw_salmon X Used for breeding animals that use wheat for breeding
barrels/breeding/rotten_flesh X Used for breeding animals that use wheat for breeding

NBT Variables

Block

Name Type Use
isOpen Logic Keeps track if the block is open or closed
breedingEnabled Logic Will keep track if the block is set to breed mode
type String Uses the "id" entry in the config file to set the block type
name String Used in the GUI block name stores the localization path for the block
attractTimer Number The timer that controls when entities should come to the block
breedTimer Number The timer that controls the delay between breeding times
explodePower Number The amount of power the block can explode with

Config Files

Name Path Use
barrels.json game_dir/config/moreblox/ Config file that can be edited to add custom barrels

Example

Below you can find the config file that makes blocks work properly.

  • "1" - This is an ID system using sub-objects, the script reads each ID the number of entries in the file. This means that adding new entries with the next number for its ID will work and allow support for custom entries.
    • "id" - This is the ID of the entry, make sure that it is not used in the file already or it could break mechanics. It's good practice to use namespace_item_name.
    • "open" - This is the block for the open model of the block. his should be the item namespace and registry of the block.
    • "closed" - This is the block for the closed model of the block. his should be the item namespace and registry of the block.
    • "resource" - This is the item for the resource that it should store. This should be the item namespace and registry of the item.
    • "attract_mob_tag" - This is an entity tag that entities should be attracted to the block. You can use the moreblox:empty tag to disable this feature.
    • "breed_mob_tag" - This is an entity tag that entities should be bread with the resource. You can use the moreblox:empty tag to disable this feature.
{
  "1": {
    "id": "minecraft_apple",
    "open": "moreblox:apple_barrel",
    "closed": "moreblox:closed_apple_barrel",
    "resource": "minecraft:apple",
    "attract_mob_tag": "moreblox:empty",
    "breed_mob_tag": "moreblox:empty"
  }
}