How can I create a copy of an entity using command blocks?Can I /clone relative to entities, not the command block?What enchantments can books have?How to add an enchantment onto held item in Minecraft with command blocksIs there a way to define a custom sprite for a specific item or block using command blocks?How to award player on every kill in Minecraft using command blocks?Minecraft Command Block ProblemHow do I use a command block to add coordinates to another command block?How do I make command blocks teleport players away from an area when they don't have a specific item?Setting a damage value on to a slotHow to copy item NBT into an item entity?

I think my coworker went through my notebook and took my project ideas

Is "stainless" a bulk or a surface property of stainless steel?

Is there a commercial liquid with refractive index greater than n=2?

Infinite loop in CURSOR

To "hit home" in German

Why don't politicians push for fossil fuel reduction by pointing out their scarcity?

Is there a known non-euclidean geometry where two concentric circles of different radii can intersect? (as in the novel "The Universe Between")

Does git delete empty folders?

How to dismiss intrusive questions from a colleague with whom I don't work?

How did Apollo 15's depressurization work?

How could China have extradited people for political reason under the extradition law it wanted to pass in Hong Kong?

Why don't sharp and flat root note chords seem to be present in much guitar music?

How can I pack my food so it doesn't smell?

Count the frequency of integers in an array

How to think about joining a company whose business I do not understand?

Do living authors still get paid royalties for their old work?

Changing a TGV booking

Was Switzerland really impossible to invade during WW2?

Would it be illegal for Facebook to actively promote a political agenda?

!I!n!s!e!r!t! !n!b!e!t!w!e!e!n!

Are there categories whose internal hom is somewhat 'exotic'?

How to compare two different formulations of a problem?

My two team members in a remote location don't get along with each other; how can I improve working relations?

Do predators tend to have vertical slit pupils versus horizontal for prey animals?



How can I create a copy of an entity using command blocks?


Can I /clone relative to entities, not the command block?What enchantments can books have?How to add an enchantment onto held item in Minecraft with command blocksIs there a way to define a custom sprite for a specific item or block using command blocks?How to award player on every kill in Minecraft using command blocks?Minecraft Command Block ProblemHow do I use a command block to add coordinates to another command block?How do I make command blocks teleport players away from an area when they don't have a specific item?Setting a damage value on to a slotHow to copy item NBT into an item entity?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








4















More specifically, say there's a pile of items on the ground, for instance after someone dies, and I want to create an exact copy of each of those items (NBT tags and all), but in a different (specific) location. How would I go about doing that?



Taking the naive approach, the math gets pretty horrifying pretty quickly. For instance, adding a command block for every combination of every enchantment on every item that can hold those enchantments quickly becomes unmanageable. For instance, there are 6 enchantments that can be applied to every type of armour, there are 5 armour grades, 4 armor pieces at each grade, and at least 3 enchantment levels (with default enchanting) for these enchantments. That alone would take 720 command blocks (considering I need 2 command blocks to do the clone), to say nothing of the various combinations of enchantments that can be had within those 6, plus other enchantments available to individual armour pieces, and durability (oh god, the durability) of the items. Obviously, writing thousands (millions?) of command blocks with testfor @e[type=Item] NBT:"some long and nested NBT tag and summon Item x y z NBT:"the same long and nested NBT tag isn't feasible (and won't even produce the correct result). No, I need another way.



I've been through the commands page on the Minecraft wiki, and nothing jumped out at me. The closest command I could see is the clone command, but that only works on blocks and tile entities (i.e. chests, furnaces, and the like). Also, I know I can edit the NBT data directly, but the point is to be able to do this while the game is running.










share|improve this question



















  • 1





    This is one of the few things that are impossible in Minecraft, sorry.

    – QbsidianH20
    Mar 5 '15 at 0:46











  • Many people have said the same thing before about other things, and they were wrong. While it wouldn't surprise me that it can't be done, I'm not going to declare that it's impossible.

    – MBraedley
    Mar 5 '15 at 2:08











  • Well it could be kinda done actually for items but for all entities generally, I have no hope for finding method of doing this without using tons of command blocks unless Mojang adds some kind of entity cloning blocks. Also you can partially match nbt tag with scoreboard command and entitydata later accordingly.

    – QbsidianH20
    Mar 5 '15 at 6:07











  • Possible duplicate of Can I /clone relative to entities, not the command block?

    – Riftcaster
    Jul 24 '16 at 12:33











  • Definitely not a duplicate. On the surface, they look the same, but they're talking about two very different things.

    – Frank
    Jul 24 '16 at 12:55

















4















More specifically, say there's a pile of items on the ground, for instance after someone dies, and I want to create an exact copy of each of those items (NBT tags and all), but in a different (specific) location. How would I go about doing that?



Taking the naive approach, the math gets pretty horrifying pretty quickly. For instance, adding a command block for every combination of every enchantment on every item that can hold those enchantments quickly becomes unmanageable. For instance, there are 6 enchantments that can be applied to every type of armour, there are 5 armour grades, 4 armor pieces at each grade, and at least 3 enchantment levels (with default enchanting) for these enchantments. That alone would take 720 command blocks (considering I need 2 command blocks to do the clone), to say nothing of the various combinations of enchantments that can be had within those 6, plus other enchantments available to individual armour pieces, and durability (oh god, the durability) of the items. Obviously, writing thousands (millions?) of command blocks with testfor @e[type=Item] NBT:"some long and nested NBT tag and summon Item x y z NBT:"the same long and nested NBT tag isn't feasible (and won't even produce the correct result). No, I need another way.



