1

One Command Randomizer Help

Sardonyx's Avatar Sardonyx9/18/15 10:05 pm
1 emeralds 660 6
9/23/2015 8:43 am
Sardonyx's Avatar Sardonyx
Hey everyone. I have been trying to make a Lucky Block One Command Creation. I have been having trouble with my psuedo-randomizer. The issue I'm having is that instead of either dropping Anti-Romantic Rose OR One Hit Kill, it drops either both or just One Hit Kill. I have tried many different ways to fix it, like changing when the randomizer resets the score, the execute selectors and the /kill selectors. Here is the source and the command.
Source:
Click to reveal
#Objectives
INIT:/scoreboard objectives add luckyBlockCraft dummy
INIT:/scoreboard objectives add luckyBlockUse dummy
INIT:/scoreboard objectives add luckyRandom dummy
#
#
#Crafting
/scoreboard players set @e[type=Item] luckyBlockCraft 1 {Item:{id:"minecraft:gold_ingot",Count:8b}}
/scoreboard players set @e[type=Item] luckyBlockCraft 2 {Item:{id:"minecraft:dropper",Count:1b}}
/execute @e[type=Item,score_luckyBlockCraft_min=2] ~ ~ ~ /execute @e[r=1,type=Item,score_luckyBlockCraft=1] ~ ~ ~ /summon Item ~ ~1 ~ {CustomName:"Lucky Block",CustomNameVisible:1,Item:{id:spawn_egg,Damage:61,Count:1,tag:{display:{Name:"LuckyBlock"}}}}
/execute @e[type=Item,score_luckyBlockCraft_min=2] ~ ~ ~ /execute @e[r=1,type=Item,score_luckyBlockCraft=1] ~ ~ ~ /kill @e[type=Item,score_luckyBlockCraft_min=1]
/execute @e[type=Item,score_luckyBlockCraft_min=2] ~ ~ ~ /execute @e[r=1,type=Item,score_luckyBlockCraft=1] ~ ~ ~ /kill @e[type=Item,score_luckyBlockCraft_min=1]
#
#
#Randomizer
/scoreboard players add @e[name=luckyBlock,type=ArmorStand] luckyRandom 1
/scoreboard players set @e[score_luckyRandom_min=2] luckyRandom 0
#
#
#Placing
/execute @e[type=Blaze,name=LuckyBlock] ~ ~ ~ /summon ArmorStand ~ ~ ~ {CustomName:"luckyBlock",Marker:1b,Invisible:1,Invulnerable:1,NoGravity:1,DisabledSlots:2039583}
/execute @e[type=Blaze,name=LuckyBlock] ~ ~ ~ setblock ~ ~ ~ stained_glass 4
/execute @e[type=Blaze,name=LuckyBlock] ~ ~ ~ /kill @e[type=Blaze,name=LuckyBlock,r=1]
#
#
#Using
/execute @e[name=luckyBlock,type=ArmorStand,score_luckyRandom_min=0,score_luckyRandom=0] ~ ~ ~ detect ~ ~ ~ minecraft:air -1 /summon Item ~ ~1 ~ {Item:{id:red_flower,Count:1,tag:{display:{Name:"Anti-Romantic Rose"},ench:[{id:19,lvl:10}]}}}
/execute @e[name=luckyBlock,type=ArmorStand,score_luckyRandom_min=1,score_luckyRandom=1] ~ ~ ~ detect ~ ~ ~ minecraft:air -1 /summon Item ~ ~1 ~ {CustomName:"One Hit Kill",CustomNameVisible:1,Item:{id:diamond_sword,Damage:1562,Count:1,tag:{display:{Name:"One Hit Kill"},ench:[{id:16,lvl:127}]}}}

/execute @e[name=luckyBlock,type=ArmorStand,score_luckyRandom_min=1,score_luckyRandom=1] ~ ~ ~ detect ~ ~ ~ minecraft:air -1 /kill @e[type=ArmorStand,name=luckyBlock,r=1]

