欢迎来到Minecraft插件百科!
对百科编辑一脸懵逼?
帮助:快速入门
带您快速熟悉百科编辑!
因近日遭受攻击,百科现已限制编辑,有意编辑请加入插件百科企鹅群:223812289
查看“Magic/NPC”的源代码
←
Magic/NPC
跳转到导航
跳转到搜索
因为以下原因,您没有权限编辑本页:
您请求的操作仅限属于这些用户组的用户执行:
用户
、
自动确认用户
、
巡查者
您可以查看和复制此页面的源代码。
Magic NPCs can be used to cast spells on players, allow them to check spell upgrade progress, purchase wands, items, spells, and much more. They can also run commands on right-click, as well as have any of the triggered events that [[MagicMobs|Magic Mobs]] can have. == WorldGuard == NOTE: If you want to use NPCs inside of WorldGuard regions, you will need to set <code>mobs.block-plugin-spawning: false</code> inside WorldGuard's config.yml == Citizens NPCs == If you are already using [[Citizens|Citizens NPCs]] you can also attach the "magic" or "command" trait for similar features to Magic NPCs. If you have been using Citizens NPCs with Magic traits, and would like to switch to using pure Magic NPCs, simply use the command <code>/mnpc import</code>. After you've verified it worked (there should be duplicates of all NPCs afterward) you should be able to shut down the server and remove Citizens. == Getting Started == Use the command <code>/mnpc add Spell Shop</code> to create a new Spell Shop NPC. By default it will be a villager. You can change that with <code>/mnpc type witch</code>. Magic mobs can be used as NPC templates, so disguises can be used if you have LibsDisguises, allowing you to make fake-player NPCs. == Casting Spells == You can make an NPC cast a spell on right-click using the shortcut <code>/mnpc cast spellshop</code>. You can also provide parameters, such as <code>/mnpc cast blink cooldown 0 pdy 10</code>, which will cast Blink straight up in the air with no cooldown. By default, the NPC will force the player clicking on the NPC to cast the spell. This works great for shops, but if you wanted to make a healing NPC you want the NPC to cast the spell on the player. This could be done as <pre class="">/mnpc cast heal /mnpc configure cast_source npc</pre> === Built-in Spells for NPC Use === The following spells are intended for NPC use: * '''upgrades''' - Provides a GUI for a player to check on their upgrade progress * '''spellshop''' - A wand-sensitive spell shop that can replace enchanting as a progression mechanism * '''magicitemshop''' - A shop to sell all of the magic items * '''engineershop''' - A shop to allow players to progress to Engineer * '''architectshop''' - A shop to allow players to progress to Architect * '''bookshop''' - A shop to give away spellbooks that describe available spells * '''broomshop''' - A shop to sell brooms * '''wandshop''' - A shop to sell a few example wands * '''tweakshop''' - A shop for wand "tweaks", which are free (inventory/chest mode, etc) * '''colorshop''' - A shop for selling custom wand colors and effects * '''mobshop''' - A shop with custom mob spawn eggs * '''withdrawals''' - An exchange shop for currency items * '''deposits''' - An exchange shop for currency items * '''ledgershop''' - A simple shop that sells the Ledger item * '''lootshop''' - A sell shop for mob loot * '''trinketshop''' - A shop with decorative player skulls * '''upgradeshop''' - A shop for selling wand upgrades (hotbar upgrades, anti-hunger) * '''fillwand''' - For rank-based servers, fills a player's wand with all of their spells * '''addspell''' - Can be used to give players a specific spell * '''enchantwand''' - Can be used as a replacement for the enchantment table * '''tpshop''' - Allow a random tp for $1 ==== NPC shop parameters ==== You can use /cast in-game with tab-completion to get an idea for available parameters. In particular, all of the shops support a common set of useful parameters: * '''confirm''' - Whether or not to show the confirmation screeen * '''path''' - A player must be on or past this enchanting path to use this shop * '''path_end''' - A player must have completed this enchanting path and be blocked on required spells * '''path_exact''' - A player must be on this exact path * '''auto_upgrade''' - Whether to advance the player to the next path once they meet the requirements * '''require_wand''' - Whether or not to require a wand, useful to prevent players from having spell and upgrade items === Examples === Some simple examples: <pre class=""># Set up an upgrades NPC /mnpc cast upgrades # Set up an NPC to give the player the blink spell in exchange for 30 dollars /mnpc cast addspell spell blink /mnpc costs 30 # Set up a spell shop /mnpc cast spellshop # Set up a random TP NPC /mnpc cast tpshop /mnpc configure helmet randomtp</pre> As with any spell, these spells can be customized or used as the basis for new spells via spells.yml. == Running Commands == An NPC can also be set to run a set of commands, such as <code>/mnpc configure commands time set day;weather clear</code> Command traits are similar to "magic" traits, but instead of a "spell" parameter they take a "command" parameter. === Command Trait Selectors === The following selectors can be used in a command: * '''@p''' The player's IGN * '''@pn''' The player's IGN (same as @p) * '''@pd''' The player's display name * '''@uuid''' The player's UUID * '''@world''' The world the player is in * '''@x''' The player's x coordinate * '''@y''' The player's y coordinate * '''@z''' The player's z coordinate === Examples === <pre class="">/mnpc configure command broadcast @p has clicked on an NPC at @world,@x,@y,@z</pre> === Player NPCs === Magic uses vanilla mobs for NPCs, as such it can not make players. However, if you have LibsDisguises you can make an NPC ''look'' like a player with the command <code>/mnpc player NathanWolf</code>
返回
Magic/NPC
。
导航菜单
个人工具
登录
命名空间
页面
讨论
大陆简体
查看
阅读
查看源代码
查看历史
更多
搜索
导航
首页
最近更改
随机页面
编辑相关
百科公告
编辑帮助
互助客栈
贡献分数
测试沙盒
发布条目
插件分类
管理
安全
聊天
编程
经济
修正
娱乐
综合
信息
机械
角色
传送
网页
整地
创世
付费
其它
工具
链入页面
相关更改
特殊页面
页面信息
相关网站
MCMOD百科
Minecraft中文百科
Minecraft纪念论坛
Minecraft百度贴吧
虚无世界Wiki