Place block at X, Y and X - Printable Version +- Cuberite Forum (https://forum.cuberite.org) +-- Forum: Plugins (https://forum.cuberite.org/forum-1.html) +--- Forum: Plugin Discussion (https://forum.cuberite.org/forum-8.html) +--- Thread: Place block at X, Y and X (/thread-876.html) |
Place block at X, Y and X - supertransformer - 05-07-2013 How do i place a block at X, Y and Z? I'm making a protection plugin and the protection works and in the way that when someone breaks a block, it will break, just not return the item, i just need to put the exactly same block there and im sorta done. RE: Place block at X, Y and X - xoft - 05-07-2013 Protection should work by disabling the breaking altogether, rather than fixing the aftermath. If the offender breaks a chest, you'd have to replace all the contents - it'd be much easier not to break the chest at all. See the OnPlayerBreakingBlock hook for details on how to do that: http://mc-server.org/wiki/doku.php?id=api:plugin:onplayerbreakingblock As to your question, block placement is done using cWorld:SetBlock() or cWorld:FastSetBlock(); the difference is that FastSetBlock() doesn't trigger block updates and doesn't process block entities. |