Cast from String to Effect?

Discussion in 'Plugin Development' started by Uniclaw, Oct 5, 2012.

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

    Uniclaw

    Hi!

    i have a Stringbuilder Effect.theffect, and it must be converted to a string - anyone has a idea?that not work:
    Code:
    e.getBlock().getLocation().getWorld().playEffect(e.getBlock().getLocation(), (Effect)sb.toString(), 31);
    Anyone :( ?

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

    civ77

  3. Offline

    Uniclaw

    Thanks for the Answer :D !
    Hm, but with that i convert the Enum to a String, right? (Because i would convert String -> Enum )

    EDIT:
     
  4. Offline

    Seadragon91

    Try <enum name>.valueOf("string");

    Example:
    GameMode gameMode = GameMode.valueOf("PVP");
     
  5. Offline

    Uniclaw

    Ok, thanks :D !

    Ah, one thing:

    How i can get the direction if i clicked a block? Because i would set a block if i click with a blaze rode on a block, but for that i need the direction.. With BlockFace i can check the opposite face, but not the block :/

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 29, 2016
Thread Status:
Not open for further replies.

Share This Page