Data Pack Creation: Difference between revisions

Jump to navigation Jump to search
m (Alluet moved page Datapack Creation to Data Pack Creation: Correct "Datapack" to "Data Pack")
Line 27: Line 27:
=== Naming and formatting standards ===
=== Naming and formatting standards ===
Please be sure to match the formatting for Gamemode 4 modules to ensure readability and consistency.
Please be sure to match the formatting for Gamemode 4 modules to ensure readability and consistency.
* Names should be as clear and relevant as possible to avoid confusion or two modules sharing the same name by mistake.
* Any name, scoreboard name or tag should be formatted as <code>lowercase_with_underscores</code>
* Any name, scoreboard name or tag should be formatted as <code>lowercase_with_underscores</code>
* Scoreboards and tags should begin with the <code>gm4_</code> prefix.
* Scoreboards and tags should begin with the <code>gm4_</code> prefix.
* fake players used to store numbers for scoreboard operations should be named as a "#" followed by that number e.g. <code>scoreboard players set #100 gm4_some_scoreboard 100</code>
* fake players used to store numbers for scoreboard operations should be named as a "#" followed by that number e.g. <code>scoreboard players set #100 gm4_some_scoreboard 100</code>
* fake players that aren't constants should be prefixed by "$" and be in <code>snake_case</code>, e.g. <code>$has_soul_fire_heatsource</code>
* Entities that aren't visible to the player (markers) should have custom names beginning with <code>gm4_</code> if this does not interfere with functionality.
* Entities that aren't visible to the player (markers) should have custom names beginning with <code>gm4_</code> if this does not interfere with functionality.
* Names for the above two points should be as clear and relevant as possible to avoid confusion or two modules sharing the same name by mistake.
* Lore on items should have the first word capitalized and no fullstop at the end of the sentence if there is only one sentence. Other punctuation (?!) can be added. Descriptions should be <code>"color":"gray","italic":false</code> whilst flavor text or commands (such as "Throw to use") should be <code>"color":"dark_gray","italic":true</code>.
* Lore on items should have the first word capitalized and no fullstop at the end of the sentence if there is only one sentence. Other punctuation (?!) can be added.
* Names on items should follow Minecraft's rarity colorscheme and should be <code>"italic":false</code>.
* ANY FUNCTION that is run as an entity should have a comment on the first line stating the context of @s so it is clear what runs this file e.g. <code>#@s = cows with speed limit=..1 of red mushrooms</code>
 
* ALL FUNCTIONS except those included with the template file should list the functions they are called from in a comment on the first or second line of the file e.g. <code>#run from main</code>. More complicated modules with subdirectories should specify the more specific file path e.g. <code>#run from zauber_cauldrons:cauldron/create</code>
==== Comments ====
* Any function except those included with the template file should start with a header comment that consists of:
  # Plays a particle animation upon Zauber Cauldron creation
  # @s = player holding enchanted book
  # at @s align xyz
  # run from zauber_cauldrons:cauldron/create
* Executor information may be written in mcfunction format (e.g. <code># @s = @e[type=mooshroom,limit=1,dx=0]</code>) or in human-readable format (e.g. <code># @s = Mooshroom within same  blockspace, limit=1</code>). Complicated selectors should be written in a human-readable format.
* Location information should include the full location -- including any <code>align</code> or <code>positioned</code> arguments -- or be written in human-readable format if the location is especially complicated.
* Call information can reference
** a single function, if the function is run by <code>/function ...</code>: <code># run from zauber_cauldrons:cauldron/create</code>.
** a folder, if multiple functions call this function using <code>/function</code>: <code># run from functions in gm4_pig_tractors:till/blocks/</code>.
** a function from where it was scheduled: <code># scheduled by zauber_cauldrons:cauldron/create</code>.
** a combination of these, in which multiple lines would be used.
* (Optional) A human-readable description of the function, e.g. <code># Plays a particle animation upon Zauber Cauldron creation</code>.


=== Sending us your module code ===
=== Sending us your module code ===
46

edits

Navigation menu