minecraft: How to get coordinates of blocks inside selection

。_饼干妹妹 提交于 2019-12-24 07:38:42

问题


For a Loot Plugin i need all the coordinates of chests in my prebuilt world. To add them to the plugins config. I am not programming the plugin, i am just using it, i just need a way to get multiple coordinates for specific blocks in a world.

OR

If it is possible to use worldedit and replace chests with chests that have nbt tags i can completely skip the plugin part and use the vanilla loot tables. But i haven't yet found a way to setblocks with nbt data using worldedit.

I was thinking about downloading the map moving it into mcedit or worldpainter and hopefully find a way there to export the coordinates of each chest.

I'm looking forward for some solutions, and i'm thanking you in advance!


回答1:


If you have to prepare this world initially and only once, I would recomment to use a plugin to identify all the chests in the world (e.g. by iterating through all already generated chunks and all containing blocks), and modifing or saving them, the way you need to. Doing this on a productive server will probably cause lags, cause the iterating/searching will be very intensive.

You could also think about some kind of hacky way, to identify if the blocks are placed by the world generator/a plugin or a player. When u use the plugin LogBlock, you can check, if the clicked chest was placed by a player. If so, treat this chest as a normal chest, otherwise, if no player has ever placed a block at this location, treat the chest as a chest from the "loot plugin".

Any of the ways will work, but the first one will probably be a little harder, since you have to manually load all the chunks. The second is a little bit hacky, but will be more easy, but maybe not compatible to your setup.



来源:https://stackoverflow.com/questions/57334033/minecraft-how-to-get-coordinates-of-blocks-inside-selection

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!