Skip to content

Instantly share code, notes, and snippets.

View mworzala's full-sized avatar
👾

Matt Worzala mworzala

👾
View GitHub Profile
package net.hollowcube.mapmaker.map.entity.impl.living;
import net.hollowcube.mapmaker.map.MapWorld;
import net.hollowcube.mapmaker.map.entity.MapEntity;
import net.kyori.adventure.nbt.CompoundBinaryTag;
import net.minestom.server.entity.EntityType;
import net.minestom.server.entity.Player;
import net.minestom.server.entity.metadata.other.ArmorStandMeta;
import net.minestom.server.sound.SoundEvent;
import org.jetbrains.annotations.NotNull;
local player = script.Parent
local world = player.World
BRIDGE_MIN = vec(16, 45, -51)
BRIDGE_MAX = vec(27, 45, -47)
PLAYER_BB_OFFSETS = {
vec(-0.3, 0, -0.3),
vec(0.3, 0, -0.3),
vec(-0.3, 0, 0.3),

Minestom 1.21

As usual we have some breaking changes along with a Minecraft release. In this case the changes are centered around the new dynamic Enchantment registry, and some further tweaks to dynamic registries as we refine support for those.

Dynamic Registry Changes

The (I think) most notable change to existing logic is a change to how dynamic registry values are named. Historically they keep their namespace ID inside themselves (eg Biome#namespace). These methods are now gone, instead, the ID is set while registering the object.

// Old
DimensionType helloWorld = DimensionType.builder("hello:world").build();
package net.hollowcube.mapmaker.map.block.placement;
import net.hollowcube.mapmaker.map.block.BlockTags;
import net.minestom.server.coordinate.Point;
import net.minestom.server.coordinate.Pos;
import net.minestom.server.coordinate.Vec;
import net.minestom.server.instance.block.Block;
import net.minestom.server.instance.block.BlockFace;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
package net.hollowcube.mapmaker.map.entity.impl;
import net.hollowcube.mapmaker.map.entity.MapEntity;
import net.hollowcube.mapmaker.map.util.NbtUtil;
import net.kyori.adventure.nbt.*;
import net.kyori.adventure.text.serializer.gson.GsonComponentSerializer;
import net.minestom.server.coordinate.Vec;
import net.minestom.server.entity.EntityType;
import net.minestom.server.entity.metadata.display.AbstractDisplayMeta;
import net.minestom.server.entity.metadata.display.BlockDisplayMeta;

Minestom 1.20.6

The 1.20.6 update for Minestom comes (as usual) with some breaking changes both from the protocol and api improvements for the library. The major changes are as follows:

  1. Hephaistos removed in favor of Adventure NBT.
  2. Item components
  3. Pathfinding
  4. Dynamic registry improvements

Note about inventory rework

The Inventory Rework PR was previously part of the 1.20.5 branch. It is in the middle of a rework, and is not quite ready for this version. We are still planning to include it in a later version (most likely 1.21.1). If you already updated and have to revert, sorry for the trouble!

import java.lang.foreign.*;
import java.nio.file.Path;
public class Main {
public static void main(String[] args) throws Throwable {
try (Arena arena = Arena.ofShared()) {
SymbolLookup vmSymbols = SymbolLookup.libraryLookup(Path.of("libLuau.VM.dylib"), arena);
SymbolLookup compilerSymbols = SymbolLookup.libraryLookup(Path.of("libLuau.Compiler.dylib"), arena);
public class MapAlterCommand {
private final Argument<MapData> mapArg;
private final Argument<String> nameArg = Argument.GreedyString("name")
.description("The new name for the map");
private final Argument<Material> displayItemArg = Argument.Material("item")
.description("The new display item for the map");
private final Argument<String> subvariantArg;
private final Argument<MapSize> sizeArg = Argument.Enum("size", MapSize.class)
.description("The new world border size for the map");
package net.hollowcube.mapmaker.backpack;
import net.kyori.adventure.key.Key;
import net.minestom.server.item.ItemComponent;
import net.minestom.server.item.ItemStack;
import net.minestom.server.item.Material;
import net.minestom.server.utils.validate.Check;
import org.jetbrains.annotations.NotNull;
import java.util.ArrayList;
package net.hollowcube.mapmaker.map.command.utility;
import com.google.inject.Inject;
import net.hollowcube.command.CommandContext;
import net.hollowcube.command.dsl.CommandDsl;
import net.hollowcube.mapmaker.map.block.vanilla.DripleafBlock;
import net.hollowcube.mapmaker.perm.PermManager;
import net.hollowcube.mapmaker.perm.PlatformPerm;
import net.minestom.server.entity.Player;
import org.jetbrains.annotations.NotNull;