Flagging if a block has been placed?

Discussion in 'Plugin Development' started by Eggspurt, Jun 14, 2015.

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

    Eggspurt

    How would I properly flag a block that has been placed? Also, McMMO a long time ago had an issue that when blocks where placed it would register but if the block was moved via piston then it would be removed from however it was defined as being "placed".


    Any assistance in helping me would be most appreciated,

    Kind Regards -

    Eggspurt :)
     
  2. Offline

    caseif

    I *think* blocks can accept metadata, although I'm not sure whether it's persistent. If not, you would probably need to store the location of each block in a config file. Regarding pistons, you would need to listen to the appropriate event and check the block being moved, and if it has a metadata or is defined in the config file, remove it and add it to the new block (e.g. the block after it's moved).
     
  3. Offline

    I Al Istannen

    @caseif @Eggspurt Metadata is not persistent after a restart. It might be still there after a reload though, but you can't use that for this.
     
  4. Offline

    tytwining

    @Eggspurt you could make something in the config storing the coordinates of the block.
     
  5. Offline

    caseif

    If metadata doesn't persist then yes, the only option is to store the coordinates on disk in some way.
     
Thread Status:
Not open for further replies.

Share This Page