Level 18
Journeyman System
5

Forum Posts

1 - 3 of 3

    davidthorpester
    12/28/2015 11:07 am
    Level 18 : Journeyman System
    I think the best thing would be to use the stat.timeSinceDeath scoreboard stat.

    if you do:

    /scoreboard objectives add timesincedeath stat.timeSinceDeath

    Then you can give the book to anyone with a timesincedeath score less than say 100

    /give @p[score_timesincedeath=100] minecraft:book etc...

    To stop the person getting loads of books in the first 100 ticks since death you will need a command that runs straight afterwards to stop them receiving more than 1 book, something like:

    /scoreboard players set @a[score_timesincedeath=100] timesincedeath 101

    Once their score is set to more than 100 they will not receive any more books. In 1.9 snapshots its really easy to sequence the commands using the chain command blocks, otherwise in 1.8 you will need a fill clock that runs in the correct order.

    Hope this helps, David
    1
    davidthorpester
    09/29/2014 12:48 pm
    Level 18 : Journeyman System
    Wow just realised how old this post is! oooops
    1
    davidthorpester
    09/29/2014 12:45 pm
    Level 18 : Journeyman System
    Depending on the use you can do this without a clock circuit activating the testfor command block. If you use a pressure plate on the testfor which then outputs to do what you wanted, you can place a command block at the end of the chain which replaces the first testfor block:

    (example)
    setblock ~3 ~ ~ minecraft:command_block 0 replace {Command:"testfor @p[score_money_min=150,r=2]"}

    This will replace the first testfor block when the testfor is successful thus making the comparator not live until someone else treads on the pressure plate again
    1

1 - 3 of 3

Welcome