I've been through the commands page on the Minecraft wiki, and nothing jumped out at me. The closest command I could see is the clone command, but that only works on blocks and tile entities (i.e. chests, furnaces, and the like). Also, I know I can edit the NBT data directly, but the point is to be able to do this while the game is running.










share|improve this question



















  • 1





    This is one of the few things that are impossible in Minecraft, sorry.

    – QbsidianH20
    Mar 5 '15 at 0:46











  • Many people have said the same thing before about other things, and they were wrong. While it wouldn't surprise me that it can't be done, I'm not going to declare that it's impossible.

    – MBraedley
    Mar 5 '15 at 2:08











  • Well it could be kinda done actually for items but for all entities generally, I have no hope for finding method of doing this without using tons of command blocks unless Mojang adds some kind of entity cloning blocks. Also you can partially match nbt tag with scoreboard command and entitydata later accordingly.

    – QbsidianH20
    Mar 5 '15 at 6:07











  • Possible duplicate of Can I /clone relative to entities, not the command block?

    – Riftcaster
    Jul 24 '16 at 12:33











  • Definitely not a duplicate. On the surface, they look the same, but they're talking about two very different things.

    – Frank
    Jul 24 '16 at 12:55













4












4








4


2






More specifically, say there's a pile of items on the ground, for instance after someone dies, and I want to create an exact copy of each of those items (NBT tags and all), but in a different (specific) location. How would I go about doing that?



Taking the naive approach, the math gets pretty horrifying pretty quickly. For instance, adding a command block for every combination of every enchantment on every item that can hold those enchantments quickly becomes unmanageable. For instance, there are 6 enchantments that can be applied to every type of armour, there are 5 armour grades, 4 armor pieces at each grade, and at least 3 enchantment levels (with default enchanting) for these enchantments. That alone would take 720 command blocks (considering I need 2 command blocks to do the clone), to say nothing of the various combinations of enchantments that can be had within those 6, plus other enchantments available to individual armour pieces, and durability (oh god, the durability) of the items. Obviously, writing thousands (millions?) of command blocks with testfor @e[type=Item] NBT:"some long and nested NBT tag and summon Item x y z NBT:"the same long and nested NBT tag isn't feasible (and won't even produce the correct result). No, I need another way.



I've been through the commands page on the Minecraft wiki, and nothing jumped out at me. The closest command I could see is the clone command, but that only works on blocks and tile entities (i.e. chests, furnaces, and the like). Also, I know I can edit the NBT data directly, but the point is to be able to do this while the game is running.










share|improve this question














More specifically, say there's a pile of items on the ground, for instance after someone dies, and I want to create an exact copy of each of those items (NBT tags and all), but in a different (specific) location. How would I go about doing that?



Taking the naive approach, the math gets pretty horrifying pretty quickly. For instance, adding a command block for every combination of every enchantment on every item that can hold those enchantments quickly becomes unmanageable. For instance, there are 6 enchantments that can be applied to every type of armour, there are 5 armour grades, 4 armor pieces at each grade, and at least 3 enchantment levels (with default enchanting) for these enchantments. That alone would take 720 command blocks (considering I need 2 command blocks to do the clone), to say nothing of the various combinations of enchantments that can be had within those 6, plus other enchantments available to individual armour pieces, and durability (oh god, the durability) of the items. Obviously, writing thousands (millions?) of command blocks with testfor @e[type=Item] NBT:"some long and nested NBT tag and summon Item x y z NBT:"the same long and nested NBT tag isn't feasible (and won't even produce the correct result). No, I need another way.



I've been through the commands page on the Minecraft wiki, and nothing jumped out at me. The closest command I could see is the clone command, but that only works on blocks and tile entities (i.e. chests, furnaces, and the like). Also, I know I can edit the NBT data directly, but the point is to be able to do this while the game is running.







minecraft minecraft-commands






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 4 '15 at 2:53









MBraedleyMBraedley

13.4k17 gold badges89 silver badges141 bronze badges




13.4k17 gold badges89 silver badges141 bronze badges










  • 1





    This is one of the few things that are impossible in Minecraft, sorry.

    – QbsidianH20
    Mar 5 '15 at 0:46











  • Many people have said the same thing before about other things, and they were wrong. While it wouldn't surprise me that it can't be done, I'm not going to declare that it's impossible.

    – MBraedley
    Mar 5 '15 at 2:08











  • Well it could be kinda done actually for items but for all entities generally, I have no hope for finding method of doing this without using tons of command blocks unless Mojang adds some kind of entity cloning blocks. Also you can partially match nbt tag with scoreboard command and entitydata later accordingly.

    – QbsidianH20
    Mar 5 '15 at 6:07











  • Possible duplicate of Can I /clone relative to entities, not the command block?

    – Riftcaster
    Jul 24 '16 at 12:33











  • Definitely not a duplicate. On the surface, they look the same, but they're talking about two very different things.

    – Frank
    Jul 24 '16 at 12:55












  • 1





    This is one of the few things that are impossible in Minecraft, sorry.

    – QbsidianH20
    Mar 5 '15 at 0:46











  • Many people have said the same thing before about other things, and they were wrong. While it wouldn't surprise me that it can't be done, I'm not going to declare that it's impossible.

    – MBraedley
    Mar 5 '15 at 2:08











  • Well it could be kinda done actually for items but for all entities generally, I have no hope for finding method of doing this without using tons of command blocks unless Mojang adds some kind of entity cloning blocks. Also you can partially match nbt tag with scoreboard command and entitydata later accordingly.

    – QbsidianH20
    Mar 5 '15 at 6:07











  • Possible duplicate of Can I /clone relative to entities, not the command block?

    – Riftcaster
    Jul 24 '16 at 12:33











  • Definitely not a duplicate. On the surface, they look the same, but they're talking about two very different things.

    – Frank
    Jul 24 '16 at 12:55







1




1





This is one of the few things that are impossible in Minecraft, sorry.

– QbsidianH20
Mar 5 '15 at 0:46





This is one of the few things that are impossible in Minecraft, sorry.

– QbsidianH20
Mar 5 '15 at 0:46













Many people have said the same thing before about other things, and they were wrong. While it wouldn't surprise me that it can't be done, I'm not going to declare that it's impossible.

– MBraedley
Mar 5 '15 at 2:08





Many people have said the same thing before about other things, and they were wrong. While it wouldn't surprise me that it can't be done, I'm not going to declare that it's impossible.

– MBraedley
Mar 5 '15 at 2:08













Well it could be kinda done actually for items but for all entities generally, I have no hope for finding method of doing this without using tons of command blocks unless Mojang adds some kind of entity cloning blocks. Also you can partially match nbt tag with scoreboard command and entitydata later accordingly.

– QbsidianH20
Mar 5 '15 at 6:07





Well it could be kinda done actually for items but for all entities generally, I have no hope for finding method of doing this without using tons of command blocks unless Mojang adds some kind of entity cloning blocks. Also you can partially match nbt tag with scoreboard command and entitydata later accordingly.

– QbsidianH20
Mar 5 '15 at 6:07













Possible duplicate of Can I /clone relative to entities, not the command block?

– Riftcaster
Jul 24 '16 at 12:33





Possible duplicate of Can I /clone relative to entities, not the command block?

– Riftcaster
Jul 24 '16 at 12:33













Definitely not a duplicate. On the surface, they look the same, but they're talking about two very different things.

– Frank
Jul 24 '16 at 12:55





Definitely not a duplicate. On the surface, they look the same, but they're talking about two very different things.

– Frank
Jul 24 '16 at 12:55










4 Answers
4






active

oldest

votes


















7














My thought is to use a structure block, to clone the entity.



So this is what I'd do it:



  • First, spawn an armor stand (as a marker) in the location of the entity to be cloned.

  • Move the entity to a predefined location.

  • Clone it with the structure blocks.

  • Then move the entity back to the marker, and the new one where you want it.

  • Finally remove the marker.

I'll just show how to set up the structure blocks. I'll assume you know what your doing with the teleportation of the entities.



So the cloning device should look like this:







(The command block in the second picture removes the stone block when a red stone block is placed there.)



So the structure block on the left is the saving block, you place the entities to be cloned on top of it.





You must have "Include Entities" set to on, or it won't clone entities.



The block on the right loads the entities. (If you use red stone to save, it will only save to RAM, not your disk, which is good.)





(The structure name doesn't have to be "cloner", but it just has to be the same in both blocks.)



When you have the cloning device set up, you just have to teleport an entity on top of the structure block on the left, place a red stone block in place of the stone one, then one red stone tick later, you'll have two identical entities.




Necro edit: I though I'd clarify why there has to be a red stone tick between them, its because structure blocks are "slow" (compared to command blocks) and require time to save the structure data. A single red stone tick is simply easy to do, but it can be any amount of time, as long as it gives the structure blocks time to do their thing.







share|improve this answer



























  • Hey Venya! :) This is an older question, so the user may-not be around to ask for a follow up. In a case like this, it would be better to give a full detail answer since it's just as likely that someone else is going to find this question and then your answer! (ie. imagine your post is talking to the whole audience instead of just the OP!)

    – NBN-Alex
    Oct 11 '16 at 23:40











  • good point, I'll update it then

    – Venya
    Oct 12 '16 at 11:28











  • Much better! Really great answer as well!

    – NBN-Alex
    Oct 12 '16 at 18:19






  • 1





    So, I guess I need to play around with structure blocks.

    – MBraedley
    Oct 12 '16 at 23:08











  • they can be very powerful, if used right.

    – Venya
    Oct 12 '16 at 23:38


















3














One option would be to use armor stands or wither skulls to be placeholders and teleport the items back and forth.



Or you could place hoppers and chests with /setblock, copy the chest with clone and then take the items out with hoppers and droppers. I can't remember if you can break a chest so it drops items with /setblock. If you need to, use /entitydata to add/remove tags to stop items from despawning.



Hope that helps.






share|improve this answer



























  • I didn't really make it explicit, but the idea was to avoid hoppers. They take time to fill chests, and I want to be able to do this in a few game ticks instead of a few seconds.

    – MBraedley
    Mar 4 '15 at 22:18











  • @MBraedley You can set the TransferCooldown tag of hopper to 0 to make item transportation 8 times faster than default but using stacked hopper minecart is faster I think.

    – QbsidianH20
    Mar 5 '15 at 6:01


















3














The only way to do this reliably currently is to teleport all the items to a hopper and put them into a chest. This can be speed up using the /blockdata command to negate the cooldown of the hopper, but will still take some time for a large number of items (320 ticks or 16 seconds for a full hopper). The chest can then be cloned to the required location, and using /setblock x y z air 0 destroy with the doTileDrops gamerule set to false, the contents but not the chest will be dropped.






share|improve this answer
































    2














    I'm surprised no one suggested this, but if /teleporting rather than cloning is an option, you can target the items directly:



    /scoreboard objectives add itemCount dummy (only execute once)




    1. /scoreboard players tag @r[type=Item] add item0 OnGround:1b (in
      a repeating or clocked command block with next commands chained)

    2. /scoreboard players set @e[tag=item0] itemCount 0


    3. /execute @e[tag=item0] ~ ~ ~ execute @e[r=3,type=Item,tag=!item0] ~
      ~ ~ scoreboard players add @e[tag=item0,r=3] itemCount 1

    4. /execute @e[tag=item0,score_itemCount_min=5] teleport
      @e[type=Item,r=3] <x> <y> <z>

    Here's what this is doing:



    1. pick a random item on the ground to check.

    2. set its score in the 'itemCount' objective to zero.

    3. have any items on the ground within 3 blocks of it add 1 to its score.

    4. if its score is over 4, teleport it and any other item within 3 blocks to the location x,y,z.

    This will teleport any group of 5 or more distinct item stacks to that location. If you want to make sure not to teleport items that, say, popped out of a broken chest, you can also use the same method to check for a certain number of XPOrbs in addition to Items. I can't think of anything other than a player that might drop more than 3 or 4 xporbs and more than 5 items.






    share|improve this answer

























    • I don't think you understand the problem. You're not making a copy of the items, just moving them.

      – MBraedley
      Nov 15 '16 at 2:58











    • Yeah, that's why I mentioned teleporting vs cloning at the beginning. Unfortunately there just doesn't seem to be an entity cloning command at the moment, sorry. I can't think of anything else that doesn't involve hoppers.

      – TenNineAce
      Nov 15 '16 at 3:40













    Your Answer








    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "41"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    noCode: true, onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgaming.stackexchange.com%2fquestions%2f208561%2fhow-can-i-create-a-copy-of-an-entity-using-command-blocks%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    4 Answers
    4






    active

    oldest

    votes








    4 Answers
    4






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    7














    My thought is to use a structure block, to clone the entity.



    So this is what I'd do it:



    • First, spawn an armor stand (as a marker) in the location of the entity to be cloned.

    • Move the entity to a predefined location.

    • Clone it with the structure blocks.

    • Then move the entity back to the marker, and the new one where you want it.

    • Finally remove the marker.

    I'll just show how to set up the structure blocks. I'll assume you know what your doing with the teleportation of the entities.



    So the cloning device should look like this:







    (The command block in the second picture removes the stone block when a red stone block is placed there.)



    So the structure block on the left is the saving block, you place the entities to be cloned on top of it.





    You must have "Include Entities" set to on, or it won't clone entities.



    The block on the right loads the entities. (If you use red stone to save, it will only save to RAM, not your disk, which is good.)





    (The structure name doesn't have to be "cloner", but it just has to be the same in both blocks.)



    When you have the cloning device set up, you just have to teleport an entity on top of the structure block on the left, place a red stone block in place of the stone one, then one red stone tick later, you'll have two identical entities.




    Necro edit: I though I'd clarify why there has to be a red stone tick between them, its because structure blocks are "slow" (compared to command blocks) and require time to save the structure data. A single red stone tick is simply easy to do, but it can be any amount of time, as long as it gives the structure blocks time to do their thing.







    share|improve this answer



























    • Hey Venya! :) This is an older question, so the user may-not be around to ask for a follow up. In a case like this, it would be better to give a full detail answer since it's just as likely that someone else is going to find this question and then your answer! (ie. imagine your post is talking to the whole audience instead of just the OP!)

      – NBN-Alex
      Oct 11 '16 at 23:40











    • good point, I'll update it then

      – Venya
      Oct 12 '16 at 11:28











    • Much better! Really great answer as well!

      – NBN-Alex
      Oct 12 '16 at 18:19






    • 1





      So, I guess I need to play around with structure blocks.

      – MBraedley
      Oct 12 '16 at 23:08











    • they can be very powerful, if used right.

      – Venya
      Oct 12 '16 at 23:38















    7














    My thought is to use a structure block, to clone the entity.



    So this is what I'd do it:



    • First, spawn an armor stand (as a marker) in the location of the entity to be cloned.

    • Move the entity to a predefined location.

    • Clone it with the structure blocks.

    • Then move the entity back to the marker, and the new one where you want it.

    • Finally remove the marker.

    I'll just show how to set up the structure blocks. I'll assume you know what your doing with the teleportation of the entities.



    So the cloning device should look like this:







    (The command block in the second picture removes the stone block when a red stone block is placed there.)



    So the structure block on the left is the saving block, you place the entities to be cloned on top of it.





    You must have "Include Entities" set to on, or it won't clone entities.



    The block on the right loads the entities. (If you use red stone to save, it will only save to RAM, not your disk, which is good.)





    (The structure name doesn't have to be "cloner", but it just has to be the same in both blocks.)



    When you have the cloning device set up, you just have to teleport an entity on top of the structure block on the left, place a red stone block in place of the stone one, then one red stone tick later, you'll have two identical entities.




    Necro edit: I though I'd clarify why there has to be a red stone tick between them, its because structure blocks are "slow" (compared to command blocks) and require time to save the structure data. A single red stone tick is simply easy to do, but it can be any amount of time, as long as it gives the structure blocks time to do their thing.







    share|improve this answer



























    • Hey Venya! :) This is an older question, so the user may-not be around to ask for a follow up. In a case like this, it would be better to give a full detail answer since it's just as likely that someone else is going to find this question and then your answer! (ie. imagine your post is talking to the whole audience instead of just the OP!)

      – NBN-Alex
      Oct 11 '16 at 23:40











    • good point, I'll update it then

      – Venya
      Oct 12 '16 at 11:28











    • Much better! Really great answer as well!

      – NBN-Alex
      Oct 12 '16 at 18:19






    • 1





      So, I guess I need to play around with structure blocks.

      – MBraedley
      Oct 12 '16 at 23:08











    • they can be very powerful, if used right.

      – Venya
      Oct 12 '16 at 23:38













    7












    7








    7







    My thought is to use a structure block, to clone the entity.



    So this is what I'd do it:



    • First, spawn an armor stand (as a marker) in the location of the entity to be cloned.

    • Move the entity to a predefined location.

    • Clone it with the structure blocks.

    • Then move the entity back to the marker, and the new one where you want it.

    • Finally remove the marker.

    I'll just show how to set up the structure blocks. I'll assume you know what your doing with the teleportation of the entities.



    So the cloning device should look like this:







    (The command block in the second picture removes the stone block when a red stone block is placed there.)



    So the structure block on the left is the saving block, you place the entities to be cloned on top of it.





    You must have "Include Entities" set to on, or it won't clone entities.



    The block on the right loads the entities. (If you use red stone to save, it will only save to RAM, not your disk, which is good.)





    (The structure name doesn't have to be "cloner", but it just has to be the same in both blocks.)



    When you have the cloning device set up, you just have to teleport an entity on top of the structure block on the left, place a red stone block in place of the stone one, then one red stone tick later, you'll have two identical entities.




    Necro edit: I though I'd clarify why there has to be a red stone tick between them, its because structure blocks are "slow" (compared to command blocks) and require time to save the structure data. A single red stone tick is simply easy to do, but it can be any amount of time, as long as it gives the structure blocks time to do their thing.







    share|improve this answer















    My thought is to use a structure block, to clone the entity.



    So this is what I'd do it:



    • First, spawn an armor stand (as a marker) in the location of the entity to be cloned.

    • Move the entity to a predefined location.

    • Clone it with the structure blocks.

    • Then move the entity back to the marker, and the new one where you want it.

    • Finally remove the marker.

    I'll just show how to set up the structure blocks. I'll assume you know what your doing with the teleportation of the entities.



    So the cloning device should look like this:







    (The command block in the second picture removes the stone block when a red stone block is placed there.)



    So the structure block on the left is the saving block, you place the entities to be cloned on top of it.





    You must have "Include Entities" set to on, or it won't clone entities.



    The block on the right loads the entities. (If you use red stone to save, it will only save to RAM, not your disk, which is good.)





    (The structure name doesn't have to be "cloner", but it just has to be the same in both blocks.)



    When you have the cloning device set up, you just have to teleport an entity on top of the structure block on the left, place a red stone block in place of the stone one, then one red stone tick later, you'll have two identical entities.




    Necro edit: I though I'd clarify why there has to be a red stone tick between them, its because structure blocks are "slow" (compared to command blocks) and require time to save the structure data. A single red stone tick is simply easy to do, but it can be any amount of time, as long as it gives the structure blocks time to do their thing.








    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited 36 mins ago









    galacticninja

    31.5k68 gold badges230 silver badges432 bronze badges




    31.5k68 gold badges230 silver badges432 bronze badges










    answered Oct 11 '16 at 20:40









    VenyaVenya

    4573 silver badges11 bronze badges




    4573 silver badges11 bronze badges















    • Hey Venya! :) This is an older question, so the user may-not be around to ask for a follow up. In a case like this, it would be better to give a full detail answer since it's just as likely that someone else is going to find this question and then your answer! (ie. imagine your post is talking to the whole audience instead of just the OP!)

      – NBN-Alex
      Oct 11 '16 at 23:40











    • good point, I'll update it then

      – Venya
      Oct 12 '16 at 11:28











    • Much better! Really great answer as well!

      – NBN-Alex
      Oct 12 '16 at 18:19






    • 1





      So, I guess I need to play around with structure blocks.

      – MBraedley
      Oct 12 '16 at 23:08











    • they can be very powerful, if used right.

      – Venya
      Oct 12 '16 at 23:38

















    • Hey Venya! :) This is an older question, so the user may-not be around to ask for a follow up. In a case like this, it would be better to give a full detail answer since it's just as likely that someone else is going to find this question and then your answer! (ie. imagine your post is talking to the whole audience instead of just the OP!)

      – NBN-Alex
      Oct 11 '16 at 23:40











    • good point, I'll update it then

      – Venya
      Oct 12 '16 at 11:28











    • Much better! Really great answer as well!

      – NBN-Alex
      Oct 12 '16 at 18:19






    • 1





      So, I guess I need to play around with structure blocks.

      – MBraedley
      Oct 12 '16 at 23:08











    • they can be very powerful, if used right.

      – Venya
      Oct 12 '16 at 23:38
















    Hey Venya! :) This is an older question, so the user may-not be around to ask for a follow up. In a case like this, it would be better to give a full detail answer since it's just as likely that someone else is going to find this question and then your answer! (ie. imagine your post is talking to the whole audience instead of just the OP!)

    – NBN-Alex
    Oct 11 '16 at 23:40





    Hey Venya! :) This is an older question, so the user may-not be around to ask for a follow up. In a case like this, it would be better to give a full detail answer since it's just as likely that someone else is going to find this question and then your answer! (ie. imagine your post is talking to the whole audience instead of just the OP!)

    – NBN-Alex
    Oct 11 '16 at 23:40













    good point, I'll update it then

    – Venya
    Oct 12 '16 at 11:28





    good point, I'll update it then

    – Venya
    Oct 12 '16 at 11:28













    Much better! Really great answer as well!

    – NBN-Alex
    Oct 12 '16 at 18:19





    Much better! Really great answer as well!

    – NBN-Alex
    Oct 12 '16 at 18:19




    1




    1





    So, I guess I need to play around with structure blocks.

    – MBraedley
    Oct 12 '16 at 23:08





    So, I guess I need to play around with structure blocks.

    – MBraedley
    Oct 12 '16 at 23:08













    they can be very powerful, if used right.

    – Venya
    Oct 12 '16 at 23:38





    they can be very powerful, if used right.

    – Venya
    Oct 12 '16 at 23:38













    3














    One option would be to use armor stands or wither skulls to be placeholders and teleport the items back and forth.



    Or you could place hoppers and chests with /setblock, copy the chest with clone and then take the items out with hoppers and droppers. I can't remember if you can break a chest so it drops items with /setblock. If you need to, use /entitydata to add/remove tags to stop items from despawning.



    Hope that helps.






    share|improve this answer



























    • I didn't really make it explicit, but the idea was to avoid hoppers. They take time to fill chests, and I want to be able to do this in a few game ticks instead of a few seconds.

      – MBraedley
      Mar 4 '15 at 22:18











    • @MBraedley You can set the TransferCooldown tag of hopper to 0 to make item transportation 8 times faster than default but using stacked hopper minecart is faster I think.

      – QbsidianH20
      Mar 5 '15 at 6:01















    3














    One option would be to use armor stands or wither skulls to be placeholders and teleport the items back and forth.



    Or you could place hoppers and chests with /setblock, copy the chest with clone and then take the items out with hoppers and droppers. I can't remember if you can break a chest so it drops items with /setblock. If you need to, use /entitydata to add/remove tags to stop items from despawning.



    Hope that helps.






    share|improve this answer



























    • I didn't really make it explicit, but the idea was to avoid hoppers. They take time to fill chests, and I want to be able to do this in a few game ticks instead of a few seconds.

      – MBraedley
      Mar 4 '15 at 22:18











    • @MBraedley You can set the TransferCooldown tag of hopper to 0 to make item transportation 8 times faster than default but using stacked hopper minecart is faster I think.

      – QbsidianH20
      Mar 5 '15 at 6:01













    3












    3








    3







    One option would be to use armor stands or wither skulls to be placeholders and teleport the items back and forth.



    Or you could place hoppers and chests with /setblock, copy the chest with clone and then take the items out with hoppers and droppers. I can't remember if you can break a chest so it drops items with /setblock. If you need to, use /entitydata to add/remove tags to stop items from despawning.



    Hope that helps.






    share|improve this answer















    One option would be to use armor stands or wither skulls to be placeholders and teleport the items back and forth.



    Or you could place hoppers and chests with /setblock, copy the chest with clone and then take the items out with hoppers and droppers. I can't remember if you can break a chest so it drops items with /setblock. If you need to, use /entitydata to add/remove tags to stop items from despawning.



    Hope that helps.







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Mar 4 '15 at 3:48









    Ben

    27k40 gold badges133 silver badges221 bronze badges




    27k40 gold badges133 silver badges221 bronze badges










    answered Mar 4 '15 at 3:41









    PjRockPjRock

    1262 bronze badges




    1262 bronze badges















    • I didn't really make it explicit, but the idea was to avoid hoppers. They take time to fill chests, and I want to be able to do this in a few game ticks instead of a few seconds.

      – MBraedley
      Mar 4 '15 at 22:18











    • @MBraedley You can set the TransferCooldown tag of hopper to 0 to make item transportation 8 times faster than default but using stacked hopper minecart is faster I think.

      – QbsidianH20
      Mar 5 '15 at 6:01

















    • I didn't really make it explicit, but the idea was to avoid hoppers. They take time to fill chests, and I want to be able to do this in a few game ticks instead of a few seconds.

      – MBraedley
      Mar 4 '15 at 22:18











    • @MBraedley You can set the TransferCooldown tag of hopper to 0 to make item transportation 8 times faster than default but using stacked hopper minecart is faster I think.

      – QbsidianH20
      Mar 5 '15 at 6:01
















    I didn't really make it explicit, but the idea was to avoid hoppers. They take time to fill chests, and I want to be able to do this in a few game ticks instead of a few seconds.

    – MBraedley
    Mar 4 '15 at 22:18





    I didn't really make it explicit, but the idea was to avoid hoppers. They take time to fill chests, and I want to be able to do this in a few game ticks instead of a few seconds.

    – MBraedley
    Mar 4 '15 at 22:18













    @MBraedley You can set the TransferCooldown tag of hopper to 0 to make item transportation 8 times faster than default but using stacked hopper minecart is faster I think.

    – QbsidianH20
    Mar 5 '15 at 6:01





    @MBraedley You can set the TransferCooldown tag of hopper to 0 to make item transportation 8 times faster than default but using stacked hopper minecart is faster I think.

    – QbsidianH20
    Mar 5 '15 at 6:01











    3














    The only way to do this reliably currently is to teleport all the items to a hopper and put them into a chest. This can be speed up using the /blockdata command to negate the cooldown of the hopper, but will still take some time for a large number of items (320 ticks or 16 seconds for a full hopper). The chest can then be cloned to the required location, and using /setblock x y z air 0 destroy with the doTileDrops gamerule set to false, the contents but not the chest will be dropped.






    share|improve this answer





























      3














      The only way to do this reliably currently is to teleport all the items to a hopper and put them into a chest. This can be speed up using the /blockdata command to negate the cooldown of the hopper, but will still take some time for a large number of items (320 ticks or 16 seconds for a full hopper). The chest can then be cloned to the required location, and using /setblock x y z air 0 destroy with the doTileDrops gamerule set to false, the contents but not the chest will be dropped.






      share|improve this answer



























        3












        3








        3







        The only way to do this reliably currently is to teleport all the items to a hopper and put them into a chest. This can be speed up using the /blockdata command to negate the cooldown of the hopper, but will still take some time for a large number of items (320 ticks or 16 seconds for a full hopper). The chest can then be cloned to the required location, and using /setblock x y z air 0 destroy with the doTileDrops gamerule set to false, the contents but not the chest will be dropped.






        share|improve this answer













        The only way to do this reliably currently is to teleport all the items to a hopper and put them into a chest. This can be speed up using the /blockdata command to negate the cooldown of the hopper, but will still take some time for a large number of items (320 ticks or 16 seconds for a full hopper). The chest can then be cloned to the required location, and using /setblock x y z air 0 destroy with the doTileDrops gamerule set to false, the contents but not the chest will be dropped.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Oct 5 '15 at 12:33









        James RiordanJames Riordan

        411 bronze badge




        411 bronze badge
























            2














            I'm surprised no one suggested this, but if /teleporting rather than cloning is an option, you can target the items directly:



            /scoreboard objectives add itemCount dummy (only execute once)




            1. /scoreboard players tag @r[type=Item] add item0 OnGround:1b (in
              a repeating or clocked command block with next commands chained)

            2. /scoreboard players set @e[tag=item0] itemCount 0


            3. /execute @e[tag=item0] ~ ~ ~ execute @e[r=3,type=Item,tag=!item0] ~
              ~ ~ scoreboard players add @e[tag=item0,r=3] itemCount 1

            4. /execute @e[tag=item0,score_itemCount_min=5] teleport
              @e[type=Item,r=3] <x> <y> <z>

            Here's what this is doing:



            1. pick a random item on the ground to check.

            2. set its score in the 'itemCount' objective to zero.

            3. have any items on the ground within 3 blocks of it add 1 to its score.

            4. if its score is over 4, teleport it and any other item within 3 blocks to the location x,y,z.

            This will teleport any group of 5 or more distinct item stacks to that location. If you want to make sure not to teleport items that, say, popped out of a broken chest, you can also use the same method to check for a certain number of XPOrbs in addition to Items. I can't think of anything other than a player that might drop more than 3 or 4 xporbs and more than 5 items.






            share|improve this answer

























            • I don't think you understand the problem. You're not making a copy of the items, just moving them.

              – MBraedley
              Nov 15 '16 at 2:58











            • Yeah, that's why I mentioned teleporting vs cloning at the beginning. Unfortunately there just doesn't seem to be an entity cloning command at the moment, sorry. I can't think of anything else that doesn't involve hoppers.

              – TenNineAce
              Nov 15 '16 at 3:40















            2














            I'm surprised no one suggested this, but if /teleporting rather than cloning is an option, you can target the items directly:



            /scoreboard objectives add itemCount dummy (only execute once)




            1. /scoreboard players tag @r[type=Item] add item0 OnGround:1b (in
              a repeating or clocked command block with next commands chained)

            2. /scoreboard players set @e[tag=item0] itemCount 0


            3. /execute @e[tag=item0] ~ ~ ~ execute @e[r=3,type=Item,tag=!item0] ~
              ~ ~ scoreboard players add @e[tag=item0,r=3] itemCount 1

            4. /execute @e[tag=item0,score_itemCount_min=5] teleport
              @e[type=Item,r=3] <x> <y> <z>

            Here's what this is doing:



            1. pick a random item on the ground to check.

            2. set its score in the 'itemCount' objective to zero.

            3. have any items on the ground within 3 blocks of it add 1 to its score.

            4. if its score is over 4, teleport it and any other item within 3 blocks to the location x,y,z.

            This will teleport any group of 5 or more distinct item stacks to that location. If you want to make sure not to teleport items that, say, popped out of a broken chest, you can also use the same method to check for a certain number of XPOrbs in addition to Items. I can't think of anything other than a player that might drop more than 3 or 4 xporbs and more than 5 items.






            share|improve this answer

























            • I don't think you understand the problem. You're not making a copy of the items, just moving them.

              – MBraedley
              Nov 15 '16 at 2:58











            • Yeah, that's why I mentioned teleporting vs cloning at the beginning. Unfortunately there just doesn't seem to be an entity cloning command at the moment, sorry. I can't think of anything else that doesn't involve hoppers.

              – TenNineAce
              Nov 15 '16 at 3:40













            2












            2








            2







            I'm surprised no one suggested this, but if /teleporting rather than cloning is an option, you can target the items directly:



            /scoreboard objectives add itemCount dummy (only execute once)




            1. /scoreboard players tag @r[type=Item] add item0 OnGround:1b (in
              a repeating or clocked command block with next commands chained)

            2. /scoreboard players set @e[tag=item0] itemCount 0


            3. /execute @e[tag=item0] ~ ~ ~ execute @e[r=3,type=Item,tag=!item0] ~
              ~ ~ scoreboard players add @e[tag=item0,r=3] itemCount 1

            4. /execute @e[tag=item0,score_itemCount_min=5] teleport
              @e[type=Item,r=3] <x> <y> <z>

            Here's what this is doing:



            1. pick a random item on the ground to check.

            2. set its score in the 'itemCount' objective to zero.

            3. have any items on the ground within 3 blocks of it add 1 to its score.

            4. if its score is over 4, teleport it and any other item within 3 blocks to the location x,y,z.

            This will teleport any group of 5 or more distinct item stacks to that location. If you want to make sure not to teleport items that, say, popped out of a broken chest, you can also use the same method to check for a certain number of XPOrbs in addition to Items. I can't think of anything other than a player that might drop more than 3 or 4 xporbs and more than 5 items.






            share|improve this answer













            I'm surprised no one suggested this, but if /teleporting rather than cloning is an option, you can target the items directly:



            /scoreboard objectives add itemCount dummy (only execute once)




            1. /scoreboard players tag @r[type=Item] add item0 OnGround:1b (in
              a repeating or clocked command block with next commands chained)

            2. /scoreboard players set @e[tag=item0] itemCount 0


            3. /execute @e[tag=item0] ~ ~ ~ execute @e[r=3,type=Item,tag=!item0] ~
              ~ ~ scoreboard players add @e[tag=item0,r=3] itemCount 1

            4. /execute @e[tag=item0,score_itemCount_min=5] teleport
              @e[type=Item,r=3] <x> <y> <z>

            Here's what this is doing:



            1. pick a random item on the ground to check.

            2. set its score in the 'itemCount' objective to zero.

            3. have any items on the ground within 3 blocks of it add 1 to its score.

            4. if its score is over 4, teleport it and any other item within 3 blocks to the location x,y,z.

            This will teleport any group of 5 or more distinct item stacks to that location. If you want to make sure not to teleport items that, say, popped out of a broken chest, you can also use the same method to check for a certain number of XPOrbs in addition to Items. I can't think of anything other than a player that might drop more than 3 or 4 xporbs and more than 5 items.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Nov 15 '16 at 2:49









            TenNineAceTenNineAce

            2281 silver badge10 bronze badges




            2281 silver badge10 bronze badges















            • I don't think you understand the problem. You're not making a copy of the items, just moving them.

              – MBraedley
              Nov 15 '16 at 2:58











            • Yeah, that's why I mentioned teleporting vs cloning at the beginning. Unfortunately there just doesn't seem to be an entity cloning command at the moment, sorry. I can't think of anything else that doesn't involve hoppers.

              – TenNineAce
              Nov 15 '16 at 3:40

















            • I don't think you understand the problem. You're not making a copy of the items, just moving them.

              – MBraedley
              Nov 15 '16 at 2:58











            • Yeah, that's why I mentioned teleporting vs cloning at the beginning. Unfortunately there just doesn't seem to be an entity cloning command at the moment, sorry. I can't think of anything else that doesn't involve hoppers.

              – TenNineAce
              Nov 15 '16 at 3:40
















            I don't think you understand the problem. You're not making a copy of the items, just moving them.

            – MBraedley
            Nov 15 '16 at 2:58





            I don't think you understand the problem. You're not making a copy of the items, just moving them.

            – MBraedley
            Nov 15 '16 at 2:58













            Yeah, that's why I mentioned teleporting vs cloning at the beginning. Unfortunately there just doesn't seem to be an entity cloning command at the moment, sorry. I can't think of anything else that doesn't involve hoppers.

            – TenNineAce
            Nov 15 '16 at 3:40





            Yeah, that's why I mentioned teleporting vs cloning at the beginning. Unfortunately there just doesn't seem to be an entity cloning command at the moment, sorry. I can't think of anything else that doesn't involve hoppers.

            – TenNineAce
            Nov 15 '16 at 3:40

















            draft saved

            draft discarded
















































            Thanks for contributing an answer to Arqade!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgaming.stackexchange.com%2fquestions%2f208561%2fhow-can-i-create-a-copy-of-an-entity-using-command-blocks%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            ParseJSON using SSJSUsing AMPscript with SSJS ActivitiesHow to resubscribe a user in Marketing cloud using SSJS?Pulling Subscriber Status from Lists using SSJSRetrieving Emails using SSJSProblem in updating DE using SSJSUsing SSJS to send single email in Marketing CloudError adding EmailSendDefinition using SSJS

            Кампала Садржај Географија Географија Историја Становништво Привреда Партнерски градови Референце Спољашње везе Мени за навигацију0°11′ СГШ; 32°20′ ИГД / 0.18° СГШ; 32.34° ИГД / 0.18; 32.340°11′ СГШ; 32°20′ ИГД / 0.18° СГШ; 32.34° ИГД / 0.18; 32.34МедијиПодациЗванични веб-сајту

            19. јануар Садржај Догађаји Рођења Смрти Празници и дани сећања Види још Референце Мени за навигацијуу