Jump to content

Recommended Posts

Posted

 

package gluszak.minecraft.pedowiewiur;

import java.util.Random;
import net.minecraft.src.Block;
import net.minecraft.src.EntityPlayer;
import net.minecraft.src.Material;
import net.minecraft.src.World;

public class BlockDuba extends GenericBlock{

    public BlockDuba(int id, int texture, Material material)
    {
        super(id, texture, material);
    }
    

   
    public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9)
    {
	par1World.playSound(par2, par3, par4, "step.grass", 100f, 0f);
	par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, 100);
    	return true;
    }
    
    
    
    public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random)
    {
	par1World.playSound(par2, par3, par4, "step.grass", 100f, 0f);
	System.out.println("asd");
    }
    
}

 

 

"asd" shows up but sound plays only once

Posted

Hey, you didn't understand me. I don't want to play the sound all the time but only twice: once when i click a block and again after some time. But it plays only when i click on the block and it should also play when "asd" shows up in the console.

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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