how do i make the block_dust particle be a specific block, like making the dust look like stone or dirt
im trying to have a block break a few seconds after its placed, and when it breaks have it play a sound and have particles of the same texture like explode out it i tried this but it doesnt show any particles im not getting an error though Code (Java): Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(KitPVP.getInstance(), new Runnable() { @Override public void run() { Block placed = event.getBlockPlaced(); placed.setType(Material.AIR); playGlobalSound(placed.getLocation(), Sound.BLOCK_METAL_BREAK, 1, 1); event.getPlayer().spawnParticle(Particle.BLOCK_DUST, placed.getLocation(), 5, placed.getBlockData()); } }, (long) (block_time*20));
Are you sure that task is being runned? Try puting a print to the console for debuging. For the dust you could make a switch of the block material unless you pretend in using this system in every block type.
the block disappears and the sound plays but no particles show. i could do a switch but im not sure how to make the particles have a blocks texture.
I think for the T data at the end, it needs to be a material, so instead of placed.getBlockData() make it placed.getType(). But that is just how I am reading it from here
thank you for the link i need BlockData for BLOCK_DUST, but i give it the blocks data and it doesnt show any particles this works though Code (Java): event.getPlayer().spawnParticle(Particle.BLOCK_DUST,placed.getLocation(),10,Material.STONE.createBlockData()); not sure why this works but placed.getBlockData() doesnt but im just gonna try to do a switch statement for each block. i tried doing placed.getType().createBlockData() but that doesnt work either EDIT: omg its because i set the block to air and then try to get air particles EDIT: this works Code (Java): Block placed = event.getBlockPlaced(); event.getPlayer().spawnParticle(Particle.BLOCK_DUST,placed.getLocation(),10,placed.getBlockData()); placed.setType(Material.AIR);