Connect leashes between two fence posts?

Discussion in 'Spigot Plugin Development' started by ramidzk, May 14, 2017.

  1. How would I connect leashes between two fence posts or from one fence post to another and store the connected block's location?
     
  2. Bump. Still need help. I just want the client to see it so it looks like wires (yes IE and IC2 in spigot is what i'm making)
     
  3. I think you can only connect a leash to a entity and not to a block. :eek:
     
  4. ur making internet explorer in spigot????????? lol woooot?
    anyways the rope handle is an entity, so is the lead marking, I suppose all you need to do is spawna leash at the fence location and set the second part of the leash (dont know how but need to explore) to the second fence
     
    • Funny Funny x 1
  5. For storage part you could use a hashmap / file.
     
  6. It is possible with some invisible entities. Looks very clunky though.
    [​IMG]
     
    • Like Like x 3
  7. IE is Immersive Engineering and IC2 is Industrial Craft 2.

    How would I do that?
     
  8. You create two invisible Entites (I used Slimes) with no AI and gravity. Then leash one entity to the one leash hitch and the other entity to the other one. (I used packets to leash them but Bukkit's methods should work fine)
    To position them between the two leash hitches you can do a bit of simple vector calculation.

    Edit: Don't forget to make the Entities not collidable.
     
  9. I think that putting two slimes inside one fence and leash one to the same fence it is inside and leash the other one to the other fence, then it will show the leash between the two and both fences will have leashes attached to them will look smoother.
     
    • Like Like x 1
    • Agree Agree x 1
  10. And I'll kill those slimes when the block is broken. Only question now, how would I get the smallest slime size?
     
  11. Why would you need to make the slime small if you can make it not collide-able and take it's AI? You can also use armor stands instead, just set them as a marker and players won't be able to collide with them, interact with them and damage them.

    EDIT: If you decide to use armor stands do not forget to cancel their gravity.
     
  12. As far as I know Non-Living Entities (except leash hitches) can't be leashed. Correct me if I'm wrong.
     
  13. So I can break the block it's in. I don't want like 500 slimes made from the same leash.
     
  14. There's a Slime#setSize(int size) method.
     
  15. The size doesn't matter, it doesn't effect the location.

    You can also connect the slime to the block it is in with a hashmap and then break the block when the slime is dead.