Thank you... Can someone help me? I'm really stuck... I don't know how to do the leash throwing a hook...
This works similar but not exactly. It allows you to grapple around just like grappler except with a fishing rod. http://dev.bukkit.org/bukkit-plugins/grappling-hook/
timtower Yeah, I'm creating my own KitPvP plugin and I can't seem to figure out how to do the grappler kit...
Code:java @EventHandler(priority=EventPriority.NORMAL, ignoreCancelled=true) public void onPlayerFish(PlayerFishEvent event) { final Player player = event.getPlayer(); if (this.grappler.contains(player.getName())) { player.sendMessage(ChatColor.RED + "Cooling Down"); event.setCancelled(true); } else if (event.getState().equals(PlayerFishEvent.State.IN_GROUND)) { Location lc = player.getLocation(); Location to = event.getHook().getLocation(); lc.setY(lc.getY() + 0.5D); player.teleport(lc); double g = -0.08D; double d = to.distance(lc); double t = d; double v_x = (1.0D + 0.07000000000000001D * t) * (to.getX() - lc.getX()) / t; double v_y = (1.0D + 0.03D * t) * (to.getY() - lc.getY()) / t - 0.5D * g * t; double v_z = (1.0D + 0.07000000000000001D * t) * (to.getZ() - lc.getZ()) / t; Vector v = player.getVelocity(); v.setX(v_x); v.setY(v_y); v.setZ(v_z); player.setVelocity(v); grappler.add(player.getName()); Bukkit.getServer().getScheduler().scheduleAsyncDelayedTask(plugin, new Runnable() { public void run() { grappler.remove(player.getName()); } } , 250L); } else if (event.getState().equals(PlayerFishEvent.State.CAUGHT_ENTITY)) { Location lc = player.getLocation(); Location to = event.getHook().getLocation(); lc.setY(lc.getY() + 0.5D); player.teleport(lc); double g = -0.08D; double d = to.distance(lc); double t = d; double v_x = (1.0D + 0.07000000000000001D * t) * (to.getX() - lc.getX()) / t; double v_y = (1.0D + 0.03D * t) * (to.getY() - lc.getY()) / t - 0.5D * g * t; double v_z = (1.0D + 0.07000000000000001D * t) * (to.getZ() - lc.getZ()) / t; Vector v = player.getVelocity(); v.setX(v_x); v.setY(v_y); v.setZ(v_z); player.setVelocity(v); this.grappler.add(player.getName()); Bukkit.getServer().getScheduler().scheduleAsyncDelayedTask(plugin, new Runnable() { public void run() { grappler.remove(player.getName()); } } , 250L); } }
daytonpoop That work but I get an error. The error message is Plugin cannot be resolved to a variable. What did I do wrong and I want the item to be a leash not a fishing rod... When a player right clicks the leash then the hook will fly out and when they left click it moves them towards the hook location!
sgavster Ok... I was trying to get the hook to come out of the leash but don't seem to get it... sgavster Did you find it yet? I can't seem to get it just right... EDIT by Moderator: merged posts, please use the edit button instead of double posting.
Try leashing an Invisible entity, or something you want at the start (e.g. An arrow), then you can set the arrow's velocity, and the leash will render until it "breaks"
I don't want to sound rude but it seems like you're asking to be spoon fed, the whole meal :3 If someone told you how to do it, could you turn it into Java code? :/
Luke_Lax I'm pretty new to Java Coding and it seems like this is a very hard kit to code... I'm not asking for someone to do the whole thing... but if they did it would help me greatly because I'm so new...
ajs333 Doing the whole thing for you would hurt you greatly, missing out on an opportune time to learn.
PogoStick29 has a tutorial on grappling hooks. I would link you but I am on my phone. Go on youtube and search "Pogostick29dev grappling hook tutorial"
Monkey_Swag lol this guy only cares about the leash being the hook, pretty sure pogo doesnt cover that. i think he already knows how to do it with a fishing rod
MrInspector well someone else bumped it today. Didn't mind checking thr OP's date of posting this thread.... oops xD
I would buy your gKits plugin on Spigot but I dont know how well your Grappler kit works. Do you mind making a video on it?