HELP!

Discussion in 'Spigot Help' started by TheRedstoneGeek, Jun 2, 2016.

  1. package me.TheRedstoneGeek;

    import java.util.Set;

    import org.bukkit.Location;
    import org.bukkit.Material;
    import org.bukkit.block.Block;
    import org.bukkit.command.Command;
    import org.bukkit.command.CommandSender;
    import org.bukkit.entity.Player;
    import org.bukkit.event.EventHandler;
    import org.bukkit.event.block.Action;
    import org.bukkit.event.player.PlayerInteractEvent;
    import org.bukkit.plugin.java.JavaPlugin;

    import net.md_5.bungee.api.ChatColor;

    public class CratesNormal extends JavaPlugin {
    @Override
    public void onEnable() {
    new PlayerListener (this);

    }
    @Override
    public void onDisable() {
    saveConfig();
    }
    @EventHandler
    public void onClick(PlayerInteractEvent event) {
    boolean onCommand(CommandSender sender, Command cmd, String label,String[] args) {
    if (cmd.getName().equalsIgnoreCase("setcrate") && sender instanceof Player) {
    if(player.getAction() == Action.RIGHT_CLICK_BLOCK && event.getClickedBlock().getTypeId() == 153)
    Player player = event.getPlayer();
    Block block = player.getTargetBlock((Set<Material>) null, 5);
    Location bl = block.getLocation();
    getConfig()set("coords", bl);
    }
    return false;
    }
    }
    }

    http://prntscr.com/bbc6uc
    Once you get the coords of the chest I want to set it in the config file so then it will be if the player right clicks the chest and it is located at them coords, run the chest as a crate but it won't set the coords in the config
     
    #1 TheRedstoneGeek, Jun 2, 2016
    Last edited: Jun 2, 2016
  2. Wrong section.
    Use code tags.
    Only bump once every 24 hours.
    Don't create multiple posts.
    Don't do shit like this:
    It's no wonder people don't want to help you...
     
  3. Where you need help?