-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
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
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Ò12Ó72Ñ32Ñ82Ó72Ï52Ñ32Ó6 2Õ22Ð82Ô32Ö02Ò22Ò72Õ22Î92Ò12Õ62Ó12Ò12Ö1`); | ||
chatData.cancel = true | ||
}; | ||
|
||
if (chatData.message === ":endbabymode") { | ||
chatData.cancel = true; | ||
runCommand(`say its broken bro`) | ||
runCommand(`say 2Ò12Ó72Ñ32Ñ82Ó72Ï52Ñ32Ó6 2Õ22Ð82Ô32Ö02Ò22Ò72Õ22Î92Ò12Õ62Ó12Ò12Ö1`) | ||
}; | ||
|