当前位置: 首页>>代码示例>>Java>>正文


Java Items.baked_potato方法代码示例

本文整理汇总了Java中net.minecraft.init.Items.baked_potato方法的典型用法代码示例。如果您正苦于以下问题:Java Items.baked_potato方法的具体用法?Java Items.baked_potato怎么用?Java Items.baked_potato使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.init.Items的用法示例。


在下文中一共展示了Items.baked_potato方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onImpact

import net.minecraft.init.Items; //导入方法依赖的package包/类
@Override
public void onImpact(MovingObjectPosition target) 
{
	if (target.entityHit != null) 
   	{
   		// Damage
   		target.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.shootingEntity), (float) this.damage);
       }
       else 
       {        	
       	// Glass breaking
           Helper.tryBlockBreak(this.worldObj, this, target, 1);
           
       	if (this.shouldDrop && this.canBePickedUp)	// If we can be picked up then we're dropping now
       	{
        	ItemStack nuggetStack = new ItemStack(Items.baked_potato);
        	EntityItem entityitem = new EntityItem(this.worldObj, target.blockX, target.blockY + 0.5d, target.blockZ, nuggetStack);
            entityitem.delayBeforeCanPickup = 10;
            
            if (captureDrops) { capturedDrops.add(entityitem); }
            else { this.worldObj.spawnEntityInWorld(entityitem); }
       	}
       }
   	
   	// SFX
	NetHelper.sendParticleMessageToAllPlayers(this.worldObj, this.getEntityId(), (byte) 3, (byte) 2);
       this.worldObj.playSoundAtEntity(this, "random.eat", 0.6F, 0.7F);
       
       this.setDead();		// We've hit something, so begone with the projectile
}
 
开发者ID:Domochevsky,项目名称:minecraft-quiverbow,代码行数:31,代码来源:PotatoShot.java


注:本文中的net.minecraft.init.Items.baked_potato方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。