欢迎来到Minecraft插件百科!
对百科编辑一脸懵逼?
帮助:快速入门
带您快速熟悉百科编辑!
因近日遭受攻击,百科现已限制编辑,有意编辑请加入插件百科企鹅群:223812289
查看“Magic/Shops”的源代码
←
Magic/Shops
跳转至:
导航
、
搜索
因为以下原因,您没有权限编辑本页:
您所请求的操作仅限于这些用户组的用户使用:
用户
、
自动确认用户
、
巡查者
您可以查看与复制此页面的源代码。
Magic支持多种形式的服务器GUI 商店。请参考[http://reference.elmakers.com/#actions.shop 商店] action. Like all scripted events in Magic, shops exist in the form of spells. 查看 [https://github.com/elBukkit/MagicPlugin/blob/master/Magic/src/main/resources/examples/survival/spells/itemshop.yml ItemShop]以获取简单范例。 还有这里也有一些范例There are also many examples included in the [https://github.com/elBukkit/MagicPlugin/blob/master/Magic/src/examples/elworld/spells.yml#L2909 elMakers dev 服务器配置] 在后台,商店这一动作基于拓展的选择器参数运行 == 添加一个商店NPC == NPC可以释放任何法术,包括商店法术。你可以用这些指令设置一个 <pre class="">/mnpc add Magic Items! /mnpc cast magicitemshop</pre> == 创建一个自定义商店 == 制作一个自定义商店相当容易,只要使用继承功能参考[https://github.com/elBukkit/MagicPlugin/blob/master/Magic/src/main/resources/examples/survival/spells/buyshop.yml 购买商店] 或[https://github.com/elBukkit/MagicPlugin/blob/master/Magic/src/main/resources/examples/survival/spells/sellshop.yml 出售商店] 看看这一段示例也有帮助[https://github.com/elBukkit/MagicPlugin/blob/master/Magic/src/main/resources/examples/survival/spells/trinketshop.yml 饰品商店]: (翻译者:Magic插件的商店也是一种形式的法术,或者说有一类法术就是商店) <pre class="">trinketshop: inherit: buyshop #继承哪个商店 hidden: true #隐藏 parameters: #参数 items: - skull_ale - skull_apple - skull_aquarium - skull_arrowdown - ...</pre> 此法术只存在三个设置: * '''inherit''' 【继承】这一条告诉法术采用其他法术的全部设置。如果你想使用 <code>buyshop</code> 作为玩家可以购买物品的商店,或者 <code>sellshop</code> 作为玩家可以出售物品的商店。如果你想尝试一些更复杂的东西,请查看选择器下面的部分 * '''hidden''' 【隐藏】这一条告诉法术让它不要出现在/spell列表、技能书或网页中。如果要做一个你自己的专属法术可能需要这么做 * '''parameters'''【参数】 此处可以设置你要买卖什么物品 === 参数 === 参数部分通常使用 <code>items</code> 参数,它可以指定商店内的物品 你也可以使用 <code>scale</code> 参数来设置商店,例如在 [https://github.com/elBukkit/MagicPlugin/blob/master/Magic/src/main/resources/examples/survival/spells/lootshop.yml 战利品商店]的设置(似乎链接已挂), 可以设置价格范围,在出售商店的设置中使用<code>scale</code>始终使出售价格低于购买价格 其他参数还有: * <code>confirm</code>:【确认】 true/false,可以设置玩家在交易之前是否有一个确认的操作 * <code>confirm_filler</code>: 【填充确认】填充空的确认界面位置的材质 * <code>auto_close</code>: 【自动关闭】true/false,当一次交易结束后是否自动关闭商店。设置为false可以应对大量物品的交易 * <code>sell</code>: 【出售】设置为true可以让商店出售物品而非购买物品。 在后台会重新写入一些选择器参数以实现效果的反转 == The Items List == The <code>items</code> parameter in a shop can take two different forms: === List of items === Just a simple list of items. The prices of the items must be defined for each item in the items config. This can be done in items.yml, or in-game using <code>/mitem save <worth></code> to specify how much an item is worth. If an item does not have a worth specified it will be offered for free. The format <code>itemname@amount</code> can be used to offer multiple items in one slot. === List of configuration sections === For more complex shops, items can be specified in configuration sections. See [https://github.com/elBukkit/MagicPlugin/blob/master/Magic/src/examples/elworld/spells.yml#L1225 fieldshop] from the elMakers dev server configs as an example. Each item in a shop can have a few different properties: * <code>item</code>: The Material type of the item sold in this slot. * <code>slot</code>: A specific slot of the item GUI to put this item. Omit this to just fill in order. * <code>cost</code>: The cost of this item, if omitted the saved item worth will be used. * <code>name</code>: A custom display name for this item. Will be used by the icon as well as the item given. * <code>lore</code>: A custom list of lore for this item. Will be used by the icon as well as the item given. === Empty slots === A simple <code>none</code> can be put in the item list for an empty slot, allowing you to organize your shops. == 修改价格 == Changing prices on the default builtin shops can be done two different ways. === Item Shops === For simple item shops, it's best to change the value of the item rather than change the cost in each shop that sells it. This way your server has consistent prices across shops. This can be done in items.yml, by adding a config like this: <pre class="">emerald: worth: 1000</pre> or in-game, by holding the item you want to set the value for, and typing <code>/mitem save emerald 1000</code> === Wands and other complex shops === For non-items, such as wands or spells, the shop most likely has the prices built in. In this case you override the prices like you would any other spells' parameters- find the default configs, copy it to your Magic/spells folder and edit it. For instance, look at the [https://github.com/elBukkit/MagicPlugin/blob/master/Magic/src/main/resources/examples/survival/spells/magicitemshop.yml magicitemshop], it has prices listed for each item. Simply copy that file to your spells folder (or paste it in spells.yml if you prefer) and edit the prices as you wish. This is also how you can add and remove items from a shop. == The Selector Action == The Shop action extend Selector, providing a more simplified way to set up shops that mirrors the now-deprecated ItemShop action. However, this means that all of the parameters available to a Selector action and its options are also available to shops and shop items. See the [[Selector|the Selector action]] section for more information on setting up complex shops or completely custom GUIs using the Selector action.
返回至
Magic/Shops
。
导航菜单
个人工具
中文(中国大陆)
登录
名字空间
页面
讨论
变种
视图
阅读
查看源代码
查看历史
更多
搜索
导航
首页
最近更改
随机页面
编辑相关
百科公告
编辑帮助
互助客栈
贡献分数
测试沙盒
发布条目
插件分类
管理
安全
聊天
编程
经济
修正
娱乐
综合
信息
机械
角色
传送
网页
整地
创世
付费
其它
工具
链入页面
相关更改
特殊页面
页面信息
相关网站
MCMOD百科
Minecraft中文百科
Minecraft中文论坛
Minecraft百度贴吧
虚无世界Wiki