How can I spawn a leash? I would like to spawn it and attach one end to a player and another end to a FallingBlock.
Codewise like a plugin? or a command i have not heard of a leash item yet either but you would edit your inventory such as player.getInventory.additem(Material.Leash) that is what I would do at least. sorry if this is of no help to you :/ good luck though - mnoco8.
From what I've experienced and read, you aren't able to attach a lead to a sentient entity -- i.e., a player. It's sad, but true. I think the best you can do is make the player become the passenger of another mob, make that mob invisible, and hook both that mob and the falling sand entity together with a lead. As for "spawning in" a leash, something along the lines of... Code:JAVA Location loc = p.getLocation();Bat bat = p.getWorld().spawn(loc, Bat.class);Minecart cart = p.getWorld().spawn(loc, Minecart.class);bat.setLeashHolder(cart); I don't know if you can hook a lead to a minecart, but it's worth a shot, at least for this example.
In Java, if there is a will, there is a way. It just probably involves some reflection. Anyways, you can try getting the CraftPlayer from Player and then cast CraftPlayer to LivingEntity; I doubt this would work though.
The iron block you see is probaly a custom entity changed with protocollib into a falling sand entity. Look up some more advanced threads in order to see how you do it.