Confirmedusers, editor, Administrators
886
edits
No edit summary |
CreativeMD (talk | contribs) |
||
Line 30: | Line 30: | ||
<syntaxhighlight lang="c#"> | <syntaxhighlight lang="c#"> | ||
public override bool | public override bool OnHeldInteractStart(IItemSlot slot, IEntityAgent byEntity, BlockSelection blockSel, EntitySelection entitySel) | ||
{ | { | ||
return true; | return true; | ||
Line 36: | Line 36: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
The method <code> | The method <code>OnHeldInteractStep</code> allows us to spawn particles per tick while the player is using the item, but it would be better to implement an animation first. Particles should spawn after the animation is done ... | ||
<syntaxhighlight lang="c#"> | <syntaxhighlight lang="c#"> | ||
public override bool | public override bool OnHeldInteractStep(float secondsUsed, IItemSlot slot, IEntityAgent byEntity, BlockSelection blockSel, EntitySelection entitySel) | ||
{ | { | ||
if (byEntity.World is IClientWorldAccessor) | if (byEntity.World is IClientWorldAccessor) | ||
Line 112: | Line 112: | ||
<syntaxhighlight lang="c#"> | <syntaxhighlight lang="c#"> | ||
public override bool | public override bool OnHeldInteractStep(float secondsUsed, IItemSlot slot, IEntityAgent byEntity, BlockSelection blockSel, EntitySelection entitySel) | ||
{ | { | ||
if (byEntity.World is IClientWorldAccessor) | if (byEntity.World is IClientWorldAccessor) |