So, if you know PizzaSpleef by Sethbling, you should know my concept. Pretty much, when you break a specific block, it gives all the other players that potion effect except the player who broke that block. Can anybody show me some example code? Here is what I have so far.. Code:java @EventHandler public void onBlockBreak(BlockBreakEvent e) { Block b = e.getBlock(); if(b.getType() == Material.REDSTONE_BLOCK) { e.getPlayer().addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 5, 2)); if(b.getType() == Material.GLASS) { e.getPlayer().addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, 5, 2)); if(b.getType() == Material.WOOD) { e.getPlayer().getInventory().addItem(new ItemStack(Material.MONSTER_EGG, 3, (short) 50)); if(b.getType() == Material.WOOL) { Wool wool = (Wool) b; if(wool.getColor() == DyeColor.GREEN) { e.getPlayer().addPotionEffect(new PotionEffect(PotionEffectType.JUMP, 10, (short) 10)); if(b.getType() == Material.SOUL_SAND) { e.getPlayer().getInventory().addItem(new ItemStack(Material.POTION, 4, (short) 16426)); Thanks.
Okay, first you're checking if it's a redstone block, then you're checking if it's glass... what? It's definitely gonna fail there.
I think he means this: Code:java @EventHandlerpublic void onBlockBreak(BlockBreakEvent e) {Block b = e.getBlock(); if(b.getType() == Material.REDSTONE_BLOCK) {e.getPlayer().addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 5, 2));}else if(b.getType() == Material.GLASS) {e.getPlayer().addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, 5, 2));} else if(b.getType() == Material.WOOD) {e.getPlayer().getInventory().addItem(new ItemStack(Material.MONSTER_EGG, 3, (short) 50));} else if(b.getType() == Material.WOOL) {Wool wool = (Wool) b;if(wool.getColor() == DyeColor.GREEN) {e.getPlayer().addPotionEffect(new PotionEffect(PotionEffectType.JUMP, 10, (short) 10));} else if(b.getType() == Material.SOUL_SAND) {e.getPlayer().getInventory().addItem(new ItemStack(Material.POTION, 4, (short) 16426));
Jaaakee224 Run a for loop on all players in the game, check if the player != the players you are looping through, then add them a potion effect?