这是我的简单脚本:
public void cast(Player caster) {
    Location loc = caster.getTargetBlock(null, 512).getLocation();
    for (int c = 0; c < 2; c++) {
        for (int b = 0; b < 2; b++) {
            for (int a = 0; a < 1; a++) {
                caster.sendMessage("" + loc);
                Block ice = caster.getWorld().getBlockAt(loc.add(a, b, c));
                ice.setTypeId(79);
            }
        }
    }
}
我试图让它loc保持静止不变。它在整个 for 循环中一直在变化,我希望防止这种情况发生。