Tutorials/Useful commands

Commands is useful for map building, Creative mode, etc. In this article we will list out some useful commands.

Invisible Item Frame
Item Frame is an entity. We can get an invisible Item Frame using command. This is the command: /give @p minecraft:item_frame{EntityTag:{Invisible:1}}

Villager Trades
Villagers are passive mobs and they live in villages. We can trade with them. By using command, we can spawn villagers with custom trades. /summon villager ~ ~1 ~ {VillagerData:{profession:farmer,level:2,type:plains},CustomName:"\"John\"",Offers:{Recipes:[{buy:{id:emerald,Count:1},sell:{id:wheat,Count:1},rewardExp:0b,maxUses:9999999}]}} In this command, we will spawn a villager call John and he sells 1 wheat for 1 emerald. You can edit the  to other professions,   to specific biomes. You can see all the professions and types at here. You can change  to any name. Change the  to any items or blocks. defines the number of items. is the experience you get when you traded and  is how many time you can trade with. If you are too lazy to write these long commands, you can always use commands generators in the internet.

Replacing Blocks
By using command, we can replace a type of block in an area. /fill 16 ~ 16 0 ~ 0 minecraft:stone replace minecraft:grass_block The command above will replace grass block to stone in an area. The  is the coordinates. The block after  is the block we want to replace.