|
Post by spohnz on Jun 9, 2017 22:00:31 GMT -6
So Minecraft have updated their API and I think a lot of you regular minecrafters will take off with this stuff. Now we can use blocks with NBT So I played around with it today and created a script that will spawn 3 indestructible villagers and a golem. One gives out elytras the other a diamond sword and the third cooked mutton I am not sure if persistent:1 or persistent:0 is the one that makes them stay. Here is the code. import mcpi.minecraft as minecraft
mc = minecraft.Minecraft.create()
x,y,z = mc.player.getPos()
mc.spawnEntity('villager',x + 6, y, z,'{Profession:1b,Invulnerable:1b,PersistenceRequired:0b,Offers:{Recipes:[{buy:{id:"dirt",Count:1},maxUses:9999999,sell:{id:"cooked_mutton",Count:1}}]}}')
mc.spawnEntity('villager',x + 6, y, z,'{Profession:2b,Invulnerable:1b,PersistenceRequired:0b,Offers:{Recipes:[{buy:{id:"dirt",Count:1},maxUses:9999999,sell:{id:"elytra",Count:1}}]}}')
mc.spawnEntity('villager',x + 6, y, z,'{Profession:3b,Invulnerable:1b,PersistenceRequired:0b,Offers:{Recipes:[{buy:{id:"dirt",Count:1},maxUses:9999999,sell:{id:"diamond_sword",Count:1}}]}}')
mc.spawnEntity('VillagerGolem',x + 6, y, z,'{Invulnerable:1}') Ahh! forgot the link: minecraft.gamepedia.com/Tutorials/Command_NBT_tags
|
|