Lucky Block Documentation

Contents

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.

 

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.

type=effect,ID=special_fire,target=hitEntity,duration=10

The example will set the hit entity on fire for 10 seconds (refer to 2.6 Other).

 

Lucky Potion


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.

group(type=effect,ID=1,range=4,amplifier=2,duration=600;type=particle,ID=splashpotion,damage=8194; \
type=item,ID=#randList(cookie,sugar),posOffset=#circleOffset(0.0,2.0),amount=30)@luck=2

group(type=difficulty,ID=hard;type=explosion,damage=4;type=particle,ID=splashpotion,damage=8204)@luck=-2

The example will either give the player the ‘Speed’ effect, as well as cookies and sugar, or cause an explosion (2.6 Other).

 

Lucky Bow


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.

type=entity,ID=LuckyProjectile,pos=#bowPos,NBTTag=(Motion=#bowMotion,item=(id=iron_sword),damage=10.0)

The example shoot an 'iron sword' Lucky Projectile which will cause 10 hearts of damage.

 

Lucky Projectile


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"...])

  • item=(id=text) specifies the appearance of the projectile. The item can also be a block. Note that damage can also be added (item=(id=dye,damage=5)).
  • damage=integer) specifies the damage the projectile will cause on impact, by default being the same amount as an arrow.
  • trail=(frequency=float,drops=["drop","drop",...]) specifies the trail of the projectile, if desired. frequency specifies that the trail will occur once every X ticks (but can be set to less than 1 for even higher frequency). drops is a list of drops, in standard lucky block format, that can occur as a trail behind the projectile (Note: These drops should be kept very basic, e.g. particles).
  • drops=["drop","drop",...] is a list of drops, in standard lucky block format, that can occur on the projectile's impact.

type=entity,ID=LuckyProjectile,pos=#bowPos,NBTTag=(Motion=#bowMotion,item=(id=water_bucket),trail=(frequency=0.5,drops=["type=particle,ID=splash"]),impact=["type=block,ID=flowing_water"]

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