1

Command Block Item Detection Help

JrFander's Avatar JrFander1/20/17 3:43 am
1 emeralds 334 1
1/20/2017 5:11 am
Pepijn's Avatar Pepijn
Hello. I am a map creator and I need some help with command block stuff.
So I am trying to make a smelters pickaxe for a game that I am creating. But I need some help with detecting dropped ores that are within the player's radius.
This is what I tried:
execute @a[score_BrokenBlocks_min=1] ~ ~ ~ testfor @e[type=Item,r=3] {Item:{id:minecraft:iron_ore}
BrokenBlocks is the scoreboard for the amount of iron ores the player mined
The players will be holding a pic in their hand and I have already done the detection for it.
This is the method

Testfor smelters pic in player's hand (done) -> testfor player with the BrokenBlocks score with the min of 1(done) -> testfor dropped iron ore within the radius of 3 from the player.(not done) -> Change the iron_ore which is within the player's radius to iron. (not done)

Also is there a way to do stage 3 and 4 in one command? if it is please tell me.
Thanks
Posted by JrFander's Avatar
JrFander
Level 1 : New Crafter
2

Create an account or sign in to comment.

1

1
01/20/2017 5:11 am
Level 57 : Grandmaster Cyborg
Pepijn
Pepijn's Avatar
I suggest using this command for stage 3 (this way the iron_ore items get tagged, which you can use as a selector argument in stage 4 so you know for sure only the iron ore items get converted to iron).


/execute @a[score_BrokenBlocks_min=1] ~ ~ ~ scoreboard players tag @e[type=Item,r=3,tag=!ironOre] add ironOre {Item:{id:minecraft:iron_ore}}


For stage 4, the iron ore to iron conversion, I would use this. This command converts the items with the tag "ironOre" to iron ingots (which can only be iron ores) and removes the "ironOre" tag (so the items don't keep converting, it's just to minimize lag)


/entitydata @e[tag=ironOre] {Item:{id:minecraft:iron_ingot},Tags:[]}
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome