Minecraft – Hockey minigame scoreboard doesn’t work

minecraft-commandsminecraft-java-edition

I run a small server that focuses on towny but also has a couple minigames on top of that. I added hockey rink that uses knockback 10 sticks and a pig with a bunch of health to play the game with. I have a button that gives a countdown and then spawns the pig.

But can I make it so that when the pig enters the goal area, it turns on a lamp, then kills the pig? Then someone can press the spawn button and when they score a second goal, a second lamp illuminates, there will also be a set of lamps for each team. Then, when the game is over, someone presses a button, and the lamps all turn off and the game resets.

So far since I don't know any command block stuff, I tried using some redstone, hoppers, pistons, dispensers and other stuff to try to build one without command blocks, but it doesn't work at all.

Best Answer

OK so look at this picture I will tell you what to put in each block

enter image description here

first put a command block at the end of the summoning that says /setbock <X of redstone (X) in picture> <Y of redstone (X) in picture> <Z of redstone (X) in picture> minecraft:redstone_block put the X Y and Z somewhere no one will see this will be the redstone block (X) in the picture

for 1 have a repeating command block that is needs redstone says /kill @e[type=Pig,x=<X of one corner> y=<Y of one corner>,z=<Z of one corner>,dx=<distance on X from one corner to the other>, dy=<distance on Y from one corner to the other>, dz=<distance on Z from one corner to the other> replace all with the actual distance of the X/Y/Z

for 2 have a chain command block off of that that is always active and conditional that says /setblock <X of behind 1st Lamp> <Y of behind 1st Lamp> <Z of behind 1st Lamp> minecraft:redstone_block once again replace all with the actual X/Y/Z

Have command block 3 be chain always active and conditional and have this command/setbock <X of wool> <Y of wool> <Z of wool> minecraft:redstone_block

now in command block 4 make it put this command /setbock <X of redstone (X) in picture> <Y of redstone (X) in picture> <Z of redstone (X) in picture> minecraft:redstone_block Now set the X Y and Z to whare you put the redstone block earlier

5 is the same as one

6 is conditional always active and chain/setblock <X of behind 2nd Lamp> <Y of behind 2nd Lamp> <Z of behind 2nd Lamp> minecraft:redstone_block

now you need a reset button make it go into a impulse needs redstone unconditional and make it say /setbock <X of wool> <Y of wool> <Z of wool> minecraft:air

Now copy this for the other goal

now you should be done hopefuly this works by the way what is your server's IP?