世
【マイクラ】にゃんこ大戦争は、人気のモバイルゲーム「にゃんこ大戦争」をモチーフにした、マインクラフトのMODです。このMODでは、マインクラフトの世界に「にゃんこ」と呼ばれる可愛らしい猫たちが登場し、プレイヤーと一緒に冒険をすることができます。
このMODには、にゃんこたちを倒すための強力なボスが登場する機能があります。それが「にゃんこ大戦争のボス」です。このボスは、通常のにゃんこよりもずっと強力で、プレイヤーにとっては大きな挑戦となります。
では、具体的にマイクラでにゃんこ大戦争のボスを作る方法を見てみましょう。
まず、マイクラのバージョンを「1.8」に設定し、「Forge」をインストールします。次に、MODフォルダー内に「Catsmod」フォルダーを作成し、その中に「Mob」フォルダーを作ります。その中に「Japanese_Cat」フォルダーを作成し、その中に「Entity」という名前のテキストファイルを作成します。
そのテキストファイルの中に、以下のようなコードを入力します。
package catsmod.entity;
import catsmod.init.CatsSoundEvents;
import net.minecraft.entity.boss.EntityWither;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.MobEffects;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.DamageSource;
import net.minecraft.world.World;
public class EntityJapaneseCat extends EntityWither {
public EntityJapaneseCat(World worldIn) {
super(worldIn);
this.setSize(2.0F, 5.0F);
}
@Override
public void onLivingUpdate() {
super.onLivingUpdate();
checkForOwner();
lashriests();
}
private void lashriests() {
if(!this.world.isRemote) {
if(this.ticksExisted % 4 == 0) {
this.world.playSound((EntityPlayer)null, this.posX, this.posY, this.posZ, CatsSoundEvents.JAPANESE_LAUGH, this.getSoundCategory(), 1.0F, 1.0F);
}
if(this.rand.nextInt(200) == 0) {
EntityCatRaishi entity = new EntityCatRaishi(this.world);
entity.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, 0.0F);
this.world.spawnEntityInWorld(entity);
}
int count = this.world.countEntities(EntityCatRaishi.class);
if(count > 25) {
count = 25;
}
if(this.rand.nextInt(1000) < count * 50 && this.rand.nextInt(300) == 0) {
double dX = this.posX + (this.rand.nextBoolean() ? 8 : -8);
double dY = this.posY + 8 + this.rand.nextDouble() * 2;
double dZ = this.posZ + (this.rand.nextBoolean() ? 8 : -8);
this.world.createExplosion(this, dX, dY, dZ, 12.0F, true);
}
}
public boolean attackEntityFrom(DamageSource source, float amount) {
if(source.getEntity() instanceof EntityPlayer) {
addPotionEffect(new PotionEffect(MobEffects.poison, 200, 0));
addPotionEffect(new PotionEffect(MobEffects.blindness, 200, 0));
}
return super.attackEntityFrom(source, amount);
}
}
ここで重要なのは「親の猫」を設定することです。親の猫は、プレイヤーがボスを倒すために必要なアイテムを持っています。その親の猫が死んだ時にドロップすることになるので、設定を忘れないようにしてください。
上記のコードを入力したら、このファイルを「EntityJapaneseCat.java」などの名前で保存します。
次に、「Entity」フォルダーの中に新しいテキストファイルを作り、それに「CatAgent」という名前を付け、「たくさんの猫」という設定を入力します。
package catsmod.entity;
import net.minecraft.world.World;
public class CatAgent extends CatCreeper // CatCreeperは手に入れるのが最大限ハードル?(というか難しい)
{
public CatAgent(World worldIn)
{
super(worldIn);
this.setSize(3.3F,5.0F);
}
上記のコードを入力してファイルを保存します。
最後に、「Catsmod」フォルダーの中に「resourcepacks」というフォルダーを作り、その中に「Catsmod」フォルダーを作ります。その中に「lang」というフォルダーを作り、その中に「ja_JP.lang」という名前のテキストファイルを作ります。
次に、「ja_JP.lang」の中に、「レシピ名」や「砂利」「エンダードラゴン」などの日本語での名前を入力します。
このように、ファイルを作成した後、必要な設定を入力することで、にゃんこ大戦争のボスをマインクラフトで作ることができます。プレイヤーは、このボスとの戦いで挑戦を楽しみ、にゃんこ大戦争の世界を満喫することができます。