Check if is slime in cobweb

Discussion in 'Plugin Development' started by MpPozor, Dec 26, 2013.

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

    MpPozor

    Hello. Is here any way to check if is specific slime (with custom name) in specific cobweb?
     
  2. Offline

    chasechocolate

    Code:java
    1. slime.getLocation().getBlock().getType() == Material.WEB)

    To check for custom name, use slime.getCustomName().
     
  3. Offline

    MpPozor

    Is any event for it? or I need to check every tick?
     
  4. Offline

    chasechocolate

    Depends on what you want do do.
     
  5. Offline

    MpPozor

    I'm creating basketball plugin with one basket. Slime is ball and I need to teleport ball (slime) back on start position and add one point to player who last-hitted the ball (slime).
    Slime is size 1 (tiny) and has 100 hp with regeneration potion level 10 (and slow level 10 and jump level -10).

    Is here any way to do this? Please help. It's last thing which I need for my plugin.

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

    jusjus112

    MpPozor
    chasechocolate has answer your question? Right?
    You check it with get the block and the type, and check if it is an slime or an customname as chasechocolate said?
    If you have another question so ho do you make an event, thats part 2 for this thread!
     
  7. Offline

    MpPozor

    Yes. I'm thinking about checking it every tick but it isn't good for server where is here more mobs. Yes. What I need is event or another way for it.
     
  8. Offline

    Gater12

    MpPozor EntityDamageByEntityEvent ?
     
  9. Offline

    MpPozor

    Does it work? I think it can't work because entity (slime) does not take damage from cobweb
     
  10. Offline

    Gater12

    MpPozor But the player damages the slime?
     
  11. Offline

    MpPozor

    Gater12 Yes. Are you thinking about starting timer and watching for few seconds (or while isn't block under it)?
     
Thread Status:
Not open for further replies.

Share This Page