0

I'm trying to make a PVP area on my realm away from the main area using command blocks to teleport to the designated area. However I would also like it to clear the players inventory so they don't get a head start. I've tried using Command Combiners, but none of them seem to work, they just spawn some gravel and a minecart + cmd block. The specific commands I'm trying to combine are:
/tp @p 98338 156 84729 and /clear @p.

The cmd combiners gave me this command, but it did not work:

summon falling_block ~ ~1 ~ {BlockState:{Name:stone},Time:1,Passengers:[{id:falling_block,BlockState:{Name:redstone_block},Time:1,Passengers:[{id:falling_block,BlockState:{Name:activator_rail},Time:1,Passengers:[{id:command_block_minecart,Command:"gamerule commandBlockOutput false"},{id:command_block_minecart,Command:"fill ~2 ~-3 ~-1 ~5 ~-1 ~1 light_gray_terracotta hollow"},{id:command_block_minecart,Command:"fill ~2 ~-2 ~-1 ~5 ~-2 ~1 white_stained_glass replace light_gray_terracotta"},{id:command_block_minecart,Command:"fill ~3 ~-2 ~ ~4 ~-2 ~ chain_command_block[facing=east]"},{id:command_block_minecart,Command:"setblock ~3 ~-2 ~ repeating_command_block[facing=east]"},{id:command_block_minecart,Command:"data merge block ~4 ~-2 ~ {auto:1,Command:\"/clear\"}"},{id:command_block_minecart,Command:"data merge block ~3 ~-2 ~ {auto:1,Command:\"/tp 98338 156 84729\"}"},{id:command_block_minecart,Command:"setblock ~ ~ ~1 command_block{Command:\"fill ~ ~-3 ~-1 ~ ~ ~ air\"}"},{id:command_block_minecart,Command:"setblock ~ ~-1 ~1 redstone_block"},{id:command_block_minecart,Command:"kill @e[type=command_block_minecart,distance=..1]"}]}]}]}

Is there anything wrong with this and how would I fix it? I'm on Java Edition if that matters.

Here is an expanded version of that command:

summon falling_block ~ ~1 ~ 
{
  BlockState:
  {
    Name:stone
  },
  Time:1,
  Passengers:
  [
    {
      id:falling_block,
      BlockState:
      {
        Name:redstone_block
      },
      Time:1,
      Passengers:
      [
        {
          id:falling_block,
          BlockState:
          {
            Name:activator_rail
          },
          Time:1,
          Passengers:
          [
            {
              id:command_block_minecart,
              Command:"gamerule commandBlockOutput false"
            },
            {
              id:command_block_minecart,
              Command:"fill ~2 ~-3 ~-1 ~5 ~-1 ~1 light_gray_terracotta hollow"
            },
            {
              id:command_block_minecart,
              Command:"fill ~2 ~-2 ~-1 ~5 ~-2 ~1 white_stained_glass replace light_gray_terracotta"
            },
            {
              id:command_block_minecart,
              Command:"fill ~3 ~-2 ~ ~4 ~-2 ~ chain_command_block[facing=east]"
            },
            {
              id:command_block_minecart,
              Command:"setblock ~3 ~-2 ~ repeating_command_block[facing=east]"
            },
            {
              id:command_block_minecart,
              Command:"data merge block ~4 ~-2 ~ {auto:1,Command:\"/clear\"}"
            },
            {
              id:command_block_minecart,
              Command:"data merge block ~3 ~-2 ~ {auto:1,Command:\"/tp 98338 156 84729\"}"
            },
            {
              id:command_block_minecart,
              Command:"setblock ~ ~ ~1 command_block{Command:\"fill ~ ~-3 ~-1 ~ ~ ~ air\"}"
            },
            {
              id:command_block_minecart,
              Command:"setblock ~ ~-1 ~1 redstone_block"
            },
            {
              id:command_block_minecart,
              Command:"kill @e[type=command_block_minecart,distance=..1]"
            }
          ]
        }
      ]
    }
  ]
}
  • 1
    Would a solution involving two command blocks be ok, too? Why do you need a complicated setup like this? And what version of the Java edition do you use? – user232393 Sep 15 at 11:58
1

https://mrgarretto.com/cmdcombiner This website combines commands together. Similar to only 1 command. I don’t know if this will help but it’s all I can offer.

1

You entered a slash (/) at the beginning of some commands. That does not work in command blocks, so it probably also doesn't work in command block minecarts.

Also, have you checked whether simpler cases work with this generator? Maybe the generator is just not working. I personally use this format for one-command creations: https://bugs.mojang.com/browse/MC-145113?focusedCommentId=542757&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-542757

  • I can confirm that the slash is not the problem. I've tested it many times. The only time that I know a slash does not work in commands is at the end of a chained /execute command. – Zach K Sep 16 at 16:41
  • 1
    Then the second paragraph: Have you checked whether this generator even works? Maybe it's broken. – Fabian Röling Sep 16 at 19:41
  • Yes, I missed the fact that I listed the same bug you did. The generator is definitely broken due to this bug. – Zach K Sep 17 at 2:46
0

The generator that you are using is broken due to a known bug (listed by Fabian) that prevents you from having falling blocks with other falling blocks as passengers. The easiest solution to this is to insert an "area_effect_cloud" or some other invisible and useless entity between each falling block. This changes your command to:

summon falling_block ~ ~1 ~ {BlockState:{Name:stone},Time:1,Passengers:[{id:area_effect_cloud,Passengers:[{id:falling_block,BlockState:{Name:redstone_block},Time:1,Passengers:[{id:area_effect_cloud,Passengers:[{id:falling_block,BlockState:{Name:activator_rail},Time:1,Passengers:[{id:command_block_minecart,Command:"gamerule commandBlockOutput false"},{id:command_block_minecart,Command:"fill ~2 ~-3 ~-1 ~5 ~-1 ~1 light_gray_terracotta hollow"},{id:command_block_minecart,Command:"fill ~2 ~-2 ~-1 ~5 ~-2 ~1 white_stained_glass replace light_gray_terracotta"},{id:command_block_minecart,Command:"fill ~3 ~-2 ~ ~4 ~-2 ~ chain_command_block[facing=east]"},{id:command_block_minecart,Command:"setblock ~3 ~-2 ~ repeating_command_block[facing=east]"},{id:command_block_minecart,Command:"data merge block ~4 ~-2 ~ {auto:1,Command:\"/clear @p\"}"},{id:command_block_minecart,Command:"data merge block ~3 ~-2 ~ {auto:1,Command:\"/tp @p 98338 156 84729\"}"},{id:command_block_minecart,Command:"setblock ~ ~ ~1 command_block{Command:\"fill ~ ~-3 ~-1 ~ ~ ~ air\"}"},{id:command_block_minecart,Command:"setblock ~ ~-1 ~1 redstone_block"},{id:command_block_minecart,Command:"kill @e[type=command_block_minecart,distance=..1]"}]}]}]}]}]}

Regardless, I believe this command doesn't do what you want it to do. It creates a "one command" like structure inside of a box with your commands that run every tick; you really shouldn't run this on your server. I recommend that you just use two command blocks for this purpose instead of one. Look up what a "chain command block" is and how to use it for this purpose. If you really need your commands to be in one command block, use a function instead of a command combiner.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.