Skip to content

Commit

Permalink
Merge pull request #6 from TheMrZZ/develop
Browse files Browse the repository at this point in the history
Changed the version number
  • Loading branch information
TheMrZZ authored Nov 12, 2018
2 parents f48768d + c408f03 commit 59ef228
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 11 deletions.
6 changes: 2 additions & 4 deletions examples/cheststealer/count.minescript
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,14 @@ scoreboard objectives add items dummy

# Gives to the player every given item of a chest

slot = 0
offset = 9
id = "\"minecraft:diamond\""

scoreboard players set total items 0

# 27 slots in a player inventory, excluding the hotbar
{% while slot < 27 %}
{% for (slot = 0; slot < 27; slot++) %}
scoreboard players set count items 0
execute as @s run execute store result score count items run data get block ~ ~ ~ Items[{Slot:{{slot}}b,id:{{id}}}].Count
scoreboard players operation total items += count items
slot += 1
{% endwhile %}
{% endfor %}
7 changes: 2 additions & 5 deletions examples/cheststealer/give.minescript
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,12 @@
# Gives the items.total number of items to the player

steps = [64, 15, 1]
i = 0
id = "minecraft:diamond"

{% while i < steps.length %}
n = steps[i]
{% for (n of steps) %}
cond = `execute if score total items matches ${n}.. run`
{{ cond }} give @s {{ id }} {{ n }}
{{ cond }} scoreboard players remove total items {{ n }}
i += 1
{% endwhile %}
{% endfor %}

execute if score total items matches 1.. run function cheststealer:give
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "minescript",
"version": "0.0.1-alpha",
"version": "0.0.2-alpha",
"description": "A Minecraft Functions templating engine",
"main": "lexer.js",
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion src/argumentParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ let inputFolder = ''
let outputFolder = ''

program
.version('0.0.1-alpha')
.version('0.0.2-alpha')
.arguments('<inputFolder> <namespaceFolder>')
.description('Compiles .mcscript or .minescript files located inside the given inputFolder.\n' +
'The resulting .mcfunction files are stored inside the given namespaceFolder - located inside a datapack.')
Expand Down

0 comments on commit 59ef228

Please sign in to comment.