Blood Posion Effect

Discussion in 'Plugin Development' started by trikxgaming, Apr 24, 2014.

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

    trikxgaming

    How do I make it where when a play is posioned it shows blood particles? Here is my code so far!
    Code:
    @EventHandler
        public void onBloody(EntityDamageByEntityEvent e){
            Player p = (Player) e.getEntity();
            Player d = (Player) e.getDamager();
            if(plugin.bloody.contains(d.getName())){
                if(e.getDamager() instanceof Player && e.getEntity() instanceof Player){
                    if(Math.random() > 0.25D) {
                        p.addPotionEffect(new PotionEffect(PotionEffectType.POISON, 120, 1));
                        e.getDamager().getLocation().getWorld().playEffect(e.getEntity().getLocation().add(0, 1, 0), Effect.STEP_SOUND, 152);
     
                    }
                }
     
            }
        }
     
  2. Offline

    xAstraah

    Find a blood plugin and view some source code and see what they do?
     
  3. Offline

    Plo124

    trikxgaming
    Use the EntityDamageEvent as well at the EntityDamageByEntityEvent, in the EntityDamageEvent check if the DamageType is DamageType.POISON, if so, make more blood.
     
  4. Offline

    oscarshi1995

    Hm.. from some searching it seems you can do it with Effect.Step_Sound and apparently that isnt just sound, try that.
    if that doesnt work just send some worldchange packets to the client

    Plo124 I believe he was asking how to make the particles itself

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 7, 2016
  5. Offline

    Plo124

    oscarshi1995
    No because he has the code correct to play the step_sound
     
  6. Offline

    oscarshi1995

    Plo124 My mistake. Didnt read the entire line
     
  7. Offline

    trikxgaming

    Im asking how to make it when the player is damaged by the poison how to make the blood effect also happen then
     
  8. Offline

    Plo124

    trikxgaming
    Yes, and I posted how here:
     
  9. Offline

    jusjus112

    trikxgaming
    Code:java
    1. p.playEffect(p.getLocation(), Effect.STEP_SOUND, Material.REDSTONE_BLOCK)
     
Thread Status:
Not open for further replies.

Share This Page