playEffect on player location not exact

Discussion in 'Plugin Development' started by WhatAaCow, Dec 25, 2013.

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

    WhatAaCow

    Hi,
    On command "/test" i'm playing an effect.
    Code:java
    1. player.getWorld().playEffect(player.getLocation(), Effect.POTION_BREAK, 1, 1);
    but in game, the posion effect IS NOT playing on the EXACT location of the player. It's always playing on the floored value of the location (if player's x is 500.7, it's playing on 500)

    Any fix or ideas?
     
  2. Offline

    pope_on_dope

    play it at the location player.getEyeLocation(); i think that's the method
     
  3. Offline

    WhatAaCow


    The same issue
     
  4. Offline

    pope_on_dope

    can i see your new code
     
  5. Offline

    WhatAaCow

    pope_on_dope
    Code:java
    1. player.getWorld().playEffect(player.getEyeLocation(), Effect.POTION_BREAK, 1);
     
  6. Offline

    pope_on_dope

    try a different effect and tell me what happens
     
  7. Offline

    WhatAaCow

  8. Offline

    xTigerRebornx

    WhatAaCow Try doing it without the second 1 (As that makes it within a radius)
     
  9. Offline

    Blah1

    Create a new location where the y is 1 block higher than the player's location and do it at that location.
     
  10. Offline

    WhatAaCow

    xTigerRebornx read Javadoc, the 1 is a data (this value dosn't make difference)
    Blah1 won't change something (tested and it logic that it doesn't change anything!)
     
  11. Offline

    Blah1

    WhatAaCow Set it like 20 blocks up just to make sure you're not making a weird error.
     
  12. Offline

    xTigerRebornx

    WhatAaCow I did read the javadocs, the second 1 (from your OP) is a radius.
     
  13. Offline

    WhatAaCow

    xTigerRebornx it isn't. "data - a data bit needed for some effects" under playEffects explanation
    Blah1 yeah, but doesn't change something :/
     
  14. Offline

    xTigerRebornx

  15. Offline

    WhatAaCow

  16. Offline

    CeramicTitan

    Its because your parameters are wrong.

    Your data should be: http://minecraft.gamepedia.com/Potions for the corresponding potion effect.

    player.playEffect(player.getLocation(), Effect.POTION_BREAK, 8292 /*Poison*/,1);
     
  17. Offline

    WhatAaCow

    CeramicTitan No my parameters are correct. You can use 1-... or 8292-82.. . And it doesn't change something :/
     
  18. Offline

    brord

    effects play on full blocks only, not halfway through 2 (always on x.5 y.5, z.5)
    Unless they updated somethign ofcourse, which im not aware of
     
  19. Offline

    WhatAaCow

    but if you throw a splash potion, it won't be on full blocks
     
Thread Status:
Not open for further replies.

Share This Page