Command:
Click to reveal
/summon MinecartCommandBlock ~ ~1 ~ {Command:kill @e[type=MinecartCommandBlock,r=1],Riding:{id:MinecartCommandBlock,Command:setblock ~ ~-1 ~1 redstone_block,Riding:{id:MinecartCommandBlock,Command:setblock ~ ~ ~1 command_block 0 replace {Command:fill ~ ~-3 ~-1 ~ ~ ~ air},Riding:{id:MinecartCommandBlock,Command:"/scoreboard objectives add luckyRandom dummy",Riding:{id:MinecartCommandBlock,Command:"/scoreboard objectives add luckyBlockUse dummy",Riding:{id:MinecartCommandBlock,Command:"/scoreboard objectives add luckyBlockCraft dummy",Riding:{id:MinecartCommandBlock,Command:blockdata ~3 ~-2 ~-1 {Command:fill ~ ~ ~1 ~5 ~1 ~1 stone},Riding:{id:MinecartCommandBlock,Command:blockdata ~3 ~-2 ~1 {Command:fill ~ ~ ~-1 ~5 ~1 ~-1 redstone_block},Riding:{id:MinecartCommandBlock,Command:blockdata ~4 ~-2 ~-1 {Command:"/scoreboard players set @e[type=Item] luckyBlockCraft 1 {Item:{id:\\\"minecraft:gold_ingot\\\",Count:8b}}"},Riding:{id:MinecartCommandBlock,Command:blockdata ~4 ~-2 ~1 {Command:"/scoreboard players set @e[type=Item] luckyBlockCraft 2 {Item:{id:\\\"minecraft:dropper\\\",Count:1b}}"},Riding:{id:MinecartCommandBlock,Command:blockdata ~5 ~-2 ~-1 {Command:"/execute @e[type=Item,score_luckyBlockCraft_min=2] ~ ~ ~ /execute @e[r=1,type=Item,score_luckyBlockCraft=1] ~ ~ ~ /summon Item ~ ~1 ~ {CustomName:\\\"Lucky Block\\\",CustomNameVisible:1,Item:{id:spawn_egg,Damage:61,Count:1,tag:{display:{Name:\\\"LuckyBlock\\\"}}}}"},Riding:{id:MinecartCommandBlock,Command:blockdata ~5 ~-2 ~1 {Command:"/execute @e[type=Item,score_luckyBlockCraft_min=2] ~ ~ ~ /execute @e[r=1,type=Item,score_luckyBlockCraft=1] ~ ~ ~ /kill @e[type=Item,score_luckyBlockCraft_min=1]"},Riding:{id:MinecartCommandBlock,Command:blockdata ~6 ~-2 ~-1 {Command:"/execute @e[type=Item,score_luckyBlockCraft_min=2] ~ ~ ~ /execute @e[r=1,type=Item,score_luckyBlockCraft=1] ~ ~ ~ /kill @e[type=Item,score_luckyBlockCraft_min=1]"},Riding:{id:MinecartCommandBlock,Command:blockdata ~6 ~-2 ~1 {Command:"/scoreboard players add @e[name=luckyBlock,type=ArmorStand] luckyRandom 1"},Riding:{id:MinecartCommandBlock,Command:blockdata ~7 ~-2 ~-1 {Command:"/scoreboard players set @e[score_luckyRandom_min=2] luckyRandom 0"},Riding:{id:MinecartCommandBlock,Command:blockdata ~7 ~-2 ~1 {Command:"/execute @e[type=Blaze,name=LuckyBlock] ~ ~ ~ /summon ArmorStand ~ ~ ~ {CustomName:\\\"luckyBlock\\\",Marker:1b,Invisible:1,Invulnerable:1,NoGravity:1,DisabledSlots:2039583}"},Riding:{id:MinecartCommandBlock,Command:blockdata ~8 ~-2 ~-1 {Command:"/execute @e[type=Blaze,name=LuckyBlock] ~ ~ ~ setblock ~ ~ ~ stained_glass 4"},Riding:{id:MinecartCommandBlock,Command:blockdata ~8 ~-2 ~1 {Command:"/execute @e[type=Blaze,name=LuckyBlock] ~ ~ ~ /kill @e[type=Blaze,name=LuckyBlock,r=1]"},Riding:{id:MinecartCommandBlock,Command:blockdata ~3 ~-1 ~-1 {Command:"/execute @e[name=luckyBlock,type=ArmorStand,score_luckyRandom_min=0,score_luckyRandom=0] ~ ~ ~ detect ~ ~ ~ minecraft:air -1 /summon Item ~ ~1 ~ {Item:{id:red_flower,Count:1,tag:{display:{Name:\\\"Anti-Romantic Rose\\\"},ench:[{id:19,lvl:10}]}}}"},Riding:{id:MinecartCommandBlock,Command:blockdata ~3 ~-1 ~1 {Command:"/execute @e[name=luckyBlock,type=ArmorStand,score_luckyRandom_min=1,score_luckyRandom=1] ~ ~ ~ detect ~ ~ ~ minecraft:air -1 /summon Item ~ ~1 ~ {CustomName:\\\"One Hit Kill\\\",CustomNameVisible:1,Item:{id:diamond_sword,Damage:1562,Count:1,tag:{display:{Name:\\\"One Hit Kill\\\"},ench:[{id:16,lvl:127}]}}}"},Riding:{id:MinecartCommandBlock,Command:blockdata ~4 ~-1 ~-1 {Command:"/execute @e[name=luckyBlock,type=ArmorStand,score_luckyRandom_min=1,score_luckyRandom=1] ~ ~ ~ detect ~ ~ ~ minecraft:air -1 /kill @e[type=ArmorStand,name=luckyBlock,r=1]"},Riding:{id:MinecartCommandBlock,Command:setblock ~3 ~-2 ~ redstone_block,Riding:{id:MinecartCommandBlock,Command:fill ~3 ~-2 ~-1 ~4 ~-1 ~-1 command_block,Riding:{id:MinecartCommandBlock,Command:fill ~3 ~-2 ~-1 ~8 ~-2 ~-1 command_block,Riding:{id:MinecartCommandBlock,Command:fill ~3 ~-2 ~1 ~3 ~-1 ~1 command_block,Riding:{id:MinecartCommandBlock,Command:fill ~3 ~-2 ~1 ~8 ~-2 ~1 command_block,Riding:{id:MinecartCommandBlock,Command:fill ~2 ~-2 ~-2 ~9 ~-1 ~2 stained_glass 3 replace stained_hardened_clay 3,Riding:{id:MinecartCommandBlock,Command:fill ~2 ~-3 ~-2 ~9 ~ ~2 stained_hardened_clay 3 hollow,Riding:{id:MinecartCommandBlock,Command:gamerule commandBlockOutput false,Riding:{id:MinecartCommandBlock,Riding:{id:FallingSand,Block:activator_rail,Time:1,Riding:{id:FallingSand,Block:redstone_block,Time:1,Riding:{id:FallingSand,Block:stone,Time:1}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}

Please help!!! I have no idea what to do to fix this
Posted by Sardonyx's Avatar
Sardonyx
Level 50 : Grandmaster Pixel Painter
86

Create an account or sign in to comment.

6

Sardonyx
09/23/2015 8:43 am
Level 50 : Grandmaster Pixel Painter
Sardonyx's Avatar
Thanks I can't test right now but it seems like that would make sense and would be easy to miss. The reason I have the detect part is so that when you break the block that is placed down, it will drop the items, not before.
EDIT: I just changed the /execute to execute on all armor stands. I can't use just a /kill @a[type=armorStand,name=luckyBlock] since it would kill all unopened lucky blocks, but you pointed out the right commands so I got it working Thanks!
1
Jmal116
09/22/2015 8:01 pm
Level 33 : Artisan Engineer
Jmal116's Avatar
I may have found the issue. The very last command you give kills any armor stands with a score of 1, however you never kill the ones with a score of 0. This means on the next tick they will get a score of 1, and spawn in the other item before dying. To fix it, just modify the kill command so that it kills all the 0's as well as the 1's.

Also, you don't need the extra execute to kill the armor stands, unless the detecting air part is necessary for some reason (I'm not really familiar with how lucky blocks works, or how your mech works). You should just be able to kill them with a normal /kill:kill @e[name=luckyBlock,type=ArmorStand,score_luckyRandom_min=0,score_luckyRandom=1]
1
Sardonyx
09/22/2015 7:41 pm
Level 50 : Grandmaster Pixel Painter
Sardonyx's Avatar
Although I appreciate your help, the answers haven't really helped. I can't use the armorstand summon or setblock options because they aren't really OCC compatible. If someone could look through the commands and see why it is summoning both drops I wold be really happy, since I have no idea...
1
Jmal116
09/20/2015 5:08 pm
Level 33 : Artisan Engineer
Jmal116's Avatar
Typically a good way of doing quick randomizers is to have a bunch of armor stands set up near command blocks representing the different outcomes you want, and then targeting one of them with the @r selector.

So in this case, have two sets of command blocks, one for each item you want to drop. Place an armor stand next to each one, and name them something special (for example, mine will be called "SomethingSpecial"). From there, you can run a fill command on one of those to randomly trigger one of your sets of command blocks:execute @r[type=ArmorStand,name=SomethingSpecial] ~ ~ ~ fill x y z x1 y1 z1 redstone_block
Just remember to delete the redstone block when you're done so the randomizer can be used again.
1
Zoyarox
09/20/2015 11:23 am
Level 21 : Expert Blockhead
Zoyarox's Avatar
Hmm, so I would suggest you to look into the comamnd of some other Lucky Block commands.
I randomized actions by summonign an entity at another random entity in a radius of 5. Underneath was a pressureplate that kills the summoned entity and triggers an action
1
Sardonyx
09/20/2015 9:43 am
Level 50 : Grandmaster Pixel Painter
Sardonyx's Avatar
I am still looking for help!
1
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome