1.8.8 Making launch pad

Discussion in 'Spigot Plugin Development' started by notfoundname, Mar 12, 2020.

Thread Status:
Not open for further replies.
  1. Hello everyone who is reading this. How can I make launch pad that will kick player into sky?

    My code (it removes pressure plate, but not launch player)

    Code (Java):
    @EventHandler
        public void onPlayerWalk(PlayerMoveEvent e)
        {
            Player p = e.getPlayer();
                if (p.getLocation().getBlock().getType() == Material.WOOD_PLATE)
                {
                    p.getLocation().getBlock().setType(Material.AIR);
                    p.getLocation().getDirection().multiply(0).setY(6);
                }
        }
     
  2. In Spigot 1.15 it's Entity#setVelocity(Vector). Find the same method in your version.
     
  3. it returns me a warning
    [WARNING] Excessive velocity set detected: tried to set velocity of entity #2 to (0.0,5.0,0.0).

    [WARNING] java.lang.Exception: Stack trace

    [WARNING] at java.lang.Thread.dumpStack(Thread.java:1336)

    [WARNING] at org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity.setVelocity(CraftEntity.java:217)

    [WARNING] at bw.main.Trampoline.onPlayerWalk(Trampoline.java:25)

    [WARNING] at sun.reflect.GeneratedMethodAccessor118.invoke(Unknown Source)

    [WARNING] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

    [WARNING] at java.lang.reflect.Method.invoke(Method.java:498)

    [WARNING] at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:300)

    [WARNING] at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:78)

    [WARNING] at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62)

    [WARNING] at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:501)

    [WARNING] at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:486)

    [WARNING] at net.minecraft.server.v1_8_R3.PlayerConnection.a(PlayerConnection.java:272)

    [WARNING] at net.minecraft.server.v1_8_R3.PacketPlayInFlying.a(SourceFile:126)

    [WARNING] at net.minecraft.server.v1_8_R3.PacketPlayInFlying$PacketPlayInPosition.a(SourceFile:57)

    [WARNING] at net.minecraft.server.v1_8_R3.PlayerConnectionUtils$1.run(SourceFile:13)

    [WARNING] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)

    [WARNING] at java.util.concurrent.FutureTask.run(FutureTask.java:266)

    [WARNING] at net.minecraft.server.v1_8_R3.SystemUtils.a(SourceFile:44)

    [WARNING] at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:790)

    [WARNING] at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:429)

    [WARNING] at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:729)

    [WARNING] at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:632)

    [WARNING] at java.lang.Thread.run(Thread.java:748)
    Code (Java):
    p.setVelocity(p.getVelocity().setY(5.0d));
     
  4. Surprised you even need help it literally says the problem
    Also use multiply instead of set
     
  5. Like this, I think?
    Code (Text):
    p.setVelocity(p.getVelocity().multiply(p.getVelocity().getY() + 5.0));
     
  6. Ok this it paperspigot's thing. Just disabled it in paper.yml. Issue solved.
    Code (Java):
    p.setVelocity(p.getVelocity().setY(5.1d));
     
Thread Status:
Not open for further replies.