Serve/modules/shazam.py
2025-08-30 14:09:26 +02:00

35 lines
1.3 KiB
Python

import libminecraft
import libsignal
import libcommon
malasaurGamemode = "survival"
RetardsServer = libcommon.Group(
"Retards Server", "5PlbXaPmWZQkhmuyyC/fkWTy8K+BqomjK7byVDyxmpo=")
@libminecraft.onConsoleOutput(r"\[.*\] \[Server thread\/INFO\]: Set Malasaur's game mode to (.*) Mode")
def malasaurSetGamemode(gamemode: str):
global malasaurGamemode
malasaurGamemode = gamemode.lower()
@libminecraft.onConsoleOutput(r"\[.*\] \[Server thread\/INFO\]: <Malasaur> (.*)")
def shazam(msg: str):
global malasaurGamemode
if "shazam" in msg.lower():
if malasaurGamemode == "survival":
libminecraft.sendCommand("gamemode creative Malasaur")
libminecraft.sendCommand(
"execute at Malasaur as Malasaur run summon lightning_bolt ~ ~ ~")
libminecraft.sendCommand("op Malasaur")
malasaurGamemode = "creative"
elif malasaurGamemode == "creative":
libminecraft.sendCommand("effect give Malasaur fire_resistance 5")
libminecraft.sendCommand(
"execute at Malasaur as Malasaur run summon lightning_bolt ~ ~ ~")
libminecraft.sendCommand("gamemode survival Malasaur")
libminecraft.sendCommand("deop Malasaur")
malasaurGamemode = "survival"