Jump to content

[1.12] [RESOLVED] Cannot bind coordinates to tile entity


That_Martin_Guy

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Just now, That_Martin_Guy said:

Why wouldn't it? It appends X, Y and Z depending on the coordinate to the key in both the setter and getter.

This line.

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

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.