<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh-Hans-CN">
	<id>https://mineplugin.org/index.php?action=history&amp;feed=atom&amp;title=Magic%2FActions</id>
	<title>Magic/Actions - 版本历史</title>
	<link rel="self" type="application/atom+xml" href="https://mineplugin.org/index.php?action=history&amp;feed=atom&amp;title=Magic%2FActions"/>
	<link rel="alternate" type="text/html" href="https://mineplugin.org/index.php?title=Magic/Actions&amp;action=history"/>
	<updated>2026-04-06T22:36:38Z</updated>
	<subtitle>本wiki上该页面的版本历史</subtitle>
	<generator>MediaWiki 1.41.1</generator>
	<entry>
		<id>https://mineplugin.org/index.php?title=Magic/Actions&amp;diff=15872&amp;oldid=prev</id>
		<title>炫宙菌：​/* 行为系统 */</title>
		<link rel="alternate" type="text/html" href="https://mineplugin.org/index.php?title=Magic/Actions&amp;diff=15872&amp;oldid=prev"/>
		<updated>2021-08-21T01:23:10Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;行为系统&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;zh-Hans-CN&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;←上一版本&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;2021年8月21日 (六) 01:23的版本&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;第1行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第1行：&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== 行为系统 ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== 行为系统 ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Magic has a flexible &lt;/del&gt;&amp;amp;quot;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;action&lt;/del&gt;&amp;amp;quot; &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;system that lets you build your own spells&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;using the individual behaviors that the default spells employ.&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Magic有一个灵活的&lt;/ins&gt;&amp;amp;quot;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;action【行为】&lt;/ins&gt;&amp;amp;quot; &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;系统&lt;/ins&gt;,&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;你可以基于默认的法术构建自己独一无二的法术&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Most spells in Magic are made up of &lt;/del&gt;&amp;amp;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;quot;actions&lt;/del&gt;&amp;amp;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;quot;, rather than having a custom class for each spell&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;大部分法术如今都使用行为系统，不再使用先前的&lt;/ins&gt;&amp;amp;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;quotclass&lt;/ins&gt;&amp;amp;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;quot【类】系统&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Magic&#039;s action system intelligently load-balances given the number of mages actively casting spells. &lt;/del&gt;Magic will try to ensure that spells don&#039;t lag the server by modifying too many blocks or entities in a single tick.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;行为系统会根据施法者的施法量智能地平衡负载。 &lt;/ins&gt;Magic will try to ensure that spells don&#039;t lag the server by modifying too many blocks or entities in a single tick.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This means that any spell has the potential to get &amp;amp;quot;batched&amp;amp;quot; for delayed processing. This is not strictly speaking &amp;amp;quot;asynchronous&amp;amp;quot;, but it is the same general idea. If a spell requires too much &amp;amp;quot;work&amp;amp;quot; to complete in a single tick, it will spread out over multiple ticks.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This means that any spell has the potential to get &amp;amp;quot;batched&amp;amp;quot; for delayed processing. This is not strictly speaking &amp;amp;quot;asynchronous&amp;amp;quot;, but it is the same general idea. If a spell requires too much &amp;amp;quot;work&amp;amp;quot; to complete in a single tick, it will spread out over multiple ticks.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>炫宙菌</name></author>
	</entry>
	<entry>
		<id>https://mineplugin.org/index.php?title=Magic/Actions&amp;diff=15871&amp;oldid=prev</id>
		<title>炫宙菌：​/* Action System */</title>
		<link rel="alternate" type="text/html" href="https://mineplugin.org/index.php?title=Magic/Actions&amp;diff=15871&amp;oldid=prev"/>
		<updated>2021-08-21T01:11:19Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Action System&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;zh-Hans-CN&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;←上一版本&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;2021年8月21日 (六) 01:11的版本&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;第1行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第1行：&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Action System &lt;/del&gt;==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;行为系统 &lt;/ins&gt;==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Magic has a flexible &amp;amp;quot;action&amp;amp;quot; system that lets you build your own spells, using the individual behaviors that the default spells employ.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Magic has a flexible &amp;amp;quot;action&amp;amp;quot; system that lets you build your own spells, using the individual behaviors that the default spells employ.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>炫宙菌</name></author>
	</entry>
	<entry>
		<id>https://mineplugin.org/index.php?title=Magic/Actions&amp;diff=15591&amp;oldid=prev</id>
		<title>炫宙菌：​炫宙菌移动页面Actions至Magic/Actions</title>
		<link rel="alternate" type="text/html" href="https://mineplugin.org/index.php?title=Magic/Actions&amp;diff=15591&amp;oldid=prev"/>
		<updated>2021-07-30T13:02:32Z</updated>

		<summary type="html">&lt;p&gt;炫宙菌移动页面&lt;a href=&quot;/Actions&quot; class=&quot;mw-redirect&quot; title=&quot;Actions&quot;&gt;Actions&lt;/a&gt;至&lt;a href=&quot;/Magic/Actions&quot; title=&quot;Magic/Actions&quot;&gt;Magic/Actions&lt;/a&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;zh-Hans-CN&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;←上一版本&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;2021年7月30日 (五) 13:02的版本&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;zh-Hans-CN&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;（没有差异）&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>炫宙菌</name></author>
	</entry>
	<entry>
		<id>https://mineplugin.org/index.php?title=Magic/Actions&amp;diff=15590&amp;oldid=prev</id>
		<title>炫宙菌：​创建页面，内容为“== Action System ==  Magic has a flexible &amp;quot;action&amp;quot; system that lets you build your own spells, using the individual behaviors that the default spells emplo…”</title>
		<link rel="alternate" type="text/html" href="https://mineplugin.org/index.php?title=Magic/Actions&amp;diff=15590&amp;oldid=prev"/>
		<updated>2021-07-30T13:01:56Z</updated>

		<summary type="html">&lt;p&gt;创建页面，内容为“== Action System ==  Magic has a flexible &amp;quot;action&amp;quot; system that lets you build your own spells, using the individual behaviors that the default spells emplo…”&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新页面&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Action System ==&lt;br /&gt;
&lt;br /&gt;
Magic has a flexible &amp;amp;quot;action&amp;amp;quot; system that lets you build your own spells, using the individual behaviors that the default spells employ.&lt;br /&gt;
&lt;br /&gt;
Most spells in Magic are made up of &amp;amp;quot;actions&amp;amp;quot;, rather than having a custom class for each spell.&lt;br /&gt;
&lt;br /&gt;
Magic&amp;#039;s action system intelligently load-balances given the number of mages actively casting spells. Magic will try to ensure that spells don&amp;#039;t lag the server by modifying too many blocks or entities in a single tick.&lt;br /&gt;
&lt;br /&gt;
This means that any spell has the potential to get &amp;amp;quot;batched&amp;amp;quot; for delayed processing. This is not strictly speaking &amp;amp;quot;asynchronous&amp;amp;quot;, but it is the same general idea. If a spell requires too much &amp;amp;quot;work&amp;amp;quot; to complete in a single tick, it will spread out over multiple ticks.&lt;br /&gt;
&lt;br /&gt;
== Create your own spells ==&lt;br /&gt;
&lt;br /&gt;
The action system lets you build your own spells for some really cool custom behavior! Take a look through the [https://github.com/elBukkit/MagicPlugin/blob/master/Magic/src/main/resources/examples/survival/spells/ survival spell configurations] to get a feel for what&amp;#039;s possible. In particular, there are a few spells (laser, singularity, magichat) that are documented pretty well, I&amp;#039;m hoping to do better with that in the future.&lt;br /&gt;
&lt;br /&gt;
=== Built in Actions ===&lt;br /&gt;
&lt;br /&gt;
Please check out the [http://mine.elmakers.com/reference/#actions Reference Manual] for a list of all builtin spell actions and their parameters!&lt;br /&gt;
&lt;br /&gt;
== Create your own actions ==&lt;br /&gt;
&lt;br /&gt;
If you can&amp;#039;t seem to get the effect you want, and have a bit of Java/Bukkit experience, it&amp;#039;s pretty each to code up some new SpellAction classes. This is now the preferred method to extend Magic, rather than creating a new Spell class.&lt;br /&gt;
&lt;br /&gt;
This will let you mix your custom actions in with the builtin actions!&lt;br /&gt;
&lt;br /&gt;
All you need to do is to implement the [https://github.com/elBukkit/MagicPlugin/blob/master/MagicAPI/src/main/java/com/elmakers/mine/bukkit/api/action/SpellAction.java SpellAction] interface found in MagicAPI. Alternately, you can extend [http://jenkins.elmakers.com/job/MagicLib/doxygen/classcom_1_1elmakers_1_1mine_1_1bukkit_1_1action_1_1_base_spell_action.html BaseSpellAction] in MagicLib, which takes care of some of the boilerplate code for you.&lt;br /&gt;
&lt;br /&gt;
If using BaseSpellAction (which I would recommend), you will need to build against the Magic plugin itself, not the API. The plugin is not available in the Central Maven repo, so you will have to add the elMakers repo:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;&amp;quot;&amp;gt;    &amp;amp;lt;repositories&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;repository&amp;amp;gt;&lt;br /&gt;
            &amp;amp;lt;id&amp;amp;gt;elMakers&amp;amp;lt;/id&amp;amp;gt;&lt;br /&gt;
            &amp;amp;lt;url&amp;amp;gt;http://maven.elmakers.com/repository/&amp;amp;lt;/url&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;/repository&amp;amp;gt;&lt;br /&gt;
    &amp;amp;lt;/repositories&amp;amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then you would add Magic as a dependency like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;amp;lt;dependencies&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;dependency&amp;amp;gt;&lt;br /&gt;
            &amp;amp;lt;groupId&amp;amp;gt;com.elmakers.mine.bukkit.plugins&amp;amp;lt;/groupId&amp;amp;gt;&lt;br /&gt;
            &amp;amp;lt;artifactId&amp;amp;gt;Magic&amp;amp;lt;/artifactId&amp;amp;gt;&lt;br /&gt;
            &amp;amp;lt;version&amp;amp;gt;8.3&amp;amp;lt;/version&amp;amp;gt;&lt;br /&gt;
            &amp;amp;lt;scope&amp;amp;gt;provided&amp;amp;lt;/scope&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;/dependency&amp;amp;gt;&lt;br /&gt;
   &amp;amp;lt;/dependencies&amp;amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Action anatomy ===&lt;br /&gt;
&lt;br /&gt;
Actions have a few important methods that get called at certain times. It is important, especially for performance, to know what to do and when.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;initialize&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
This method is called whenever a spell is loaded for the first time. It is only called once per player per server session, and is given the action&amp;#039;s parameters. Spells rarely use this, though in cases where you have a big list of things in your parameters or spell config it may be more efficient to pre-parse it here.&lt;br /&gt;
&lt;br /&gt;
Any parameters read inside of initialize() cannot be overridden by /cast or /wand override.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;prepare&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
This is called at the beginning of a spell cast, giving the action the current CastContext and parameters. This is generally when you&amp;#039;ll want to read your parameters into class variables.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;reset&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
This is called at the beginning of one &amp;amp;quot;iteration&amp;amp;quot; of a spell cast. This is generally only used by CompoundAction classes, to reset their counter to the beginning of their action list. It is rare you&amp;#039;ll need to override this.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;perform&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
This is the main body of your action, where you will do your work. This may be called many, many times during a spell cast, so try and keep things efficient.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;finish&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
This is called for each action after the entire spell cast is complete, and is a good place to perform and cleanup or final actions.&lt;br /&gt;
&lt;br /&gt;
=== Cast Context and Parameters ===&lt;br /&gt;
&lt;br /&gt;
Most spells only need to override &amp;amp;quot;prepare&amp;amp;quot; and &amp;amp;quot;perform&amp;amp;quot;. The &amp;amp;quot;prepare&amp;amp;quot; method is passed a ConfigurationSection, which can be used to read in the action&amp;#039;s parameters.&lt;br /&gt;
&lt;br /&gt;
Both &amp;amp;quot;prepare&amp;amp;quot; and &amp;amp;quot;perform&amp;amp;quot; are passed a [http://jenkins.elmakers.com/job/MagicAPI/doxygen/interfacecom_1_1elmakers_1_1mine_1_1bukkit_1_1api_1_1action_1_1_cast_context.html CastContext] object. This object is how you interact with all of the core Magic functionality- such as the undo system. Methods are constantly added to CastContext as needed by the builtin actions, so there is quite a bit there you can make use of.&lt;br /&gt;
&lt;br /&gt;
== Action Flow ==&lt;br /&gt;
&lt;br /&gt;
Normally actions in a spell are processed &amp;amp;quot;serially&amp;amp;quot;- that is, one at a time, in a row.&lt;br /&gt;
&lt;br /&gt;
If an action takes some time to complete (Delay action, in-flight Projectile, etc) the spell will sit and wait on that action until it completes.&lt;br /&gt;
&lt;br /&gt;
Sometimes you&amp;#039;d like more than one thing to happen at a time in a spell.&amp;lt;br /&amp;gt;&lt;br /&gt;
There are a few different actions that can do that:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Multiply&amp;#039;&amp;#039;&amp;#039;: Kind of like &amp;amp;quot;Repeat&amp;amp;quot; except all of the &amp;amp;quot;cloned&amp;amp;quot; actions run at the same time (in parallel) instead of one after another (in serial)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Parallel&amp;#039;&amp;#039;&amp;#039;: Runs all of the actions in its &amp;amp;quot;actions&amp;amp;quot; list separately, in parallel&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Asynchronous&amp;#039;&amp;#039;&amp;#039;: Runs its actions list as normal (serially, one after another) except it does this in parallel with the rest of the spell- so an Asynchronous action always completely immediately, no matter how longer the actions inside it really take&lt;br /&gt;
&lt;br /&gt;
Then there is this kind of odd case of the &amp;#039;&amp;#039;&amp;#039;Serial&amp;#039;&amp;#039;&amp;#039; action- this is basically just used to group actions together. Mainly this is used in &amp;amp;quot;Parallel&amp;amp;quot;, since that one takes each action in its list as a separate &amp;amp;quot;thread&amp;amp;quot; to run, Serial may be used to group several actions together that you want to run one after another in parallel with other actions.&lt;br /&gt;
&lt;br /&gt;
To try and tie all that together with an example- what does the [https://github.com/elBukkit/MagicPlugin/blob/master/Magic/src/main/resources/examples/survival/spells/chainlightning.yml Chain Lightning] spell do?&lt;br /&gt;
&lt;br /&gt;
It launches a projectile, when that projectile hits it does an AreaOfEffect.&lt;br /&gt;
&lt;br /&gt;
AOE will run actions for each target in a radius, but we want to spawn a new projectile towards each of those targets. &lt;br /&gt;
&lt;br /&gt;
However, we want them to all fly at once, rather than one firing, waiting for hit, then another firing, etc.&lt;br /&gt;
&lt;br /&gt;
That is what the Asynchronous action does, it makes all of the chained projectiles fly at once.&lt;br /&gt;
&lt;br /&gt;
Similarly [https://github.com/elBukkit/MagicPlugin/blob/master/Magic/src/main/resources/examples/survival/spells/meteor.yml Meteor Shower] uses Multiply to launch several meteors at once.&lt;/div&gt;</summary>
		<author><name>炫宙菌</name></author>
	</entry>
</feed>