6.4 Lucky Items
6.4 Lucky Items
Lucky Items currently include the Lucky Sword, Bow and Potion. These items are configured in a very similar way to the Lucky Block, but are designed to perform functions which would normally be associated with each respective item. The files for configuring these items are ‘lucky_sword.txt’, ‘lucky_bow.txt’ and ‘lucky_potion.txt’. Additionally, each of these items uses the same NBT Tag to specify luck level and a custom list of drops, similarly to the Lucky Block (Note that the Lucky Potion uses this NBT Tag both as an item and entity).
NBT Tag Format: NBTTag=(Luck=integer,Drops>=["drop","drop"...]), which normally
Finally note that the hash variable #bPos (3.2 Has Variables), which is normally used to retrieve the position the Lucky Block was harvested at, can be used to retrieve the position that any drop occurs at (i.e Lucky Sword hit entity position, Lucky Potion ground/entity impact position, Lucky Bow shoot position, Lucky Projectile trail/impact position). #pPos is always used for the position of the player who used the lucky item, and #ePos can be used for the position of the entity hit by the Lucky Sword.
The Lucky Sword will always cause damage to entities, regardless of its additional effects, and is as powerful as an iron sword, with a duration twice that of a diamond sword. Every time an entity is hit with the sword, an additional effect is processed from ‘lucky_sword.txt’. It is recommended that the sword should only occasionally perform an additional effect, which can be specified in the file by adding a frequently occurring drop of type ‘nothing’ (type=nothing@luck=0@chance=20). Also, the majority of the drops should be positive with @luck=2, and the ‘nothing’ drop should have the lowest luck. Then, when the luck of the sword is increased/decreased through crafting, the frequency of additional effects will be increased/decreased. Below is an example.
The example will set the hit entity on fire for 10 seconds (refer to 2.6 Other).
The Lucky Potion, unlike the other items, should perform a drop every time. Its drops should often make use of Minecraft potion effects. Also, there should be the same amount of positive and negative drops, each having a luck level of ‘2’ or ‘-2’. Therefore, a Lucky Potion with positive luck will almost always perform positive effects, and vice versa. Finally, it is essential that a potion contain the effect type=particle,ID=splashpotion,damage=… (damage a potion item ID value) which will cause the potion to play a breaking animation on impact. Below is an example.
The example will either give the player the ‘Speed’ effect, as well as cookies and sugar, or cause an explosion (2.6 Other).
The Lucky Bow, similarly to the Lucky Sword, should only occasionally perform special effects, and should shoot a normal arrow most of the time (type=entity,ID=Arrow,pos=#bowPos,NBTTag=(Motion=#bowMotion)@luck=0@chance=20). Almost all special effects, however, should be ‘Lucky Projectiles’, explained in detail below. Also, as with the sword, the majority of the drops should be positive with @luck=2, and the normal arrow drop should have the lowest luck. Finally, all projectiles should contain Motion=#bowMotion in their NBT Tag to give them the appropriate motion. Below is an example.
The example shoot an 'iron sword' Lucky Projectile which will cause 10 hearts of damage.
The Lucky Projectile is a custom entity with a custom appearance with performs lucky block drops on impact. The entity also can have a custom ‘trail’ effects, also specified as lucky block drops. It is mainly used by the Lucky Bow.
NBT Tag Format: NBTTag=(item=(id=text),damage=integer,trail=(frequency=float,drops=["drop","drop",...]),impact=["drop","drop"...])
This Lucky Projectile, shot from a Lucky Bow, will appear as water bucket with a splash particle trail, and will place a block of flowing water on impact.Back
Copyright Minecraft Ascending 2015