Link two farm posts with lead (Urgent)

Discussion in 'Spigot Plugin Development' started by MaxJacobsYT123, Jun 8, 2017.

  1. Hello, so I need to make a plugin that allows the link of two fence posts with lead, and I was wondering if this is even possible to code such a thing, and if so, I am completely stuck. I want it to be so that a player can right click a fence post as they would an animal, and then right click another fence post to link them. I know lead takes one living entity but I was wondering if it is possible to code a plugin such as this. I really want this because it would give off the effect of rope.
  2. Well you should listen to PlayerInteractEvent event to check if a player right clicks on the fence with a lead. Technically you should be able to position the entity lead between the fence, maybe search the spigot doc a bit? Hopefully someone wiser about these things will help you!
  3. Ok thank you. I will try it out!
    • Agree Agree x 1
  4. I am going to be honest, I have no idea how to do that, and would that work if a player right clicks one fence post and then right clicks another? Also, most of the things that are needed to look like rope are going to be attached to a wall, so that means they will probably be in the air.
  5. look, first you get the location of the fence, then you spawn an invisible slime with noAI on those cords, tie the leashto the slime who is on the 1st fence post, and set the other location of the leash to the second fence post, do the same thing with the second fence post...