Red Dye [Help]

Discussion in 'Plugin Development' started by Cooper PluginDev, Feb 26, 2014.

Thread Status:
Not open for further replies.
  1. How would I go about dropping 'red dye powder'?
    I'm currently using: ItemStack blood = new ItemStack(Material.RED_ROSE);
    But it drops a rose not the dye powder.
    What's the name of the 'red dye powder'?
     
  2. Offline

    QuipCream

    Are you talking about red dye powder as in Blood?
     
  3. Offline

    QuipCream

  4. QuipCream I want it so when a player dies it drops 'blood'. I also want to make it not pick upable.
     
  5. Offline

    QuipCream

    Ok, So you're going to want to run the PlayerDeathEvent to check if a player has died. Then just add in this code. I'm not sure if it works:

    CODE:
    Code:java
    1. for(Entity entity : e.getEntity().getNearbyEntities(32,32,32)) {
    2.  
    3. if(entity instanceof Player) {
    4.  
    5. Player target = (Player) entity;
    6.  
    7. if (states.containsKey(target)) {
    8.  
    9. if(!states.get(target)) { continue; }
    10. }
    11.  
    12. target.playEffect(e.getEntity().getLocation().add(0, 1, 0), Effect.STEP_SOUND, 152);
    13.  
    14.  
     
  6. QuipCream
    Errors all over lol. I just want it so the player drops 'red dye' and you can't pick it up.
     
  7. Offline

    Derpiee

  8. Offline

    xize

    Cooper PluginDev
    you might can use setDurability() to set the sub data value and maybe with the DyeColor enum get all the dye colors from it:)
     
  9. Offline

    Derpiee

  10. Derpiee
    How would I go about changing the ink sac to red?
    This is what I've got ItemStack blood = new ItemStack(Material.INK_SACK, 3);
     
  11. Offline

    Derpiee

    blood.setDurability((short) 1);
     
    Cooper PluginDev likes this.
  12. Derpiee
    Thanks man! How would I go about making this item not pickable?
     
  13. Offline

    Derpiee

    Code:java
    1.  
    2. @EventHandler
    3. public void onItemPickup(PlayerPickupItemEvent event) {
    4. if(event.getItem().getType().equals(Material.INK_SACK)) {
    5. event.setCancelled(true);
    6. }
    7. }
    8.  
     
  14. Derpiee
    Didn't work :/
    Still can pick up the item.
     
  15. Offline

    TeeePeee

    When you create the item, ITEM.setPickupDelay(Integer.MAX_VALUE);
     
    TheMasterDerpster likes this.
Thread Status:
Not open for further replies.

Share This Page