Jump to content

[1.8] Spawning Primed TNT from a custom tile entity not working


SuperJedi224

Recommended Posts

I have this here code snippet in the update method for a custom tile entity:

 

if(flag&&rand.nextDouble()>0.8&worldObj.canSeeSky(pos.up())){
if(!worldObj.isRemote){
	System.out.println("TEST");
	EntityTNTPrimed f=new EntityTNTPrimed(this.worldObj);
	f.setVelocity(0,-3,0);
	f.fuse=120;
	f.setPosition(pos.getX()+rand.nextDouble()-0.5,250,pos.getX()+rand.nextDouble()-0.5);
	worldObj.spawnEntityInWorld(f);
}
}

 

(flag being a custom boolean field indicating if the block has ever detected a redstone signal since having been placed)

 

I know from reading the console output that this block of code is being executed, but the TNT entities are consistently refusing to spawn. Why is this?

Link to comment
Share on other sites

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.