Discussion in 'Plugin Development' started by JustClown, May 1, 2021.

Thread Status:
Not open for further replies.
  1. Offline


    Im using the PlayerBucketFill event and for whatever reason, nothing happens when a player picks up water with the bucket. Nothing, no error message no teleport or anything. There aren't any errors in the code,
    Any help is appreciated :)

    package;import org.bukkit.Bukkit;import org.bukkit.ChatColor;import org.bukkit.Location;import org.bukkit.Material;import org.bukkit.entity.Player;import org.bukkit.event.EventHandler;import org.bukkit.event.Listener;import org.bukkit.event.player.PlayerBucketFillEvent;import org.bukkit.inventory.ItemStack;public class onPlayerBucketFill implements Listener {

    ItemStack water = new ItemStack(Material.WATER_BUCKET);@EventHandlerpublic void onPlayerBucketFill(PlayerBucketFillEvent e) {
    Player player = e.getPlayer();player.sendMessage(ChatColor.GREEN + "Teleporting...");Location mlg2 = new Location(Bukkit.getWorld("world"), 79, 60, -9.1);player.teleport(mlg2);}

  2. Offline


    Could you please post your code via pastebin or something in that ball park. That way it's much easier for everyone to read your code!
  3. Offline


    Did you register your class in your main? And also, the
    ItemStack water = new ItemStack(Material.WATER_BUCKET);
    doesn't do anything.
  4. Offline


    hey sorry for the messy code, here's the pastebin link!

    my bad actually! i forgot to register it in my main :/
    im pretty new to plugin construction so thank u!!

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: May 2, 2021
Thread Status:
Not open for further replies.

Share This Page