私は1.7.10でこれを持っていましたが、エラーはありませんでした.1.8でworld.setblockを削除するまで
@Override
public ItemStack onItemRightClick(ItemStack itemStack, World world,
EntityPlayer entityPlayer) {
if(entityPlayer.capabilities.isCreativeMode||entityPlayer.inventory.consumeInventoryItem(Items.sugar))
{
//play sound stuff com.example.examplemod.SoundHandler.onEntityPlay("fizz", Event.player.worldObj, Event.player, 1, 1);
if (!world.isClient)
{
Vec3 look = entityPlayer.getLookVec();
world.setBlock((int) (entityPlayer.posX + look.xCoord * 5),
(int) (entityPlayer.posY + look.yCoord * 5),
(int) (entityPlayer.posZ + look.zCoord * 5),
Block.getBlockById(79));
}
}
return itemStack;
}
さて、プレイヤーが向いている方向に 1.8 でブロックを設定するにはどうすればよいですか。また、ブロックが邪魔になっている場合は、パックされた氷に置き換えます。また、左クリックがクリックされるたびにサウンドを再生するにはどうすればよいですか