Skip to content

Instantly share code, notes, and snippets.

@mudkipdev
mudkipdev / colored-logging.md
Last active December 6, 2025 16:14
Colored Logging in Minestom

Colored Logging

If you do not have a logger added yet, check out this build script generator to find the proper dependency strings to include in build.gradle.kts.

If you want to customize the colors further, check out this resource from W3schools.

TinyLog

  1. Create a file named ColoredConsoleWriter.java.
package com.example;
@mudkipdev
mudkipdev / Npc.java
Created August 4, 2025 17:17
An NPC template for Minestom that has a name tag, looks at nearby players and runs custom code on click.
package gg.skylite.lobby;
import net.kyori.adventure.text.Component;
import net.minestom.server.MinecraftServer;
import net.minestom.server.coordinate.Pos;
import net.minestom.server.coordinate.Vec;
import net.minestom.server.entity.*;
import net.minestom.server.entity.metadata.display.AbstractDisplayMeta;
import net.minestom.server.entity.metadata.display.TextDisplayMeta;
import net.minestom.server.event.entity.EntityAttackEvent;
@mudkipdev
mudkipdev / slash_commands.py
Last active June 2, 2023 04:28
A basic slash command example for discord.py v2.x.
from discord.ext import commands
from discord import app_commands
import discord
intents = discord.Intents.default()
intents.message_content = True # Ignore this line if you're not using prefix commands.
# You could use a client here instead, if you don't want to use prefix/hybrid commands.
bot = commands.Bot(intents=intents, command_prefix="!")
@mudkipdev
mudkipdev / pagination.py
Last active August 13, 2023 19:04
A discord.py embed pagination system using buttons.
from discord.ext import commands
import discord
import asyncio
__all__ = ("Paginator",)
class Paginator:
def __init__(
self,