can anyone help me how to do a code for making a points[score] for catching a pig one at a time. I need to setup my score sidebar thingy with the name pigs catched[screenshot pictures below]. The score per pigs catch is 1 point per pig at a time.It will automatically count the pig you catch when a pig goes to a trip wire hook with a command block.please help.:(
First, create the scoreboard objective which will track the catching of pigs, do this in a command block not connected to anything else and run it by itself:
/scoreboard objectives add pigs dummy Pigs_Caught
This will create a scoreboard objective called pigs which is a dummy score (can only be changed by commands) that's display name is "Pigs_Caught".
Next, you have to make the objective show up on the sidebar:
/scoreboard objectives setdisplay sidebar pigs
Now you have to make it so when ever a pig triggers the trip wire, 1 is added to the closest person's score:
/scoreboard players add @p pigs 1
Connect this command block up to the tripwire. Finally I would suggest adding a way to kill the pig once it has touched the trip wire, so a new pig can trigger it. Either kill it with the /kill command, or have it dropped down a long shaft with a trap door or pushed gently away with water
.
Hope this has helped
This will create a scoreboard objective called pigs which is a dummy score (can only be changed by commands) that's display name is "Pigs_Caught".
Next, you have to make the objective show up on the sidebar:
Now you have to make it so when ever a pig triggers the trip wire, 1 is added to the closest person's score:
Connect this command block up to the tripwire. Finally I would suggest adding a way to kill the pig once it has touched the trip wire, so a new pig can trigger it. Either kill it with the /kill command, or have it dropped down a long shaft with a trap door or pushed gently away with water
.
Hope this has helped