Help with smoke effects on right click

Discussion in 'Plugin Development' started by coolmonkeyguy, Nov 11, 2013.

Thread Status:
Not open for further replies.
  1. Offline


    I need to basically show smoke effects when you right click the dead bush. Please help!

     if(e.getAction().equals(Action.RIGHT_CLICK_AIR)) {
                if (e.getPlayer().getItemInHand().getType().equals(Material.DEAD_BUSH)) {
                    e.getPlayer().sendMessage(ChatColor.BLUE + "[BBContraband]" + " " + ChatColor.GOLD + "Enjoy Those Drugs" );
                        e.getPlayer().addPotionEffect(new PotionEffect(PotionEffectType.HUNGER ,700,1));
                        e.getPlayer().addPotionEffect(new PotionEffect(PotionEffectType.SLOW ,700,1));
                      [B]  player.getWorld().playEffect(player.getLocation(), Effect.SMOKE, 0);[/B]
    The part tat is bolded is the part that does not work.

    Any help is gold!!
  2. Offline


    I loaded your code in a test world and everything seems to be working fine. Have you tried it in F5 mode? The smoke emits from what it looks like, your back left leg. You can't see it in first person mode, but you can in third person mode.
  3. Offline


    because you're using '0' use '1'.
  4. Offline


    That's F5 be default.
  5. Offline


    Edited. I use default Minecraft controls, but whenever I wrote that, I put down the wrong key. Oh well. :p
  6. Offline


    im getting errors in my code. player is getting an error. "player can not be resolved"
  7. Offline


    You'll want to make a player variable:
    1. Player player = e.getPlayer();
Thread Status:
Not open for further replies.

Share This Page