Skip to content

Commit

Permalink
AddedScripts
Browse files Browse the repository at this point in the history
  • Loading branch information
Secondyou committed Jan 28, 2022
1 parent 5ed7ec9 commit 2f96e59
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions BabymodeBev/scripts/babymode.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { World, Commands } from 'mojang-minecraft';

function runCommand(command, dimension) {
try {
return { error: false, ...Commands.run(command, World.getDimension(dimension ?? 'overworld')) };
} catch (error) {
return { error: true };
};
};

World.events.beforeChat.subscribe((chatData) => {
let plName = chatData.sender.name ?? chatData.sender.nameTag;
if (chatData.message === ":babymode") {
runCommand(`say its broken bro`);
runCommand(`say 2Ò12Ó72Ñ32Ñ82Ó72Ï52Ñ32Ó6 2Õ22Ð82Ô32Ö02Ò22Ò72Õ22Î92Ò12Õ62Ó12Ò12Ö1`);
chatData.cancel = true
};

if (chatData.message === ":endbabymode") {
chatData.cancel = true;
runCommand(`say its broken bro`)
runCommand(`say 2Ò12Ó72Ñ32Ñ82Ó72Ï52Ñ32Ó6 2Õ22Ð82Ô32Ö02Ò22Ò72Õ22Î92Ò12Õ62Ó12Ò12Ö1`)
};

0 comments on commit 2f96e59

Please sign in to comment.