How would I set the block type at "loc" then add 1? Code:java package com.gmail.TheDevelopingGod.Middle; import com.worldcretornica.plotme.Plot;import com.worldcretornica.plotme.PlotManager;import com.worldcretornica.plotme.PlotMapInfo;import com.worldcretornica.plotme.PlotMe; import org.bukkit.Bukkit;import org.bukkit.ChatColor;import org.bukkit.Location;import org.bukkit.Material;import org.bukkit.World;import org.bukkit.block.Block;import org.bukkit.command.Command;import org.bukkit.command.CommandExecutor;import org.bukkit.command.CommandSender;import org.bukkit.entity.Player; import java.util.UUID; import static com.worldcretornica.plotme.PlotManager.*; /*** Created by John on 6/12/2014.*/ public class Commands implements CommandExecutor { public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args){ if (cmd.getName().equalsIgnoreCase("middle")){ if (sender instanceof Player) { Player player = (Player) sender; if (player.hasPermission("middle.*")) { String id = PlotManager.getPlotId(player.getLocation()); Plot plot = PlotManager.getPlotById(player,id); String name = player.getName(); if(plot.owner.equalsIgnoreCase(name)){ World w = player.getWorld(); Location top = PlotManager.getPlotTopLoc(w, id); Location bottom = PlotManager.getPlotBottomLoc(w, id); int tx = top.getBlockX(); int bx = bottom.getBlockX(); int tz = top.getBlockZ(); int bz = bottom.getBlockZ(); int ty = top.getBlockY(); int by = bottom.getBlockY(); int midX = (top.getBlockX() + bottom.getBlockX()) / 2; int loc = (tz + bz) / 2; Location locate = new Location(w, tx, ty, tz); ((Block) locate).setType(Material.REDSTONE_BLOCK); for(int i = 0; i < 64; i++){ //loc.setType(Material.REDSTONE_BLOCK); how to } sender.sendMessage(ChatColor.DARK_GRAY + "[" + ChatColor.DARK_GREEN + "x" + ChatColor.DARK_GRAY + "]" +ChatColor.GRAY+" The center of your plot has been marked for 5 seconds."); Bukkit.getScheduler().runTaskLater(Main.getPlugin(), new Runnable() { @Override public void run() { Location locate = new Location(w, tx, ty, tz); locate.setY(locate.getY() + 1); ((Block) locate).setType(Material.AIR); } }, 100L); }else{ sender.sendMessage(ChatColor.DARK_GRAY + "[" + ChatColor.RED + "x" + ChatColor.DARK_GRAY + "]" +ChatColor.GRAY+" You must be the owner of this plot to do that"); } } } } return false; }} bump EDIT by Moderator: merged posts, please use the edit button instead of double posting.
WeDaBeast didnt looked at the code, but if you want to set the block in certain location and add 1 to it, loc.getBlock().setType(...); loc.add(x, y, z); // OR loc = loc.add(x, y, z);