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 net.md_5.bungee.api.ChatColor;

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

    public void onDisable() {
    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;
    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?