i am trying to make a simple plugin that can make 3 block wide paths when you toggle it i have created the playerlistener and have entered this code. Code: package me.ciarian.plugins.pathmaker; import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.block.BlockFace; import org.bukkit.entity.Player; import org.bukkit.event.player.PlayerListener; import org.bukkit.event.player.PlayerMoveEvent; /** * * @author ipad */ public class PathmakerPlayerlistener extends PlayerListener{ @Override public void onPlayerMove(PlayerMoveEvent event) { Player player = event.getPlayer(); Block block = player.getLocation().getBlock().getRelative(BlockFace.DOWN); block.setType(Material.); my problem is i cant fighure ou how could i get it to place one block underneather u and 2 either side ??
Code: Block pathBlocks; pathBlocks = world.getBlockAt(X, Y, Z); pathBlocks.setTypeId(1); pathBlocks = world.getBlockAt(X, Y, Z + 1); pathBlocks.setTypeId(1); pathBlocks = world.getBlockAt(X, Y, Z - 1); pathBlocks.setTypeId(1); pathBlocks = world.getBlockAt(X + 1, Y, Z); pathBlocks.setTypeId(1); pathBlocks = world.getBlockAt(X - 1, Y, Z); pathBlocks.setTypeId(1); pathBlocks = world.getBlockAt(X + 1, Y, Z + 1); pathBlocks.setTypeId(1); pathBlocks = world.getBlockAt(X + 1, Y, Z - 1); pathBlocks.setTypeId(1); pathBlocks = world.getBlockAt(X - 1, Y, Z + 1); pathBlocks.setTypeId(1); pathBlocks = world.getBlockAt(X - 1, Y, Z - 1); pathBlocks.setTypeId(1); That should make a square around you of stone with the player in the center
@Jogy34 Could you use this in a command, like in this way Code:JAVA pathBlocks = world.getBlockAt(X, Y, Z);pathBlocks.setTypeId([1]); Where, [1] is the arguement like /<command> <material type>