You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+71-2Lines changed: 71 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,17 +1,19 @@
1
1
# Minecraft-Programming-Language
2
2
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):
4
4
5
5
-[x] Tag Development
6
6
- [x] [Define a tag](#define-a-tag)
7
7
- [x] [Add entries to your tag](#add-entries)
8
8
- [x] [Remove entries from your tag](#remove-entries)
9
+
- [x] [Add comments to your tag](#tag-comments)
9
10
- [x] [Add entries from other tags](#specify-other-tags)
10
11
- [x] [Specify all available entries](#all)
11
12
- [x] [Filter entries by name](#filter-by-name)
12
13
- [x] [Filter entries by value](#filter-by-value)
13
14
- [x] [Sort entries](#sort)
14
15
- [x] [Limit entry count](#limit-count)
16
+
- [x] [Reverse Entries](#reverse-list)
15
17
- [ ] Data files used for filtering
16
18
- [x] [entity_types](#entity-data)
17
19
- [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
37
39
38
40
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.
39
41
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.
41
43
42
44
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.
43
45
@@ -53,3 +55,70 @@ Format example:
53
55
54
56
minecraft:armor_stand
55
57
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
0 commit comments