Help with something simple.

Discussion in 'Spigot Help' started by goldartz, Jun 6, 2017.

  1. So i've been trying to look for a plugin where if a player stands on a pressure plate and the player is holding a specific item a takes a way 1 diamond for example and then runs a command (The command is only ran if the player has that item). A couple days ago i learned that you can do this on Command blocks and i was wondering if someone can help me figure a way to do this with command blocks (1.8 commands pliz). If there is a plugin that does this please link it
     
  2. Doesn't sound like a plugin I know, however command blocks would be the way to do this, create a command block the takes a diamond from a player at a specific point so make sure to use a player selector which includes @p[x=,y=,z=,r=1] then add another command block which is only activated when the first is, (and if you want to do this in 1.8 make sure to have a 3rd command block which after maybe xseconds it would change the blockdata of the first command block setting the active state to false) and then the second command block would /execute at the pressure plates position.
     
  3. I'm a bit confused but i'll give it a try
     
  4. so I tried a small example and i included a fall back just in case some one else tried stealing credit via teams so heres what I did

    /scoreboard objectives add player_money dummy
    then with that i set up this little bad boy (see the image)
    1. scoreboard players set @p[c=1,x=16425,y=71,z=7262,r=1] player_money 1
    2. /testfor @p[c=1,x=16425,y=71,z=7262,r=1,score_player_money_min=1,score_player_money=1] {Inventory:[{id:"minecraft:diamond"}]}
    3. /testfor @p[c=1,x=16425,y=71,z=7262,r=1,score_player_money_min=1,score_player_money=1] {Inventory:[{id:"minecraft:diamond"}]}
    4. clear @p[c=1,x=16425,y=71,z=7262,r=1,score_player_money_min=1,score_player_money=1] diamond 1
    5. /execute @p[c=1,x=16425,y=71,z=7262,r=1,score_player_money_min=1,score_player_money=1] ~ ~ ~ /eco give @p[c=1,x=16425,y=71,z=7262,r=1,score_player_money_min=1,score_player_money=1] 100
    6. /clone 16428 70 7265 16428 70 7265 16427 70 7264
    I did however forget one command block before I did the picture, but include one more to set the players score back to 0 or reset it with. I would put this command block with a repeater with 1 tick after the 4,5,6 combo just to be 100% nothing goes wrong
    • /scoreboard players reset @p[c=1,x=16425,y=71,z=7262,r=1,score_player_money_min=1,score_player_money=1]
    Its probably a little big however it would work and its almost impossible to spoof it
     

    Attached Files: