-XYZ not an option?

Started by AOCAWOL on

Topic category: Feature requests and ideas for MCreator

Joined Oct 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
-XYZ not an option?
Sat, 05/04/2019 - 21:53 (edited)

Hi! So when trying to make crops I ran into a problem where if the crop is placed with a -x & -y it has to be placed with different variables. However when in the procedures I'm trying to do "Get Block x y z" u can't make those values negative.. so I can't tell the system to the check if block is at a -XYZ and it's kinda ruining the crops..

Edited by AOCAWOL on Sat, 05/04/2019 - 21:53
Joined Aug 2013
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Just multiply the value by …
Sun, 05/05/2019 - 01:52

Just multiply the value by -1:

X*(-1)=-X
Y*(-1)=-Y
Z*(-1)=-Z

However, I am not sure why would you ever want to check for a block with negative Y as that is.... you know... out of the world.

You most likely want to get…
Sun, 05/05/2019 - 12:35

You most likely want to get values like x - 1, not - x. To do this, just use procedure math blocks.

You might want to check these tutorials, especially the ones related to procedures: https://www.youtube.com/playlist?list=PLAeL-oIFIEngE6jRgFYeFMfuj8WQsO3Ei

Joined Oct 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
But the "Check x y z block"…
Sun, 05/05/2019 - 16:48

But the "Check x y z block" won't let me insert math procedures such as "X < 1" meaning if the block check is at an X value less that 1.  Same goes with Z or Y I understand for Y it wouldn't make much sense but X & Z should be able to have these functions?

Joined Aug 2013
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Ok, can you exactly describe…
Sun, 05/05/2019 - 17:02

Ok, can you exactly describe what are you trying to do? "X < 1" can logically give you only true and false and coordinate has to be a number so that is why you can not do it. 

AOCAWOL, you can't do it…
Mon, 05/06/2019 - 15:40

AOCAWOL, you can't do it this way. To check for a block at coordinates say x, y, z where x is x-1, just replace the block x with math block and do it like this x - 1. If this is what you want. You might want to tell us what exactly you want to achieve and we can direct you in the right way.

Joined Oct 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
So here is the procedure I'm…
Tue, 05/07/2019 - 03:30

So here is the procedure I'm using

https://i.imgur.com/B9eqwPP.png

then here are the results, each image is when I try to place the crop in that XYZ coordinate (note: I'm right click on the farm block directly below me and it places it in the said spot instead)

https://i.imgur.com/E4AQPFi.png

From here we can see that normal positive XYZ places it just right on top like how it should be. 

https://i.imgur.com/xTvqBlG.png

however, with this, we can see that when in a negative X & Z it places the crop in that position

https://i.imgur.com/zJGvHLU.png

then when in a negative Z it places it in that area

https://i.imgur.com/QzUwcWh.png

and lastly, it places like this when in a negative X

 

Joined Oct 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
NOTE: the procedure I use…
Tue, 05/07/2019 - 03:31

NOTE: the procedure I use shows blueberries however its the same for the strawberries so they use the same procedure

Joined Oct 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
When you right click the…
Tue, 05/07/2019 - 13:28

When you right click the Strawberry (item)/blueberries(item) /Rudo seeds (item)

It performs this procedure.

Joined Aug 2013
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I have recreated the…
Tue, 05/07/2019 - 14:20

I have recreated the procedure in my workspace and it works just fine. Also, do you use a right click on the block or a right click in the air? Can you try printing the coordinates? Or possibly even post the code of both your item and the procedure?

Joined Oct 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Well the strawberry is a…
Tue, 05/07/2019 - 23:59

Well the strawberry is a food item. So it doesn't have a right click in air/on block it's just right click. Furthermore, it places a strawberry stage0 plant which is a crop. 

Joined Aug 2013
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
That explains a lot! The…
Wed, 05/08/2019 - 01:07

That explains a lot! The reason why the "crop" is not placed in the position that you clicked has nothing to do with it being negative. It is because the trigger "On right click" is just a general right click and does not have any reference to the block you have clicked on - it uses the player's position instead, therefore it places where you are standing (+ there can be some offset due to rounding the decimal coordinate).

To be more exact, MCreator overrides Item#onItemRightClick() which is not intended for interacting with the block you click on.

If you want to use your food item as a "seed", you have to manually override a different function - like Item#onItemUse() or Item#onItemRightClick(), or you could possibly use the "player right clicks a block" global trigger.

Joined Oct 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Than you! I'll check into…
Wed, 05/08/2019 - 04:54

Than you! I'll check into these and see if they work.

Joined Oct 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Just wanted to let you know…
Thu, 05/09/2019 - 00:11

Just wanted to let you know it worked! Thank you so much!