Yes, using tags. Simply attach a chain command block to the repeating command block and set it to always active. Paste this in: /tag @p add textDisplayed
and now modify your text display command so it only shows the text to a player without the "textDisplayed" tag (@a[tag=!textDisplayed]). To show the text again, remove the tag from the player with tag @p remove textDisplayed
The problem is that the bow is being replaced every tick.
Instead of constantly replacing their first hotbar slot, simply give them a bow if they are missing one.
Instead of the nearest player, we're going to run this as all players for multiplayer support.
/execute as @a...
First, we need to check if the player has the bow in their inventory:
...unless entity @p[nbt={Inventory:[{id:"minecraft:bow", tag:{INSERT NBT}}]}]...
Then give them the bow.
...run give @p minecraft:bow{INSERT NBT} 1
Combine the three lines like this:
/execute as @a unless entity @s[nbt={Inventory:[{id:"minecraft:bow", tag:{INSERT NBT}}]}] run give @s minecraft:bow{INSERT NBT}]} 1
This will give every player a Bow of Shadows, if they do not already have a matching bow in their inventory. (replace "INSERT NBT" with the bow's display and enchantment data.)
Hope it helps!
Best Answer
Your command,
/tp @s ^ ^ ^0.5
is being run in a command block.@s
always refers to the executor, that is, the "thing" running the command.Since your command is running in a command block, the "thing" running the command is the server. So,
@s
would not refer to you.You can use
/execute
to change who the command is being executed as, like so:execute as @p run tp @s ^ ^ ^0.5
This makes the nearest player run the command. If you try this, you will find that it works- sort of.
What does
tp @s ^ ^ ^0.5
do, exactly? It teleports the target 0.5 blocks forward. However, the command is being executed at the command block, so you will be teleported 0.5 blocks in front of it. To combat this, we need to change where the command is being executed, like so:execute as @p at @s run tp @s ^ ^ ^0.5
Now you can "fly" in Minecraft.