net.minestom.server.item.component.SeededContainerLoot Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of minestom-snapshots Show documentation
Show all versions of minestom-snapshots Show documentation
1.20.4 Lightweight Minecraft server
package net.minestom.server.item.component;
import net.kyori.adventure.nbt.CompoundBinaryTag;
import net.minestom.server.utils.nbt.BinaryTagSerializer;
import org.jetbrains.annotations.NotNull;
public record SeededContainerLoot(@NotNull String lootTable, long seed) {
public static final BinaryTagSerializer NBT_TYPE = BinaryTagSerializer.COMPOUND.map(
tag -> new SeededContainerLoot(tag.getString("loot_table"), tag.getLong("seed")),
loot -> CompoundBinaryTag.builder()
.putString("loot_table", loot.lootTable)
.putLong("seed", loot.seed)
.build()
);
}