Hi, what command i need to make when a player holds an item, it removes one from scoreboard, Is it possible? please write the full command. Thank you
Rollback Post to RevisionRollBack
" Don't wish death on your enemies.
Wish geese on them. Wish thousands of geese
into their life. Geese in their yard, Geese
in their car. Geese in their workplace, Geese in their bed,
Tiny geese in their hair, Geese in their food, JPEGs of angry geese overtaking their computer, Turn their whole family into geese. Awful hissy mean geese everywhere. A fate worse than death. "
" Don't wish death on your enemies.
Wish geese on them. Wish thousands of geese
into their life. Geese in their yard, Geese
in their car. Geese in their workplace, Geese in their bed,
Tiny geese in their hair, Geese in their food, JPEGs of angry geese overtaking their computer, Turn their whole family into geese. Awful hissy mean geese everywhere. A fate worse than death. "
" Don't wish death on your enemies.
Wish geese on them. Wish thousands of geese
into their life. Geese in their yard, Geese
in their car. Geese in their workplace, Geese in their bed,
Tiny geese in their hair, Geese in their food, JPEGs of angry geese overtaking their computer, Turn their whole family into geese. Awful hissy mean geese everywhere. A fate worse than death. "
Apparently this with say 'Hi' if a player has an arrow (not tested)
execute at @a[nbt={Inventory:[{id:"minecraft:arrow"}]}] run say hi
If this works then it shouldn't be difficult to alter this for whatever item you want to test for - although you say you want the player to be holding the item, while this (I guess) is IF the item is in the players inventory
Did find this that may be what you are looking for - I think 'slot: -106' is the offhand slot based on this
/execute as @a[nbt={Inventory:[{id:"minecraft:your_item",Slot:-106b,tag:{display:{Name:"--insert the json stuff you use in the give command--"}}}]}]
Unfortunately I've never played around with scoreboards so don't know how to 'subtract 1' from it or how to do the subtraction after every second
"insert the json stuff you use in the give command"
what does it mean? Give command of what?
And can't it be all the slots? Because i want the player to hold a torch, so in optifine it makes light shen you hold it, and if he holds it in any other slot it will not subtract anything from scoreboard, so its a little bit of a 'cheating'
" Don't wish death on your enemies.
Wish geese on them. Wish thousands of geese
into their life. Geese in their yard, Geese
in their car. Geese in their workplace, Geese in their bed,
Tiny geese in their hair, Geese in their food, JPEGs of angry geese overtaking their computer, Turn their whole family into geese. Awful hissy mean geese everywhere. A fate worse than death. "
Again, /testfor is gone in 1.13.1 i found it on the forum for ' deley with command blocks
Rollback Post to RevisionRollBack
" Don't wish death on your enemies.
Wish geese on them. Wish thousands of geese
into their life. Geese in their yard, Geese
in their car. Geese in their workplace, Geese in their bed,
Tiny geese in their hair, Geese in their food, JPEGs of angry geese overtaking their computer, Turn their whole family into geese. Awful hissy mean geese everywhere. A fate worse than death. "
"insert the json stuff you use in the give command"
what does it mean? Give command of what?
:
:
Again, /testfor is gone in 1.13.1 i found it on the forum for ' deley with command blocks
Ok - firstly I appologise about the delay post - I was a little rushed off my feet at the time & so didn't read the whole post so missed the '/Testfor' bit further on, but I would take a guess that /execute as @a[score_Delay=0] MAY be a 1.13 version of something similar to it..
As I said I've never played with Scorecard but I would assume the code line is saying something like 'Check the Scorecoard value of 'score_Delay' for all players & if '0' then at that player location whos value IS '0' do....' (I'm sure someone with more experience with scoreboards & execute commands could make it clearer)
As for the 'insert the json stuff you use in the give command' I would assume this is probably for custom items
Ok, thank you, but if you move the torch a slot it will not subtract 1 from scoreboard (So players can cheat). I've seen commands that you can't move an item from a slot. I know its a /execute command, but i don't know the full command.
And the command /execute as @a[score_delay:0] will make the count delay to 0, and i want the delay to be one second, what means that every second the player holds the torch, it will subtract 1 per second
" Don't wish death on your enemies.
Wish geese on them. Wish thousands of geese
into their life. Geese in their yard, Geese
in their car. Geese in their workplace, Geese in their bed,
Tiny geese in their hair, Geese in their food, JPEGs of angry geese overtaking their computer, Turn their whole family into geese. Awful hissy mean geese everywhere. A fate worse than death. "
Ok, I've tried a few commands, they are not working. i will just change to 1.12.
testfor is an important command
Rollback Post to RevisionRollBack
" Don't wish death on your enemies.
Wish geese on them. Wish thousands of geese
into their life. Geese in their yard, Geese
in their car. Geese in their workplace, Geese in their bed,
Tiny geese in their hair, Geese in their food, JPEGs of angry geese overtaking their computer, Turn their whole family into geese. Awful hissy mean geese everywhere. A fate worse than death. "
" Don't wish death on your enemies.
Wish geese on them. Wish thousands of geese
into their life. Geese in their yard, Geese
in their car. Geese in their workplace, Geese in their bed,
Tiny geese in their hair, Geese in their food, JPEGs of angry geese overtaking their computer, Turn their whole family into geese. Awful hissy mean geese everywhere. A fate worse than death. "
Do you want to help me by joining the world? i think it is easier to show it there
How do i make a server? (Not server.pro)
Rollback Post to RevisionRollBack
" Don't wish death on your enemies.
Wish geese on them. Wish thousands of geese
into their life. Geese in their yard, Geese
in their car. Geese in their workplace, Geese in their bed,
Tiny geese in their hair, Geese in their food, JPEGs of angry geese overtaking their computer, Turn their whole family into geese. Awful hissy mean geese everywhere. A fate worse than death. "
" Don't wish death on your enemies.
Wish geese on them. Wish thousands of geese
into their life. Geese in their yard, Geese
in their car. Geese in their workplace, Geese in their bed,
Tiny geese in their hair, Geese in their food, JPEGs of angry geese overtaking their computer, Turn their whole family into geese. Awful hissy mean geese everywhere. A fate worse than death. "
I said I don't know enough about scoreboard etc but I've at least tried reading some of the search results to have a stab at it
HOPEFULLY what I've figured out may help you on figuring out what you need by yourself
Here goes:-
Step 1: Set up a scoreboard - use '/scoreboard objectives add tester dummy'
Step 2: Display the scoreboard - use '/scoreboard objectives setdisplay sidebar tester'
> you won't see anything until someone has had the dummy objective 'tester' changed
Step 3: Set a value for player - use '/scoreboard players set <name> tester 1000'
> naturally <name> is whoever you want to be added to the scoreboard , such as yourself
Step 4: Give yourself a command block - use '/give <name> command_block 1'
Step 5: Place it & type in 'execute as @a[nbt={Inventory:[{id:"minecraft:torch"}]}] run scoreboard players remove @s tester 1'
> Make the command block 'Repeat' and 'Always Active'
Step 6: place another commandblock down & copy/paste 'I'
> Make this also 'Repeat' and 'Always Active'
Step 7: Place a comparitor coming out of this & place a redstonelamp next to this
Now what happens is whenever a player picks up a torch & has it in their inventory the scoreboard counter will start to count down (this is the first command block you placed)
When the score of 'tester' is 1 or less (the 'tester=..1' part of the second command block) then the comparitor comes on & the redstone lamp lights up
- this signal can go into any other command block, redstone circuit - or whatever you want to happen when the score of 'tester'<0
The only problem is that the light will come on & STAY on if ANY player 'tester' score is less than zero (I've tried this out using an alt on a LAN networks world), so I'd guess you would need to set up command blocks to remove the player that has reached zero from the scoreboard somehow.
Unfortunately I've not figured that bit out.. all I know is to remove a player from scoreboard is to use '/scoreboard players reset <name> <objective>'
As for your - 'every second' bit, perhaps you could have 2 'dummy' scoreboards (lets say 1 called 'delay' & the other called 'burnout').
I guess you could set 'delay' to 20 (I'm assuming command blocks work on a 'per tick' methoda & since 20 ticks is approx 1 second - hence the value of '20'), get that to deduct by 1 while player is holding the item, check to see if that reaches zero which - when it does - in turns activates a couple of command blocks: 1 that deducts '1' from 'burnout' & the other that reset 'delay' to 20.
You would then need a thirs command block that checks the value of 'burnout' so that when THAT reaches 'zero' it activates whatever you want to happen when time runs out
" Don't wish death on your enemies.
Wish geese on them. Wish thousands of geese
into their life. Geese in their yard, Geese
in their car. Geese in their workplace, Geese in their bed,
Tiny geese in their hair, Geese in their food, JPEGs of angry geese overtaking their computer, Turn their whole family into geese. Awful hissy mean geese everywhere. A fate worse than death. "
it works, but can you find a command that only if i hold the torch in slot 0 it removes one from scoreboard?
Rollback Post to RevisionRollBack
" Don't wish death on your enemies.
Wish geese on them. Wish thousands of geese
into their life. Geese in their yard, Geese
in their car. Geese in their workplace, Geese in their bed,
Tiny geese in their hair, Geese in their food, JPEGs of angry geese overtaking their computer, Turn their whole family into geese. Awful hissy mean geese everywhere. A fate worse than death. "
/execute as @a[nbt={Inventory:[{id:"minecraft:your_item",Slot:-106b,tag:{display:{Name:"--insert the json stuff you use in the give command--"}}}]}]
So I would guess using Dheatly line of 'scoreboard players remove @a[nbt={Inventory:[{id:"minecraft:torch"}]}] delay 1' it would look something like 'scoreboard players remove @a[nbt={Inventory:[{id:"minecraft:torch",Slot:0}]}] delay 1'
" Don't wish death on your enemies.
Wish geese on them. Wish thousands of geese
into their life. Geese in their yard, Geese
in their car. Geese in their workplace, Geese in their bed,
Tiny geese in their hair, Geese in their food, JPEGs of angry geese overtaking their computer, Turn their whole family into geese. Awful hissy mean geese everywhere. A fate worse than death. "
Hi, what command i need to make when a player holds an item, it removes one from scoreboard, Is it possible? please write the full command. Thank you
Command Block #1:
Command Block #2:
Have the command blocks stored like this (make sure there is a clock on command block #1)
I don't want the scoreboard to reset, just every second the player holds an item, every second he holds the item, it decreases only 1 from scoreboard
And this command (/testfor) isn't working on 1.13.1
I found this tit-bit of info on another thread..
Apparently this with say 'Hi' if a player has an arrow (not tested)
If this works then it shouldn't be difficult to alter this for whatever item you want to test for - although you say you want the player to be holding the item, while this (I guess) is IF the item is in the players inventory
Did find this that may be what you are looking for - I think 'slot: -106' is the offhand slot based on this
Unfortunately I've never played around with scoreboards so don't know how to 'subtract 1' from it or how to do the subtraction after every second
EDIT found this to subtract 1 from scoreboards
EDIT #2 found this to make a delay with command blocks
These seem to be for older version so not sure if they work in 1.13
"insert the json stuff you use in the give command"
what does it mean? Give command of what?
And can't it be all the slots? Because i want the player to hold a torch, so in optifine it makes light shen you hold it, and if he holds it in any other slot it will not subtract anything from scoreboard, so its a little bit of a 'cheating'
Again, /testfor is gone in 1.13.1 i found it on the forum for ' deley with command blocks
Ok - firstly I appologise about the delay post - I was a little rushed off my feet at the time & so didn't read the whole post so missed the '/Testfor' bit further on, but I would take a guess that /execute as @a[score_Delay=0] MAY be a 1.13 version of something similar to it..
As I said I've never played with Scorecard but I would assume the code line is saying something like
'Check the Scorecoard value of 'score_Delay' for all players & if '0' then at that player location whos value IS '0' do....'
(I'm sure someone with more experience with scoreboards & execute commands could make it clearer)
As for the 'insert the json stuff you use in the give command' I would assume this is probably for custom items
For example if you gave a player an item using
then the line would read something like
Ok, thank you, but if you move the torch a slot it will not subtract 1 from scoreboard (So players can cheat). I've seen commands that you can't move an item from a slot. I know its a /execute command, but i don't know the full command.
And the command /execute as @a[score_delay:0] will make the count delay to 0, and i want the delay to be one second, what means that every second the player holds the torch, it will subtract 1 per second
Ok, I've tried a few commands, they are not working. i will just change to 1.12.
testfor is an important command
Now i need /testfor commands
I don't know much about commands etc (or how to make them) but all I did was google 'testfor command in 1.13'
Came up with these results - so MAYBE one of these may help ??
If not maybe they can give you an idea on how to do what you want to do
As for the torch movement in inventory problem - would removing the 'slot' part of command work ??.. so that the command checks the whole inventory ??
I tried this command & it seem to work (sort of) everytime the player picks up any sand regardless where the sand is in their inventory
Do you want to help me by joining the world? i think it is easier to show it there
How do i make a server? (Not server.pro)
And none of your results can help
I said I don't know enough about scoreboard etc but I've at least tried reading some of the search results to have a stab at it
HOPEFULLY what I've figured out may help you on figuring out what you need by yourself
Here goes:-
Step 1: Set up a scoreboard - use '/scoreboard objectives add tester dummy'
Step 2: Display the scoreboard - use '/scoreboard objectives setdisplay sidebar tester'
> you won't see anything until someone has had the dummy objective 'tester' changed
Step 3: Set a value for player - use '/scoreboard players set <name> tester 1000'
> naturally <name> is whoever you want to be added to the scoreboard , such as yourself
Step 4: Give yourself a command block - use '/give <name> command_block 1'
Step 5: Place it & type in 'execute as @a[nbt={Inventory:[{id:"minecraft:torch"}]}] run scoreboard players remove @s tester 1'
> Make the command block 'Repeat' and 'Always Active'
Step 6: place another commandblock down & copy/paste 'I'
> Make this also 'Repeat' and 'Always Active'
Step 7: Place a comparitor coming out of this & place a redstonelamp next to this
Now what happens is whenever a player picks up a torch & has it in their inventory the scoreboard counter will start to count down (this is the first command block you placed)
When the score of 'tester' is 1 or less (the 'tester=..1' part of the second command block) then the comparitor comes on & the redstone lamp lights up
- this signal can go into any other command block, redstone circuit - or whatever you want to happen when the score of 'tester'<0
The only problem is that the light will come on & STAY on if ANY player 'tester' score is less than zero (I've tried this out using an alt on a LAN networks world), so I'd guess you would need to set up command blocks to remove the player that has reached zero from the scoreboard somehow.
Unfortunately I've not figured that bit out.. all I know is to remove a player from scoreboard is to use '/scoreboard players reset <name> <objective>'
As for your - 'every second' bit, perhaps you could have 2 'dummy' scoreboards (lets say 1 called 'delay' & the other called 'burnout').
I guess you could set 'delay' to 20 (I'm assuming command blocks work on a 'per tick' methoda & since 20 ticks is approx 1 second - hence the value of '20'), get that to deduct by 1 while player is holding the item, check to see if that reaches zero which - when it does - in turns activates a couple of command blocks: 1 that deducts '1' from 'burnout' & the other that reset 'delay' to 20.
You would then need a thirs command block that checks the value of 'burnout' so that when THAT reaches 'zero' it activates whatever you want to happen when time runs out
May i elaborate? This would be simpler with function/chain. Here's the commands (run in order):
I'm a programmer. I use C/C++, BASIC, Assembly, and Python. If i sound too technicial, that's because it's the way i think.
My Suggestions
Ok thank you both
it works, but can you find a command that only if i hold the torch in slot 0 it removes one from scoreboard?
Back in post #5 I posted
So I would guess using Dheatly line of 'scoreboard players remove @a[nbt={Inventory:[{id:"minecraft:torch"}]}] delay 1' it would look something like 'scoreboard players remove @a[nbt={Inventory:[{id:"minecraft:torch",Slot:0}]}] delay 1'
I don't need custom name for the torch