Solved Placing block as a player using code

Discussion in 'Plugin Development' started by CraftBang, Apr 30, 2015.

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

    CraftBang

    Hey everyone,

    I'm trying to create a plugin where I can paste schematics as a player using a command like "/house"
    But a problem is it can bypass regions.
    I can make a check for a worldguard region, but not for like the spawnprotection and Factions. (Factions is biggest problem I could solve spawnprotection by just claiming with worldguard)

    My question:
    Anyway to let the user place a block? So I can check if the player is allowed to build there.
    If you have another idea to check if the player is allowed to build there, feel free to share it :D!

    Thanks in advance,

    CB
     
  2. Offline

    mythbusterma

    @CraftBang

    You can create a BlockPlaceEvent and call the event, then check to see if it gets cancelled.
     
  3. Offline

    1Rogue

    Why can't you check the spawn protection or factions?

    Bad idea to call internal events, also won't account for any cancelations within nms.
     
  4. Offline

    mythbusterma

    @1Rogue

    Understood, but it's better than nothing. It's also the only way you're going to be able to make it work with every plugin.
     
  5. Offline

    CraftBang

  6. Offline

    MrBestAndrew

    @CraftBang Are You Using WorldGaurd if so just use the worldgarud API to see if the player can
     
Thread Status:
Not open for further replies.

Share This Page