Jump to content

[1.19.4] add more things to existing vainilla loot table, and also add loot tables to frames


perromercenary00

Recommended Posts

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 

 




 

 

 

 

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.