• 欢迎来到Minecraft插件百科!
  • 对百科编辑一脸懵逼?帮助:快速入门带您快速熟悉百科编辑!
  • 因近日遭受攻击,百科现已限制编辑,有意编辑请加入插件百科企鹅群:223812289

Magic/NPC

来自Minecraft插件百科
跳转到导航 跳转到搜索

魔法NPC可用于对玩家施法,可以让玩家藉此检查法术进阶情况、购买法杖、物品、技能等等

同样可以用于右键时触发命令,就和魔法生物里的生物一样拥有触发器

WorldGuard

注意: 如果你想在WorldGuard的区域内使用NPC,需要在WorldGuard的config.yml中设置mobs.block-plugin-spawning: false

Citizens NPCs

如果你刚好在使用If you are already using 公民,你也可以将 "魔法" 或 "命令" 附到魔法NPC身上以实现类似的效果

如果你已经在使用Magic提供的Citizens NPCs,并且只想单纯地使用魔法NPC,仅需输入命令/mnpc import。在你检验完所有的NPC之后(后来NPC完全相同),关闭服务器并把Citizens插件删除

准备工作

使用命令 /mnpc add Spell Shop 以创建一个新的Spell Shop(法术商店) NPC。默认地,NPC是一个村民。你可以使用 /mnpc type witch

魔法生物可以被当作NPC样板使用,那么加装了LibsDisguises插件的话同样可以使用伪装,这样就可以做出一个假人NPC了

释放法术

你可以制作一个右键释放法术的NPC,仅需指令: /mnpc cast spellshop(译者注:由于Magic的商店一般都属于法术,而释放法术触发商店不失为一种选择)

同样可以给法术加参数,例如 /mnpc cast blink cooldown 0 pdy 10, 这样Blink法术在释放时会直接在空气中触发并且无需冷却

默认地,NPC会在被玩家点击时强制释放法术,这对于商店NPC来说很有用。但是如果你要做一个恢复玩家血量的NPC,可能就需要这样一些操作了:

/mnpc cast heal
/mnpc configure cast_source npc

译者注:首先给NPC绑定法术Heal【治疗】,之后设置此NPC施法源为NPC,因为部分治疗法术需要有一个发出点,如果不这样设置可能会导致治疗法术打在NPC自己身上

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:

# 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

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

/mnpc configure commands time set day;weather clear

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

/mnpc configure command broadcast @p has clicked on an NPC at @world,@x,@y,@z

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 /mnpc player NathanWolf