Jump to content

Recommended Posts

Posted (edited)

Let me see if I read this correctly:

 

ItemNBTHelper.getBlockPos(usedMicrophone, "BoxPos").equals(BlockPos.ORIGIN)

 

If the microphone is brand new, then its BoxPos will be the origin, yes?

 

Ok, so I go to link it, I get the current linkage, it is to the ORIGIN, that returns (!(origin)) which is false, and I dump into the else statement:

 

player.sendMessage(new TextComponentString("You have no source bound to the microphone"));

Edited by Draco18s

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted (edited)
1 hour ago, That_Martin_Guy said:

I want to be able to bind a microphone to a box, then use it on a stand which has a tile entity which stores the boxes position. I can't seem to bind it to the box, though, since it always says "You have no source bound to the microphone".

 

Microphone

Stand I want to place the mic on

ItemNBTHelper.getBlockPos(usedMicrophone, "BoxPos")

Will always return BlockPos.ORIGIN because when you call ItemNBTHelper.setBlockPos it doesn't set a tag with the key you send it, and if you look at ItemNBTHelper.getBlockPos it checks for that key.

 

Also Draco is right what if they wanted to put it at the ORIGIN?

Edited by Animefan8888

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Posted
Just now, diesieben07 said:

I don't think you can place a block at 0,0,0. Or maybe you can, but it's not very useful.

It depends on what the box does exactly. This could be used for building a map. Then again I don't know exactly what this box will do.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Posted
16 minutes ago, diesieben07 said:

I don't think you can place a block at 0,0,0. Or maybe you can, but it's not very useful.

0,0,0 should be bedrock in the overworld, the nether, and similar dimensions. For other dimensions (without a bedrock floor) it's possible although unlikely to be able to place a block there.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted
2 minutes ago, That_Martin_Guy said:

Why would that make a difference? That instance is the same as the itemstacks instance.

I was taking a shot in the dark...where are you appending that "X" at?

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Posted
Just now, Animefan8888 said:

I was taking a shot in the dark...where are you appending that "X" at?

 

13 minutes ago, That_Martin_Guy said:

Appending X to the key in the if statement doesn't seem to change anything. 

 

Posted
3 minutes ago, That_Martin_Guy said:

Appending X to the key in the if statement doesn't seem to change anything. 

Sorry I miss the small details a lot, have you tried stepping through it with the debugger because it is not popping out at me.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Posted (edited)
10 minutes ago, That_Martin_Guy said:

I think I have found the problem, or atleast something related to the problem. onItemUse isn't called when right clicked on a quiz box. Say, what does the return of onBlockActivated do?

If it returns true it believes you did something and the onItemRighClick/onItemUse shouldn't be called.

 

Edit: It also tells the client to play the animation of the player moving their hand when true is returned.

Edited by Animefan8888

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Posted

Ah, there is the problem! I had made BlockQuizBox return true on onBlockActivated if it had a tile entity in it, which it should always have. Therefore it made it not call onItemRightClick, which in turn made it not bind the microphone to the block. Thank you!

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.