All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.minestom.server.item.component.SeededContainerLoot Maven / Gradle / Ivy

There is a newer version: 7320437640
Show newest version
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()
    );
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy