Introduction

#declare comments are a way to declare a resource which can be used to compute completions, rename symbols, and find references/declarations. You can also use #define to replace #declare – they all work exactly the same.

The game will treat declaration comments as normal comments and simply ignore them.

Syntax: #declare|#define <type: string> <value: string>

declaration-comments

Here’s a table showing how to declare or define each type of resource:

Type Declaration Definition
Advancement #declare advancement <ID> An advancement file.
Biome #declare worldgen/biome <ID> A biome file.
Block Tag #declare tag/block <ID> A block tag file.
Bossbar #declare bossbar <ID> bossbar add <ID>
Configured Carver #declare worldgen/configured_carver <ID> A configured carver file.
Configured Feature #declare worldgen/configured_feature <ID> A configured feature file.
Configured Structure Feature #declare worldgen/configured_structure_feature <ID> A configured structure feature file.
Configured Surface Builder #declare worldgen/configured_surface_builder <ID> A configured surface builder file.
Dimension #declare dimension <ID> A dimension file.
Dimension Type #declare dimension_type <ID> A dimension type file.
Entity #declare entity <ID> N/A
Entity Type Tag #declare tag/entity_type <ID> An entity type tag file.
Fluid Tag #declare tag/fluid <ID> A fluid tag file.
Function #declare function <ID> A function file.
Function Tag #declare tag/function <ID> A function tag file.
Item Tag #declare tag/item <ID> An item tag file.
Loot Table #declare loot_table <ID> A loot table file.
Objective #declare objective <ID> scoreboard objectives add <ID>
Predicate #declare predicate <ID> A predicate file.
Processor List #declare worldgen/processor_list <ID> A processor list file.
Recipe #declare recipe <ID> A recipe file.
Score Holder #declare score_holder <ID> N/A
Storage #declare storage <ID> N/A
Tag #declare tag <ID> N/A
Team #declare team <ID> team add <ID>
Template Pool #declare worldgen/template_pool <ID> A template pool file.

History

Version Description
1.1.0 Added #define comment.
3.0.0 Renamed #define to #declare.
Added #define as an alias of #declare.
All kind of resources can be declared.