We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6e7e6fc commit cf254a5Copy full SHA for cf254a5
src/minecraft/commands/coinFlipCommand.js
@@ -0,0 +1,28 @@
1
+const minecraftCommand = require("../../contracts/minecraftCommand.js");
2
+
3
+class CoinFlipCommand extends minecraftCommand {
4
+ constructor(minecraft) {
5
+ super(minecraft);
6
7
+ this.name = "coinflip";
8
+ this.aliases = ["coin"];
9
+ this.description = "Flips a coin.";
10
+ this.options = [];
11
+ }
12
13
+ async onCommand(username, message) {
14
+ try {
15
+ const randNum = Math.random();
16
17
+ if(randNum < .5){
18
+ this.send("/gc Heads!");
19
+ } else {
20
+ this.send("/gc Tails!");
21
22
+ } catch (error) {
23
+ this.send(`/gc [ERROR] ${error ?? "Something went wrong.."}`);
24
25
26
+}
27
28
+module.exports = CoinFlipCommand;
0 commit comments