• 0

    posted a message on Could i get some info on the Motion tag?

    You will never be able to edit player's motion.

    And player motion is buggy, it only seems to be correct when the player is jumping after they are running.

    If you want to detect if player moved, either use a walking/sneaking/running criteria, or check the difference of their position between current tick and previous tick.

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Help needed with TP Facing Command

    Because you missed an at @s after as @e.

    as only change who is/are the executors,

    at only change where the position should be.

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Help with entity detection (1.13.2)

    The XY Problem



    For your first attempt

    /execute at @a if entity @e[team=PB] positioned as "my nickname" run summon bat

    That, will run at all player's position, and if entity/entities in team PB exist, change the execute position same as "you", then summon bat at the end.


    For short, if any entity in team PB, summon bat at "your" position.

    While more than one player exist, equal amount of bat will be summon at "your" position.


    And your second attempt is merely the same as the first one.



    TL;DR

    if entity and positioned as, these two have their own function. One detect if entity exist while the latter merely just set the position. By combining them together doesn't mean if an entity at that position.






    Since i got a bit confuse what you are trying to achieve, and the last question you have is different than the first one you asked, so

    I need to find a command to detect when an entity is at the same position as another entity


    /execute at @e[tag=an_entity] if entity @e[tag=another_entity,distance=..0.1]




    ... summon bats when I was on the PB's position ...


    /execute as "you" at @s if entity @e[team=PB,distance=..0.5] run summon bat ~ ~ ~

    or

    /execute at @e[team=PB] if entity @a[name="you",distance=..0.5] run summon bat ~ ~ ~

    Posted in: Commands, Command Blocks and Functions
  • 1

    posted a message on 1.14.3 How to add potion effects to item?
    execute as @a[nbt={SelectedItem:{id:"minecraft:barrier",tag:{hello:1b}}}] run say world

    This command will let the executor say world when they are holding a barrier with that specific tag in main hand.

    And here is the command for getting that item.

    /give @s minecraft:barrier{hello:1b}


    For offhand, use Inventory with Slot -106(offhand slot).

    /execute as @a[nbt={Inventory:[{Slot:-106b,id:"minecraft:barrier",tag:{hello:1b}}]}] run say world
    Posted in: Commands, Command Blocks and Functions
  • 2

    posted a message on How do I detect if a player is still or moving??

    Player's motion, unlike other entities, is inaccurate most of the time unless they are jumping.


    Therefore, it is highly recommended to use other method to detect if the player is moving.

    You can store player's Pos[0], Pos[1], and Pos[2] into scoreboard in current tick, and compare it with what you store from the previous tick to see if the position had changed. (so 6 dummy scoreboard are need, 3 for storing current tick, 3 for storing previous tick).


    Or you can use other criteria(some of them are probably duplicate, so choose only what movement you want to detect):

    climb_one_cm

    crouch_one_cm

    fall_one_cm

    fly_one_cm

    horse_one_cm

    minecart_one_cm

    jump

    pig_one_cm

    sprint_one_cm

    swim_one_cm

    walk_on_water_one_cm

    walk_one_cm

    walk_under_water_one_cm

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on [Solved] Modify data from scoreboard
    execute store result entity @s <path> int 1 run scoreboard get <target> <scoreboard_obj>


    Damage is an int type value.

    What this command do is get the score from a <target>, then scale it to 1 and save into the path of @s where you specified.

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on [SOLVED] Get Damage value of tool with command

    https://minecraft.gamepedia.com/Item_(entity)/ED


    Since this is an drop item, damage value is store inside Item.

    Item > tag > Damage


    So the path would be Item.tag.Damage instead of Damage.



    A simple way to check that is to see what output do you get when trying out these command in chat.

    /execute as @e[type=minecraft:item,nbt={Item:{id:"minecraft:trident"}}] run data get entity @s
    
    /execute as @e[type=minecraft:item,nbt={Item:{id:"minecraft:trident"}}] run data get entity @s Damage
    
    /execute as @e[type=minecraft:item,nbt={Item:{id:"minecraft:trident"}}] run data get entity @s Item
    
    /execute as @e[type=minecraft:item,nbt={Item:{id:"minecraft:trident"}}] run data get entity @s Item.tag
    
    /execute as @e[type=minecraft:item,nbt={Item:{id:"minecraft:trident"}}] run data get entity @s Item.tag.Damage



    Also, although there is nothing wrong with it, run execute is redundant. Since as at positioned rotated anchored ... , these are sub commands of execute, they can be combine together without having to repeatedly running execute.


    execute as @e run execute store ...

    execute as @e store ...

    execute as @e run execute at @s run execute positioned ~ ~1.0 ~ run execute if entity @s ...

    execute as @e at @s positioned ~ ~1.0 ~ if entity @s ...

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Left click detection

    Haven't tried it myself, but painting detection might be possible. By detecting whether the painting remain on the walls allow you to detect for player's left click. Detecting block(grass, tall grass) existing or item frame state changes might works as well.


    But you will have to regenerate(re-summon,re-setblock) them using a tick function once that entity have different nbts or block not being found. Re-texturing is also require.



    Just a guessing, based on the solution you currently have, you might be able to just tp the one that's being hit away and respawn a new one immediately to guarantee that the entity is ready to be hit again asap.

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Problem displaying a title and subtitle in an area

    Long story short...You should take a look at how it work on wiki page.


    distance

    =50 means exactly 50 block away

    =..50 means within 50 blocks

    Posted in: Commands, Command Blocks and Functions
  • 1

    posted a message on [Solved] /Execute on specific named item with enchants/colors

    execute as @a[nbt={SelectedItem:{id:"minecraft:iron_axe",tag:{display:{Name:'{"bold":true,"italic":true,"color":"dark_purple","text":"Test"}'}}}}] run say hi


    This is the one for your item/img above.


    give @s minecraft:iron_axe{display:{Name:'{"bold":true,"italic":true,"color":"dark_purple","text":"Test"}'}} 1


    And if I am not wrong, this is how you can get that item with this specific display name.


    Oh, and for enchants.

    Enchantments:[{lvl:1s,id:"minecraft:mending"}]

    This test for item with this enchant.

    execute as @a[nbt={SelectedItem:{id:"minecraft:iron_axe",tag:{Enchantments:[{lvl:1s,id:"minecraft:mending"}]}}}]


    And this test for both enchant and name.

    execute as @a[nbt={SelectedItem:{id:"minecraft:iron_axe",tag:{Enchantments:[{lvl:1s,id:"minecraft:mending"}],display:{Name:'{"bold":true,"italic":true,"color":"dark_purple","text":"Test"}'}}}}]


    You can detect only Name, only Lore, or both Name and Lore, the point is the value for Name/Lore or such string type nbts must be match exactly since those value are just a bunch of strings.


    A quick way to determine whether you should include the entire strings is to know if those nbts are string type, or if the value comes along has " " or ' ' or \" \" on both side, or if the text is green like the one on your screenshot.

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on [Solved] /Execute on specific named item with enchants/colors

    Make sure that part inside the Name matches exactly the same as the item you have, as well as the order.

    You can use data get entity ... to check that item.

    Posted in: Commands, Command Blocks and Functions
  • 1

    posted a message on Trouble With /execute

    If this is for singleplayer world, it should be fine. If not, the first @p and the last @p doesn't mean the same player, which might cause issue. Therefore, use @s to make the target consistent.


    /execute as @a[x=-421,y=5,z=124,dx=0,dy=0,dz=0] at @s run teleport @s ~ ~6 ~



    That sounds like a specific area rather than a specific block. These two are not the same.

    In case you are wondering the other one.


    /execute as @a at @s if block ~ ~-0.1 ~ minecraft:diamond_block run teleport @s ~ ~6 ~
    Posted in: Commands, Command Blocks and Functions
  • 1

    posted a message on Written Book Author Detector

    Clearing books that's not written by X is possible, but it's not that simple.


    Since I haven't tried it myself, I rather leave it for others to answer.



    By counting how many X's written book a player has, you will need somewhere to store the result, AKA a scoreboard, to store the count result of the book.



    A dummy scoreboard will do.

    /scoreboard objectives add countx dummy

    So you will have to use execute store result score <...> run clear <...> 0 to store the result of the count.

    Clear 0 wouldn't remove those books from player's inventory, and books written by X will have author nbt in the item.

    By adding author:"X" in the clear <data>, together you will be able to detect and store the amount of X's written book into a scoreboard.


    /execute as @a store result score @s countx run clear @s minecraft:written_book{author:"X"} 0
    Posted in: Commands, Command Blocks and Functions
  • 1

    posted a message on How does the new /data modify argument work?

    Inventory[{Slot:103b}]

    And you have to be at least in version 1.14, otherwise it wouldn't work.

    Posted in: Commands, Command Blocks and Functions
  • To post a comment, please or register a new account.