So I've been looking into a whole bunch of things to figure this out such as custom crafting, but they take more than one item. What I'm trying to do is randomly replace a sapling or a skull that's on the ground as an item with either air or an emerald. Could someone help me with this?
I've seen videos for similar things, and it's much easier to have a named spawn egg that spawns like an endermite or something rather than placing a block.
you
Say you had an endermite egg named CraftEmerald, then you could run the following on a loop:
I disagree, it is much simpler to edit the item tags to turn it into a different item:
Type this into chat:
/scoreboard objectives add tileType dummy
Connect these to a clock:
/scoreboard players set @e[type=Item] tileType 0
/scoreboard players set @e[type=Item] tileType 1 {Item:{id:"minecraft:sapling",Count:1b},OnGround:1b}
/entitydata @e[type=Item,score_tileType=1,score_tileType_min=1] {Item:{id:"minecraft:emerald",damage:0s}}
A very slight change for the first clock command:
/scoreboard players set @e[type=Item,score_tileType_min=1] tileType 0
It depends on whether you want to a) alter existing blocks once you start the program, or b ) place down an item yourself and have it instantly turn into an emerald or whatever.
I am trying to replace log blocks with a plank block for a custom survival world. Everything works fine, but I cannot seem to be able to get it to be only place-able on grass and dirt.
Command I am using: entitydata @e[type=Item,score_LOGS=1,score_LOGS_min=1] {Item:{id:"minecraft:planks",damage:0s,CanPlaceOn:["minecraft:grass","minecraft:dirt"]}}
So I've been looking into a whole bunch of things to figure this out such as custom crafting, but they take more than one item. What I'm trying to do is randomly replace a sapling or a skull that's on the ground as an item with either air or an emerald. Could someone help me with this?
I've seen videos for similar things, and it's much easier to have a named spawn egg that spawns like an endermite or something rather than placing a block.
you
Say you had an endermite egg named CraftEmerald, then you could run the following on a loop:
/execute @e[type=Endermite,name=CraftEmerald] ~ ~ ~ /summon tile.item.name.minecraft:emerald ~ ~ ~
(Note: that's all one command) /\
L-- I think that's right, but I can't be sure...
ALSO INCLUDE SOMETHING RIGHT AFTER TO KILL THE ENDERMITE (or you'll get an infinite spring of emeralds)
So anytime there was an endermite meeting the criteria (the custom name), it would summon an emerald in its place.
Cheers! -TheEpicGabriel0
I disagree, it is much simpler to edit the item tags to turn it into a different item:
Type this into chat:
/scoreboard objectives add tileType dummy
Connect these to a clock:
/scoreboard players set @e[type=Item] tileType 0
/scoreboard players set @e[type=Item] tileType 1 {Item:{id:"minecraft:sapling",Count:1b},OnGround:1b}
/entitydata @e[type=Item,score_tileType=1,score_tileType_min=1] {Item:{id:"minecraft:emerald",damage:0s}}
Or:
Without the restriction, every single item will be given a score even though they won't need it, inflating the scoreboard file.
Minecraft-things: http://skylinerw.com
More Minecraft-things: https://sourceblock.net
Guides for command-related features (eventually moving to Source Block): https://github.com/skylinerw/guides
I primarily hang out in the /r/MinecraftCommands discord, where there's a lot of people that help with commands: https://discord.gg/QAFXFtZ
Their corresponding subreddit: https://www.reddit.com/r/MinecraftCommands/
It depends on whether you want to a) alter existing blocks once you start the program, or b ) place down an item yourself and have it instantly turn into an emerald or whatever.
Cheers! -TheEpicGabriel0
I am trying to replace log blocks with a plank block for a custom survival world. Everything works fine, but I cannot seem to be able to get it to be only place-able on grass and dirt.
Command I am using: entitydata @e[type=Item,score_LOGS=1,score_LOGS_min=1] {Item:{id:"minecraft:planks",damage:0s,CanPlaceOn:["minecraft:grass","minecraft:dirt"]}}
And yes, I am using LOGS instead of tileType.