[solved] Is there a way to create a pre-fabricated structure quickly?

Discussion in 'Plugin Development' started by phondeux, Mar 3, 2012.

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

    phondeux

    I'm writing a plugin which when one right clicks a block it plants a pre-fab structure. Is there an easy way to do this?
     
  2. Offline

    TopGear93

    easy way? The simpliest way i know how to do it is " graphing " the location of the blocks. you need to grab the players location and work from that. You need to know x,y,z coordinates. Yes i know im a dev but when it comes to the coding part of rigorous things like this count me out. i wouldnt know how to do the math lol.
     
  3. Offline

    phondeux

    I figured that; I'm hooking into PlayerInteractEvent and grabbing the block loc of what their right-hand is striking.

    What I want is to see if there's a function where I can just load loc's and block materials and have it 'plant' it at the struck location.

    Nevermind, solved good enough for my next thread. :)

    Solution: if you have a block location, like from a PlayerInteractEvent, you can get nearby blocks by using block.getRelative (x, y, z).

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

Share This Page