Add eval command
This commit is contained in:
parent
c6a2eaf298
commit
8729e60fed
1 changed files with 17 additions and 0 deletions
17
plugins/commands/eval.js
Normal file
17
plugins/commands/eval.js
Normal file
|
@ -0,0 +1,17 @@
|
|||
const textformat=require("../../util/textformat.js")
|
||||
const index=require("../../index.js") //Not used in the code, but may be used by users of the command
|
||||
module.exports={
|
||||
execute: (c)=>{
|
||||
if(c.type!="console"){
|
||||
c.reply(textformat("Eval command is currently not available to players in Minecraft"))
|
||||
};
|
||||
try{
|
||||
console.log(eval(c.args.join(" ")));
|
||||
}catch(e){
|
||||
console.error(e);
|
||||
}
|
||||
},
|
||||
desc: "Run JavaScript code", // Command description
|
||||
usage: '', // Command usage
|
||||
hidden: true
|
||||
}
|
Loading…
Reference in a new issue