Jump to content

Wekio

Members
  • Posts

    4
  • Joined

  • Last visited

Everything posted by Wekio

  1. Thank you, that is very helpful! All my sound issues are solved!
  2. Alright... I'm fairly new to the modding community but I need some help with something... I was able to make a custom ender pearl, which is supposed to play a sound to all entities near the impact upon colliding with either a block or a player. Now, it does play the sound; that isn't my issue. The problem is if I teleport too far with my custom pearl, the sound doesn't play at all. I tested with a LAN world, but it didn't even play for the second player. I tested the distance at which the sound would cut out, and it turned out to be 17 blocks. My Ender Pearl's code is quite similar to that of the in-game ender pearl, but I will copy paste some of the code anyways. The class is extending entityEnderPearl, so feel free to check that class out if you need any more. This is the section that triggers on the projectiles impact. I am aware that the line where the sound gets trigger is below where the section where the particles are triggered, but I have moved this line of code around and it doesn't make a difference. [embed=425,349]@Override protected void onImpact(MovingObjectPosition p_70184_1_) { if (p_70184_1_.entityHit != null) { p_70184_1_.entityHit.setFire(10);; } for (int i = 0; i < 32; ++i) { this.worldObj.spawnParticle("lava", this.posX, this.posY + this.rand.nextDouble() * 2.0D, this.posZ, this.rand.nextGaussian(), 0.0D, this.rand.nextGaussian()); } if (!this.worldObj.isRemote) { if (this.getThrower() != null && this.getThrower() instanceof EntityPlayerMP) { EntityPlayerMP entityplayermp = (EntityPlayerMP)this.getThrower(); if (entityplayermp.playerNetServerHandler.func_147362_b().isChannelOpen() && entityplayermp.worldObj == this.worldObj) { EnderTeleportEvent event = new EnderTeleportEvent(entityplayermp, this.posX, this.posY, this.posZ, 5.0F); this.worldObj.playSoundEffect(posX, posY, posX, "MyMod:teleportfwoop", 0.75F, 0.95F); if (!MinecraftForge.EVENT_BUS.post(event)) { // Don't indent to lower patch size if (this.getThrower().isRiding()) { this.getThrower().mountEntity((Entity)null); } this.getThrower().setPositionAndUpdate(event.targetX, event.targetY, event.targetZ); this.getThrower().fallDistance = 0.0F; } } } this.setDead(); } }[/embed] If anyone could help with this, or tell me a better way to call the sound, please let me know. -Wekio
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.