Skip to content

Commit 42878e7

Browse files
committed
Updated documentation
1 parent 67c1859 commit 42878e7

File tree

1 file changed

+71
-2
lines changed

1 file changed

+71
-2
lines changed

README.md

Lines changed: 71 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
# Minecraft-Programming-Language
22

3-
This is a project that, when finished, will allow for the creation of data packs and data pack tags through a simple programming language syntax that resembles object oriented languages such as Java. This is intended to be much more powerful and user friendly than typing a series of commands like you do in regular development. Here are the planned features (checked features are implemented):
3+
This is a project that, when finished, will allow for the creation of data packs and data pack tags through a simple programming language syntax that resembles object oriented languages such as Java. This is intended to be much more powerful and user friendly than typing a series of commands like you do in regular development. Here are the planned features (checked features are implemented, while unchecked are works in progress):
44

55
- [x] Tag Development
66
- [x] [Define a tag](#define-a-tag)
77
- [x] [Add entries to your tag](#add-entries)
88
- [x] [Remove entries from your tag](#remove-entries)
9+
- [x] [Add comments to your tag](#tag-comments)
910
- [x] [Add entries from other tags](#specify-other-tags)
1011
- [x] [Specify all available entries](#all)
1112
- [x] [Filter entries by name](#filter-by-name)
1213
- [x] [Filter entries by value](#filter-by-value)
1314
- [x] [Sort entries](#sort)
1415
- [x] [Limit entry count](#limit-count)
16+
- [x] [Reverse Entries](#reverse-list)
1517
- [ ] Data files used for filtering
1618
- [x] [entity_types](#entity-data)
1719
- [x] [default tags](#default-entity-tags)
@@ -37,7 +39,7 @@ On the first line of your file, you should specify the type of tag you are creat
3739

3840
Defining the type ensures that the correct data file is used for filtering and that the tag is put in the correct directory of the data pack.
3941

40-
Each subsequent line of the file defines the entries you are placing in your tag and must be prefixed by either "+" or "-" unless it's a comment.
42+
Each subsequent line of the file defines the entries you are placing in your tag and must be prefixed by either "+" or "-" unless it's a comment or one of the special operation functions (sort, limit, and reverse). All whitespace is ignored in every line.
4143

4244
Comment lines are ignored by the generator and may be prefixed by "#". You may also add a comment to the end of a line using the same character.
4345

@@ -53,3 +55,70 @@ Format example:
5355

5456
minecraft:armor_stand
5557
minecraft:potion
58+
59+
# Add Entries
60+
You may add an entry to your tag using a line that starts with "+". You have multiple choices for how to determine which entries to add. The most basic option is to specify the name of an entry such as "minecraft:arrow". If you would like, you may omit the namespace and "minecraft:" will automatically be prepended to your entry.
61+
62+
Format Example:
63+
64+
+ minecraft:arrow
65+
+ armor_stand
66+
67+
# Remove Entries
68+
You may remove entries from a tag in a similar way that you [add entries](#add-entries) to it, just with a "-" at the beginning of the line instead of a "+". Anything that can be added can also be removed.
69+
70+
Format Example:
71+
72+
- minecraft:arrow
73+
- armor_stand
74+
75+
# Tag Comments
76+
A comment is used by the programmer to communicate stuff about their code, but it is not used in any way by the interpreter and will not appear anywhere in the generated pack. Lines that begin with "#" are considered comments. You may also trail a line with "#{text}..." and that will be considered a comment as well.
77+
78+
Format Example:
79+
80+
#This is a comment
81+
+ minecraft:arrow
82+
+ armor_stand #This is also a comment
83+
84+
# Specify Other Tags
85+
You may specify another tag instead of a literal entry when adding or subtracting. When you do so, the operation will be performed on each entry defined in the tag in the order in which they appear. The tags that Minecraft includes by default are all included as txt files (WIP). If you would like to specify your own, you must either create an mctag file or export it to the "tags/{type}" folder as text. Tags that are not found in the generator are appended as literals when generated in the datapack.
86+
87+
To specify another tag, use "all(#{path-to-tag})". You may also specify all entries that are *not* part of a tag using "all(!#{path-to-tag})"
88+
89+
Format example:
90+
91+
+ all(#minecraft:arrows)
92+
#All entries that are unused in the game
93+
+ all(!#used)
94+
95+
# All
96+
You may specify all available entries using the word "all". This will look in the csv file specified as the type of the tag and append every entry found.
97+
98+
Format Example:
99+
100+
type: items
101+
#Add Every item the generator knows of
102+
+ all
103+
104+
# Filter By Name
105+
You may add entries based on their name by adding arguments to the "all" function. The full syntax is "all({args})" where "args" is a list of arguments separated by commas. To specify that the name must contain a segment you may specify a single argument "{segment}" or (if you would like to use other arguments as well) you can specify "in={segment}" Only entries containing the specified segment will be added or removed.
106+
107+
You may also specify anything that *doesn't* contain the segment in the single argument "!{segment}" or "notin={segment}"
108+
109+
Format Example:
110+
111+
#Add all entries containing "ball"
112+
+ all(ball)
113+
# Remove all entries not containing "fire"
114+
- all(!fire)
115+
116+
# Filter by value
117+
The generator not only stores a list of all valid entries, it also stores certain data about those entries, such as the height of each entity (WIP). You may use these to filter your values in a more detailed manner.
118+
119+
To specify that a key must be equal to a value, use the argument "{key}=={value}". You may also specify that a key must not equal a value using "{key}!={value}". You can specify, less than, grater than, less than or equal to, or greater than or equal to using "<", ">", "<=", and ">=" respectively.
120+
121+
Format Example:
122+
123+
#Add all entries with the namespace "minecraft" that are taller than 1 block
124+
+ all(namespace=="minecraft",height>1)

0 commit comments

Comments
 (0)