Skip to content
Discussion options

You must be logged in to vote

Ah, good question, editing block entity NBT is not really supported in anvil-parser2, apologies!
My suggestion would be to use an alternative package: amulet-core which does support this

In your example it would be something like:

from random import randint, choice

import amulet
from amulet.api.block import Block
from amulet.api.block_entity import BlockEntity
from amulet_nbt import NamedTag,  CompoundTag, ListTag, IntTag, ByteTag, StringTag


loot_table = ["minecraft:poppy", "minecraft:cocoa_beans"]
level = amulet.load_level("/path/to/your/minecraft/saves/myworld")
game_version = ("java", (1, 21, 5))


items = [
    CompoundTag({
        'count': IntTag(randint(1, 4)),
        'Slot': B…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by 0xTiger
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants