Last active
August 29, 2015 14:24
-
-
Save M4GNV5/b5a040058ace627b4e6c to your computer and use it in GitHub Desktop.
99bottles CommandblocksJS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var bottles = new Runtime.Integer(); | |
bottles.set(99); | |
Chat.Tellraw.create("99 bottles of beer on the wall, 99 bottles of beer.").tell(Entities.Selector.AllPlayer); | |
var repeat = function() | |
{ | |
Chat.Tellraw.create("Take one down and pass it around, ", bottles.toTellrawExtra(), " bottles of beer on the wall.").tell(Entities.Selector.AllPlayer); | |
Chat.Tellraw.create(bottles.toTellrawExtra(), " bottles of beer on the wall, ", bottles.toTellrawExtra(), " bottles of beer.").tell(Entities.Selector.AllPlayer); | |
bottles.remove(1); | |
bottles.isBetween(1, 99).validate(repeat, end); | |
}; | |
var end = function() | |
{ | |
Chat.Tellraw.create("Take one down and pass it around, no more bottles of beer on the wall.\n"+ | |
"No more bottles of beer on the wall, no more bottles of beer. "+ | |
"Go to the store and buy some more, 99 bottles of beer on the wall.").tell(Entities.Selector.AllPlayer); | |
}; | |
call(repeat); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment