Crate Idea

Discussion in 'Spigot Plugin Development' started by pas5w0rd, Apr 14, 2017.

  1. Hello there!

    I am looking at coding something that looks quite highly skilled. This: (0:41) - where items rotate around an Ender Chest that gets placed down.

    I am guessing the items are on Armorstand but I cant understand how to move them or how to "make it work."
    I know how to do everything else but this is something I cant work out. I want to utilise this and change it to make it look different but I need to get this Armorstand method working.

    Where one Armorstand is left that the player ultimately receives.

  2. It's nothing to do with an armor stand at all, it's just dropped items that are having their velocities modified slightly similar to a particle effect.

    You drop the item at a location after you create the ItemStack and have a timer task that updates the items velocity and that allows it to float. The pickup delay on the item is set to a very long delay so players can't grab the items, then when the effect is over these items are removed.

    Or another method they're teleporting the dropped item by small distances very quickly.

    Sent from my iPhone using Tapatalk
  3. Really? Oh, right.

    How would I make a method for this? So lets say after the chest has been placed that it starts to generate random items and moves them, so for example just blocks like "Stone", "Dirt", etc and then eventually once the rotation has finished and one item is left in the rotation, it gives the item to the player.

    Thanks! :D
  4. You would need to define a path around the chest, using doubles not ints so you could move the item 1/8th of a block at a time, once you spawn the object teleport it to your first position, you'll likely need to give it a slight upward velocity constantly to keep it from falling. Then get your next point along the path and teleport it there or get a vector to it and "push" it there. It's a reasonably complex bit of code because you're moving in tiny increments and fighting gravity the whole time.

    Sent from my iPhone using Tapatalk
  5. Hm. Okay. How would I move it along the path then, like swiftly and then define the path? A circle radius code?