Posted July 29, 20232 yr well i finally find a way to preload a custome chest whit things from a loot table //st = block pos warudo.setBlock( st, maletin_init.BRIEFCASE_BLOCK.get().defaultBlockState(), 10 ); container_9_ghost ghost = (container_9_ghost)warudo.getBlockEntity(st); CompoundTag NBT = ghost.serializeNBT(); NBT.putString("LootTable", "minecraft:chests/spawn_bonus_chest"); ghost.load(NBT); i dont know how it internally works just realize minecraft:structure_block set a tag on the blockentity nbt and i just artificially set the tag, it works, call it a day ####################################################################### two questions spawning first of all how doo i spand this vanilla loot lists in /home/usuario/.minecraft/versions/Forge 1.20.1/Forge 1.20.1/data/minecraft/loot_tables/chests/ to add costume items, they looks more complicated than the forge tag lists the second one is can i use this loot tables to spawn frames whit loot on mi costume structures ?? item frames have potential they allow you to make the frame invisible and give the impression of things just dropped on tables and floors Direction facing = (blkstate.getValue(UP))? Direction.UP : ((blkstate.getValue(DOWN))? Direction.DOWN : blkstate.getValue(FACING)); ItemStack dropstack = new ItemStack(ItemInit.INGOT_STEEL.get(), 1); ItemFrame pframe = new ItemFrame(warudo, pos, facing); //pframe.setItem(dropstack);//seems diferent from the chest block entity pframe.setInvisible(true); warudo.addFreshEntity(pframe); CompoundTag NBT = pframe.serializeNBT(); NBT.putString("LootTable", "minecraft:chests/spawn_bonus_chest"); pframe.load(NBT); //this dont works the frame its always invisible but empty
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.