<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://forge.gemwire.uk/index.php?action=history&amp;feed=atom&amp;title=Mob_Effects%2F1.17</id>
	<title>Mob Effects/1.17 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://forge.gemwire.uk/index.php?action=history&amp;feed=atom&amp;title=Mob_Effects%2F1.17"/>
	<link rel="alternate" type="text/html" href="https://forge.gemwire.uk/index.php?title=Mob_Effects/1.17&amp;action=history"/>
	<updated>2026-05-01T18:30:05Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.0</generator>
	<entry>
		<id>https://forge.gemwire.uk/index.php?title=Mob_Effects/1.17&amp;diff=3038&amp;oldid=prev</id>
		<title>ShrimpBot: Copy Mob Effects to MC1.17 archive</title>
		<link rel="alternate" type="text/html" href="https://forge.gemwire.uk/index.php?title=Mob_Effects/1.17&amp;diff=3038&amp;oldid=prev"/>
		<updated>2021-12-06T05:50:55Z</updated>

		<summary type="html">&lt;p&gt;Copy &lt;a href=&quot;/wiki/Mob_Effects&quot; title=&quot;Mob Effects&quot;&gt;Mob Effects&lt;/a&gt; to MC1.17 archive&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;A &amp;lt;code&amp;gt;MobEffect&amp;lt;/code&amp;gt; is what handles the specific logic on the entity it is on. For example, &amp;lt;code&amp;gt;MobEffects#MOVEMENT_SPEED&amp;lt;/code&amp;gt; adds an attribute modifier that affects the movement speed while &amp;lt;code&amp;gt;MobEffects#WITHER&amp;lt;/code&amp;gt; attacks the entity from a &amp;lt;code&amp;gt;DamageSource&amp;lt;/code&amp;gt; whenever the mob effect is ready to be applied.&lt;br /&gt;
&lt;br /&gt;
== Creating a &amp;lt;code&amp;gt;MobEffect&amp;lt;/code&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
You can create a &amp;lt;code&amp;gt;MobEffect&amp;lt;/code&amp;gt; using two methods. The first creates a regular &amp;lt;code&amp;gt;MobEffect&amp;lt;/code&amp;gt; and applies the logic in some event method. The other method involves extending the &amp;lt;code&amp;gt;MobEffect&amp;lt;/code&amp;gt; class and overriding specific methods when needed. This documentation will focus on the second method.&lt;br /&gt;
&lt;br /&gt;
There are four methods that are important depending on the type of mob effect you are creating. In each scenario, you should take into account whether you should extend &amp;lt;code&amp;gt;MobEffect&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;InstantenousMobEffect&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Here are the classes and methods to review:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=1&lt;br /&gt;
!Class !!Usage &lt;br /&gt;
|-&lt;br /&gt;
|   &amp;lt;code&amp;gt;MobEffect&amp;lt;/code&amp;gt;   ||  The basic mob effect class. Should be used if the mob effect happens over time. &lt;br /&gt;
|-&lt;br /&gt;
|   &amp;lt;code&amp;gt;InstantenousMobEffect&amp;lt;/code&amp;gt;   ||  An extended version of the mob effect class. Should be used if the mob effect happens only once and instantly. &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=1&lt;br /&gt;
!Method !!Description &lt;br /&gt;
|-&lt;br /&gt;
|   &amp;lt;code&amp;gt;isDurationEffectTick&amp;lt;/code&amp;gt;   ||  Determines how fast a mob effect should call &amp;lt;code&amp;gt;applyEffectTick&amp;lt;/code&amp;gt; while applied. This is overridden by &amp;lt;code&amp;gt;InstantenousMobEffect&amp;lt;/code&amp;gt; to occur after one tick. If too fast, the server will not have enough time to execute the damage on the entity. &lt;br /&gt;
|-&lt;br /&gt;
|   &amp;lt;code&amp;gt;applyEffectTick&amp;lt;/code&amp;gt;   ||  Executes the logic on the entity when called. &lt;br /&gt;
|-&lt;br /&gt;
|   &amp;lt;code&amp;gt;isInstantenous&amp;lt;/code&amp;gt;   ||  Determines if the mob effect is instant. Returns true in &amp;lt;code&amp;gt;InstantenousMobEffect&amp;lt;/code&amp;gt;. &lt;br /&gt;
|-&lt;br /&gt;
|   &amp;lt;code&amp;gt;applyInstantenousEffect&amp;lt;/code&amp;gt;   ||  Executes the logic on the entity when called. &amp;lt;code&amp;gt;isInstantenous&amp;lt;/code&amp;gt; must return true for this to be called. &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If you are only modifying an entity &amp;lt;code&amp;gt;Attribute&amp;lt;/code&amp;gt;, then there is no need to extend the class. When constructing the mob effect instance, chain &amp;lt;code&amp;gt;addAttributeModifier&amp;lt;/code&amp;gt; and select the specific attribute, it's unique id, the amount to affect by, and the operation to apply the amount with.&lt;br /&gt;
&lt;br /&gt;
Mob Effects need to be [[Registration/1.17|registered]].&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;code&amp;gt;MobEffectInstance&amp;lt;/code&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
To allow greater customization, each mob effect is passed in as a &amp;lt;code&amp;gt;MobEffectInstance&amp;lt;/code&amp;gt; which allows the user to specify additional information for what the mob effect should do.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Game Effects/1.17|Category:Game Effects]]&lt;/div&gt;</summary>
		<author><name>ShrimpBot</name></author>
	</entry>
</feed>