6

Is there any way to wear particular armor within one command to be used in the chat (i.e. without command block)?

The several commands look like below -

replaceitem entity @s slot.armor.head 0 iron_helmet
replaceitem entity @s slot.armor.chest 0 iron_chestplate
replaceitem entity @s slot.armor.legs 0 iron_leggings

I am reading the Wiki about /execute and run commands - https://minecraft.wiki/w/Commands/execute. It sounds like it is possible. But I don't understand how to apply it. And I am not sure if run will work with Bedrock Edition.

2
  • 1
    Which edition are you actually playing? You've linked to Java Edition-specific documentation on the Minecraft Wiki, but tagged the question as minecraft-bedrock-edition
    – pppery
    Jun 10, 2020 at 19:30
  • @pppery, Bedrock Edition. The page I linked is about Java- as well as Bedrock Edition. I see now that run command is specific to Java. Does it mean there is no way to do what I need with one command?
    – LA_
    Jun 11, 2020 at 7:58

2 Answers 2

3

/execute is not what you are looking for. Even in Java Edition, you can only run one command with it.

You can consider creating a command chain. Please consider visiting this post for info on how you can create a command chain. With a command chain, all the commands that are part of it will execute at the same time, but in order. I hope that this will suffice for running multiple commands at once.

If a command chain is not satisfactory, there's not much else you can do.

2
  • Thank you. Looks like the command chain is possible only with the command block, but I should execute several commands on console :(
    – LA_
    Jun 11, 2020 at 18:38
  • I know that. I work with Minecraft thru Code Connection (not directly). So I can initiate command only. If I place command block first, then another command would be required to setup it.
    – LA_
    Jun 12, 2020 at 9:02
-1

In your case, probably, you could look at /function

In common you have to:

  • Create simple text file and write your set of commands there.
  • Name the file my_function.mcfunction Replace my_function with desired name you will type in chat
  • Create a data pack ((i.e. HOME_DIR/.minecraft/saves/MyWorld/datapacks/my_helpers)
  • Place the file in appropriate directory (i.e. DATA_PACK_DIR/functions/my_function.mcfunction)
  • Reload the game (you can use /reload command for this)

Now you can run your commands in chat like this /function my_helpers:my_function.

Note, that this method works for local singleplayer game. It is possible to define functions for server as well (I think, you'll find how if this is your case).

2
  • 1
    This looks like a Java Edition answer to a Bedrock Edition question. /function overall is a decent idea, but the details would have to be entirely different.
    – pppery
    Feb 1, 2023 at 23:19
  • I agree. You should probably include both the setup for a datapack (Java) and an add-on (Bedrock) if you want to go that way. The question is for Bedrock, but with the ambiguous title and question description it might as well be found by Java players as well.
    – Plagiatus
    Feb 2, 2023 at 8:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .