@Override
public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack)
{
for (int count = 0; count < 2; count++){
double X = player.posX;
double Y = player.posY;
double Z = player.posZ;
Random random = player.worldObj.rand;
for (int i = 0; i < 10; ++i)
{
int j1 = MathHelper.getRandomIntegerInRange(random, 0, 3);
if(j1 == 0){
player.worldObj.spawnParticle("reddust", (double)((float)X + random.nextFloat()), (double)Y - 1.5, (double)((float)Z + random.nextFloat()), 0, 0, 0);
}
if(j1 == 1){
player.worldObj.spawnParticle("reddust", (double)((float)X - random.nextFloat()), (double)Y - 1.5, (double)((float)Z + random.nextFloat()), 0, 0, 0);
}
if(j1 == 2){
player.worldObj.spawnParticle("reddust", (double)((float)X + random.nextFloat()), (double)Y - 1.5, (double)((float)Z - random.nextFloat()), 0, 0, 0);
}
if(j1 == 3){
player.worldObj.spawnParticle("reddust", (double)((float)X - random.nextFloat()), (double)Y - 1.5, (double)((float)Z - random.nextFloat()), 0, 0, 0);
}
}
}
}
Попробуй взлететь, мож они под тобой спаунятся(double)Y - 1.5
@SubscribeEvent
public void playerTickEvent(PlayerTickEvent event) {
if(event.player.getCurrentArmor(3) != null){
ItemStack helmet = event.player.getCurrentArmor(3);
if(helmet.getItem() == itemreg.items){
for (int count = 0; count < 2; count++){
double X = event.player.posX;
double Y = event.player.posY;
double Z = event.player.posZ;
Random random = event.player.getEntityWorld().rand;
for (int i = 0; i < 10; ++i)
{
int j1 = MathHelper.getRandomIntegerInRange(random, 0, 3);
if(j1 == 0){
event.player.getEntityWorld().spawnParticle("reddust", (double)((float)X + random.nextFloat()), (double)Y - 1.5, (double)((float)Z + random.nextFloat()), 0, 0.74901960784, 0.89803921568);
}
if(j1 == 1){
event.player.getEntityWorld().spawnParticle("reddust", (double)((float)X - random.nextFloat()), (double)Y - 1.5, (double)((float)Z + random.nextFloat()), 0, 0.74901960784, 0.89803921568);
}
if(j1 == 2){
event.player.getEntityWorld().spawnParticle("reddust", (double)((float)X + random.nextFloat()), (double)Y - 1.5, (double)((float)Z - random.nextFloat()), 0, 0.74901960784, 0.89803921568);
}
if(j1 == 3){
event.player.getEntityWorld().spawnParticle("reddust", (double)((float)X - random.nextFloat()), (double)Y - 1.5, (double)((float)Z - random.nextFloat()), 0, 0.74901960784, 0.89803921568);
}
}
}
}
}
}
}
public void spawnParticle(EnumParticleTypes particleType, boolean longDistance, double xCoord, double yCoord, double zCoord, int numberOfParticles, double xOffset, double yOffset, double zOffset, double particleSpeed, int... particleArguments)
{
SPacketParticles spacketparticles = new SPacketParticles(particleType, longDistance, (float)xCoord, (float)yCoord, (float)zCoord, (float)xOffset, (float)yOffset, (float)zOffset, (float)particleSpeed, numberOfParticles, particleArguments);
for (int i = 0; i < this.playerEntities.size(); ++i)
{
EntityPlayerMP entityplayermp = (EntityPlayerMP)this.playerEntities.get(i);
this.sendPacketWithinDistance(entityplayermp, longDistance, xCoord, yCoord, zCoord, spacketparticles);
}
}
там эта проверка не подходит, я только что проверил.!isRemote
Это видимо, стринг с именем частицы. На новых версиях додумались сделать под это енум)что такое
EnumParticleTypes