本模组旨在为整合包创作者提供功能,使其玩家能够随意生成(自定义)结构。
结构与放置选项均通过 NBT 标签进行设置。
用法:
这是一个可通过右键点击来放置结构的物品:
structure_item:item{offset:{X:0,Y:5,Z:0},structure:"structure:mine",allowedOn:"minecraft:stone",blacklist:["minecraft:bedrock"],replaceEntities:0,placeEntities:0,rotate:"north"}
1.21 版本:
structure_item:item[minecraft:custom_data={offset:{X:0,Y:5,Z:0},structure:"structure:mine",allowedOn:"minecraft:stone",blacklist:["minecraft:bedrock"],replaceEntities:0,placeEntities:0,rotate:"north"}]
如果点击的方块是石头,且路径上没有基岩和实体,它将放置名为 "structure:mine" 的结构(排除可能被向上移动了 5 个方块的已保存实体),并将其旋转,使南侧朝向被点击的方块面。(该结构的最低坐标角将位于你原本放置方块的位置上方 5 个方块处)。
如果省略 "structure",则无法工作。
如果省略 "offset",它将在你点击的方块处放置结构,并向你的视线方向、上方及两侧扩展。如果你向上或向下看,它会将结构中心置于你点击的方块正上方或正下方。
如果省略 "blacklist",它将替换任何方块。
如果省略 "allowedOn",它将允许在任何方块上“放置”。
如果省略 "replaceEntities" 或将其设置为 1,即使有非玩家实体阻挡了方块(非结构虚空),它也允许放置。这些实体将被删除。
如果省略 "placeEntities" 或将其设置为 1,结构中保存的实体将被放置。
如果省略 "rotate",结构将不会被旋转。
你可以使用白名单(whitelist)代替黑名单(blacklist)以指定某些可替换的方块,而不是列入黑名单。如果两者都指定了,黑名单优先,白名单将被忽略。
offsetV2:
你可以用 offsetV2:{x:"~",y:"~-sizeY/2",z:"~"} 替换 offset:{X:0,Y:5,Z:0},以使结构放置在点击方块的前方,并在上下方向居中。其行为类似于未设置 offset,但位置向下移动了高度的一半。对于侧向方块面,这意味着它在 Y 方向上也居中。
offsetV2:{x:"~",y:"~dirSelect(dir,0,0,-sizeY/2,-sizeY/2,-sizeY/2,-sizeY/2)",z:"~"} 将使结构始终在你点击的方块面后方(包括该方块面)居中放置。
offsetV2 允许使用以下运算符进行任意数学表达式计算:
- 加法:2 + 2
- 减法:2 - 2
- 乘法:2 * 2
- 除法:2 / 2
- 幂运算:2 ^ 2
- 一元负号、正号(符号运算符):+2 - (-2)
- 取模:2 % 2
以及以下函数:
- abs:绝对值
- acos:反余弦
- asin:反正弦
- atan:反正切
- cbrt:立方根
- ceil:向上取整至最近的整数
- cos:余弦
- cosh:双曲余弦
- exp:自然常数 e 的 x 次幂 (e^x)
- floor:向下取整至最近的整数
- log:自然对数(底数为 e)
- log10:常用对数(底数为 10)
- log2:二进制对数(底数为 2)
- sin:正弦
- sinh:双曲正弦
- sqrt:平方根
- tan:正切
- tanh:双曲正切
- signum:符号函数
- dirSelect:dirSelect(dir, down, up, north, south, west, east),其中方向对应于点击相应方块面时求值的表达式。
以及以下变量:
- pi, π:π
- e:欧拉常数
- φ:黄金比例
- dir:指示被点击方块面的变量,用于 dirSelect
- sizeX:结构在 X 方向的尺寸
- sizeY:结构在 Y 方向的尺寸
- sizeZ:结构在 Z 方向的尺寸
错误处理:
由物品创建者造成的错误将在聊天栏中显示,用户造成的错误将在屏幕中央产生一条严重错误信息。
模型与本地化:
如果你使用此模组,你可能想要更改物品的模型(当前 = 木棍)并编辑语言文件。
This mod is intended for modpack creators that want to give their players a possibility to spawn (custom) structures at will.
The structure as well as the placement option are set via NBT-tags.
Usage:
This is an item capable of placing structures on right click:
structure_item:item{offset:{X:0,Y:5,Z:0},structure:"structure:mine",allowedOn:"minecraft:stone",blacklist:["minecraft:bedrock"],replaceEntities:0,placeEntities:0,rotate:"north"}
1.21:
structure_item:item[minecraft:custom_data={offset:{X:0,Y:5,Z:0},structure:"structure:mine",allowedOn:"minecraft:stone",blacklist:["minecraft:bedrock"],replaceEntities:0,placeEntities:0,rotate:"north"}]
If the clicked block is Stone, no Bedrock and no entity is in the way, it will place the structure "structure:mine" excluding (potentially) saved Entities moved up by 5 blocks, rotating it so that the southern side is directed towards the clicked on blockface. (The low coordinate corner will start 5 blocks above the block you would have placed if this item were a block).
If you leave out "structure", it won't work.
If you leave out "offset", it will place the structure at the block you clicked at, expanding in your view direction, up and to both sides. if you look up or down, it'll place the structure centred above or below the block you clicked at.
If you leave out "blacklist", it will replace anything.
If you leave out "allowedOn", it will allow "placement" on any block.
If you leave out "replaceEntities" or set it to 1, it will allow placement even if non player entities are in the way of blocks (non structure voids). Those will get deleted.
If you leave out "placeEntities" or set it to 1, entities saved in the structure will be placed.
If you leave out "rotate", the structure will not be rotated.
You can use whitelist instead of blacklist to whitelist the replacement of certain blocks instead of blacklisting it. If both are specified, blacklist takes precedence and whitelist is ignored.
offsetV2:
You can replace offset:{X:0,Y:5,Z:0} with e.g. offsetV2:{x:"~",y:"~-sizeY/2",z:"~"} to get the structure placed in front of the clicked on block, centred in up and down direction. Behaving like offset was left out, but moved down by halve the hight. For side-faceing blockfaces, that means it's centred in y direction as well.
offsetV2:{x:"~",y:"~dirSelect(dir,0,0,-sizeY/2,-sizeY/2,-sizeY/2,-sizeY/2)",z:"~"} will always place the structure centred behind (including) the blockface you clicked at.
offsetV2 allows arbitrary mathematical expressions using following operators:
- Addition: 2 + 2
- Subtraction: 2 - 2
- Multiplication: 2 * 2
- Division: 2 / 2
- Exponentation: 2 ^ 2
- Unary Minus,Plus (Sign Operators): +2 - (-2)
- Modulo: 2 % 2
And following functions:
- abs: absolute value
- acos: arc cosine
- asin: arc sine
- atan: arc tangent
- cbrt: cubic root
- ceil: nearest upper integer
- cos: cosine
- cosh: hyperbolic cosine
- exp: euler's number raised to the power (e^x)
- floor: nearest lower integer
- log: logarithmus naturalis (base e)
- log10: logarithm (base 10)
- log2: logarithm (base 2)
- sin: sine
- sinh: hyperbolic sine
- sqrt: square root
- tan: tangent
- tanh: hyperbolic tangent
- signum: signum function
- dirSelect: dirSelect(dir, down, up, north, south, west, east) with the directions being expressions to evaluate in case of a click on that block face.
And following variables:
- pi, π: π
- e: Euler constant
- φ: golden Ratio
- dir: variable indicating the clicked on blockface, for use in dirSelect
- sizeX: size of Structure in x direction
- sizeY: size of Structure in y direction
- sizeZ: size of Structure in z direction
Error handling:
Errors made by the items' creator will be displayed in Chat, any errors made by the user will produce a fat massage in the middle of the screen.
Model & Localization:
If you use this mod, you may want to change the model of the item (currently = stick) and edit the language file.
下载 Structure Item Mod
下载 Structure Item Mod
下载 Structure Item Mod
下载 Structure Item Mod
下载 Structure Item Mod
下载 Structure Item Mod
下载 Structure Item Mod
下载 Structure Item Mod
未指定更新日志。
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
模组
显示你正在注视的方块的信息。(适用于 Minecraft 1.16+ 的 Hwyla/Waila 分支)
模组
在游戏画面角落显示附近世界地形、玩家、生物和实体的地图。可创建路径点,帮助你找到标记过的位置。
模组
查看物品与配方
模组
使用 JavaScript 编辑配方、添加自定义物品、编写世界事件!
模组
AE2:一款流行的自动化与存储模组
模组
那是什么?一个 Waila/Hwyla 的分支。
评论 0
登录后参与评分
还没有评论,来抢沙发吧