Lexxer's Avatar
Member
Level 29 Expert Caveman
16

Forum Posts

1 - 20 of 64

    1
    02/15/2017 7:16 am
    Level 29 : Expert Caveman
    Lexxer
    Lexxer's Avatar
    You can just target the player who took damage and the target the nearest player:

    /execute @a[score_dt_min=1] ~ ~ ~ scoreboard players operation @p[c=1] h -= @p[c=1] dt

    This will target all players who took damage but since the nearest player is the player who got targeted by the execute command, this should solve your problem.
    1
    07/19/2016 7:07 pm
    Level 29 : Expert Caveman
    Lexxer
    Lexxer's Avatar
    You can do it with this command:
    /setblock ~ ~1 ~ minecraft:chest 2 replace {Items:[{id:spawn_egg,Damage:120,Count:1,tag:{EntityTag:{id:"Villager"}}}]}
    1
    07/17/2016 5:10 pm
    Level 29 : Expert Caveman
    Lexxer
    Lexxer's Avatar
    You can decrease the score of every player by 1.

    Then, test how many players still have a score higher then 1.
    /testfor @a[score_<score>_min=1]

    You will now need a stat command to get the amount of affected players:
    Click to reveal
    Create a new object to save the amount:
    /scoreboard objectives add affected dummy

    Initialise a dummyPlayer to hold the affetced score:
    /scoreboard players set Store affected 0

    And run this command on the testfor commandBlock:
    /stats block ~ ~-1 ~ set AffectedEntities Store affected


    If the affected score is 1 you can now target the player with the highest score easily:
    /execute @p[score_<score>_min=1] ~ ~ ~ /<command>
    since all other players will have a score of -1 or less.

    The only flaw is that it won't work if there are players with the same score who also happen to have the highest score.
    1
    07/13/2016 4:14 pm
    Level 29 : Expert Caveman
    Lexxer
    Lexxer's Avatar
    Ok, I think I understand.

    So the problem would be that the command would be executed by all players, that match the condition even if they haven't activated the system/command, right?

    In this case, a execute command should solve your problem.
    Someone activates the command,
    /execute @a[score_useItem_min=1] ~ ~ ~ /<command>
    If the selector for the <command> is '@p' it will only be executed at this one player.
    1
    07/13/2016 3:55 pm
    Level 29 : Expert Caveman
    Lexxer
    Lexxer's Avatar
    I am sorry, i don't see the difference between, do for everyone with if x and y and
    do someone with x and y.

    Could you maybe explain what you're aiming for exactly, or explain it a little more detailed?
    1
    07/13/2016 2:35 pm
    Level 29 : Expert Caveman
    Lexxer
    Lexxer's Avatar
    If you want to target a player depending on his score, then you need
    @a[score_<name>=<Max>,score_<name>_min=<Min>]

    You can find all possible parameters (Target selector arguments) here.
    1
    07/13/2016 1:50 pm
    Level 29 : Expert Caveman
    Lexxer
    Lexxer's Avatar
    What criteria are you looking for?
    Something like @e[<parameters>] or on the players NBT data?
    1
    07/11/2016 12:53 pm
    Level 29 : Expert Caveman
    Lexxer
    Lexxer's Avatar
    Your main problem here is, that you need to specify which parameters are what.

    Minecraft doesn't now, what
    @p[76,40,6,50]
    is, so it just assumes @p.

    You need to assign a parameter to the value. Otherwise, neither the game nor me or anyone knows what value represents what, so I just assume x/y/z and r?
    In this case you would need:
    @p[x=76,y=50,z=6,r=50]
    1
    07/10/2016 5:53 pm
    Level 29 : Expert Caveman
    Lexxer
    Lexxer's Avatar
    Basically, you can use:
    /execute @a[ry=RY,rym=RYM] ~ ~ ~ playsound <sound> <source> @p ~X ~ ~Z <volumen> <pitch> <minimumVolumen>

    RY=horizontal rotation max
    RYM=horizontal rotation min

    X=X cord relative to player
    Z=Z cord relative to player

    Then you need to the place the X/Z coordinates according to the ry and rym values.
    1
    07/09/2016 5:55 am
    Level 29 : Expert Caveman
    Lexxer
    Lexxer's Avatar
    /particle <particle> ~ ~ ~ <xd> <yd> <zd> <speed> <count> normal @e[type=<Entity>]
    1
    07/07/2016 9:39 am
    Level 29 : Expert Caveman
    Lexxer
    Lexxer's Avatar
    Just create an invisible entity (WhitherSkull or ArmorStand) and execute a command near it, if a player is near that entity.

    /execute @e[type=WitherSkull,name="unpassable"] ~ ~ ~ /tp @a[type=Player,r=2] X Y Z

    Would teleport a player within a radius of 2 from the witherSkull named "unpassable" to the X Y and Z coordinate.
    This will only affect players.
    1
    07/07/2016 6:32 am
    Level 29 : Expert Caveman
    Lexxer
    Lexxer's Avatar
    It's probably not the exact same command but it has a similar outcome.
    /summon ArmorStand ~1.8 ~-0.9 ~0.5 {Invisible:1b,NoBasePlate:1b,NoGravity:1b,ShowArms:1b,ArmorItems:[{},{},{},{}],HandItems:[{id:"minecraft:diamond_pickaxe",Count:1b},{}],DisabledSlots:65793,Pose:{RightArm:[86f,0f,91f]}}

    This will summon an invisible ArmorStand which is locked, therefore a player can't interact with it.

    However, you can use this ArmorStand generator to create other poses etc.
    1
    07/05/2016 10:11 am
    Level 29 : Expert Caveman
    Lexxer
    Lexxer's Avatar
    The command works, you need to right click the (invisible) ArmorStand, with the sword.
    1
    07/03/2016 3:22 pm
    Level 29 : Expert Caveman
    Lexxer
    Lexxer's Avatar
    Okay, I tested it and the entitydata command doesn't work together with the execute command for some reason.

    However, I changed the setup a bit, this worked for me:

    First(Repeating) command block:
    /scoreboard players add @e[type=Arrow] Arrow 1
    Second(chain, always active):
    /execute @a[tag=weakBow] ~ ~ ~ scoreboard players tag @e[type=Arrow,score_Arrow=1,r=2] add weakArrow
    Third(chain, always active):
    /entitydata @e[tag=weakArrow] {damage:0.0d}

    This should work now.
    1
    07/02/2016 5:08 am
    Level 29 : Expert Caveman
    Lexxer
    Lexxer's Avatar
    This works, because the damage updates to 0.
    1
    07/01/2016 6:48 pm
    Level 29 : Expert Caveman
    Lexxer
    Lexxer's Avatar
    Yes, you could just give every player that holds the specific item a regeneration effect.
    If they don't hold the item, test if the command fails with the {SuccessCount:0} and then give them the regen effect for 0 seconds which will remove the effect.
    1
    07/01/2016 4:48 pm
    Level 29 : Expert Caveman
    Lexxer
    Lexxer's Avatar
    I am not sure that this is what you are looking for, but I will describe it anyway.

    At first, I guess you want to save the money of every player in score objective.
    /scoreboard objectives add Money dummy

    Now you would just need a method to add money.
    One Method would be if a player kills a mob, you give him the money as reward:

    A player gains 2Money for killing a Zombie:
    /scoreboard objectives add killedZombies stat.killEntity.Zombie
    Now, if a player would kill a Zombie, increases his Money score by 2:
    /scoreboard players add @a[score_killed_Zombie_min=1] Money 2
    And reset the killedZombie score:
    /scoreboard players set @a[score_killedZombie_min=1] killedZombie 0

    Of course, you could use anything to increase the players Money score.

    Now for the (probably) more interesting part:

    You most likely want to make the player buy something, so i will going to create a system that makes it pretty easy to add items and give them a prize:

    First, set up a Price score:
    /scoreboard objectives add Price dummy
    You will also need a dummy object:
    /scoreboard objectives add dummy dummy

    You will need a chain of command Blocks:
    Repeating:
    /execute @a[score_Price_min=1] ~ ~ ~ scoreboard players operation @p[r=0] dummy = @p[r=0] Money
    This will set the Dummy score to the score, the Money score the player has.

    Chain(unconditional):
    /execute @a[score_Price_min=1] ~ ~ ~ /scoreboard players operations @p[r=0] dummy -= @p[r=0] Price
    This will reduce the dummy score by the Price, the item has.

    Chain(unconditional):
    /execute @a[score_dummy_min=0,score_Price_min=1] ~ ~ ~ /scoreboard players operation @p[r=0] Money -= @p[r=0] Price
    This will reduce the players money by the price of the item only if the player can affort it.

    Cahin(unconditional):
    /scoreboard players tag @a[score_dummy_min=0,score_Price_min01] add canAffort
    If the player can affort the item, give him the tag 'canAffort'.

    /scoreboard players set @a[score_Price_min=1] Price 0
    Reset the price for the player.

    This is the whole setup, now to add items:

    Lets say we want to sell an apple for 3, the setup would look something like the following:

    /scoreboard players set @p Price 3
    Add 3 as the price for the item.

    Place a comparator or something after that command, so that the main system can update in this tick.

    Now, after the comparator, place a Normal(need redstone) command Block:
    /give @a[tag=canAfford] minecraft:apple 1

    And finally, remove the tag(chain, always active):
    /scoreboard players tag @a[tag=canAfford] remove canAfford

    You can use the /tellraw command, to add something to this system.
    /tellraw @p ["",{"text":"Money:","color":"green","bold":true},{"score":{"name":"@p","objective":"Money"},"color":"red","bold":true}]
    Would put out: Money:0
    1
    07/01/2016 11:41 am
    Level 29 : Expert Caveman
    Lexxer
    Lexxer's Avatar
    Does it work, if you delete the parameters?
    /execute @a[tag=weakBow] ~ ~ ~ entitydata @e[type=Arrow] {damage:0.0d}

    And have you tested, if the Arrow actually does damage?
    1
    07/01/2016 7:50 am
    Level 29 : Expert Caveman
    Lexxer
    Lexxer's Avatar
    I thought that this was the error you get, in that case just try to increase the parameters, for example:
    /execute @a[tag=weakBow] ~ ~ ~ entitydata @e[type=Arrow,score_Arrow_min=1,score_Arrow=10,r=10,c=1] {damage:0.0d}

    Until it works.
    1
    07/01/2016 6:54 am
    Level 29 : Expert Caveman
    Lexxer
    Lexxer's Avatar
    It should work, maybe if you adjust the parameters "score_Arrow" and "r".

1 - 20 of 64

Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome