Help with math

Started by SkylieTuff on

Topic category: General discussion

Last seen on 22:41, 16. Oct 2023
Joined Mar 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Help with math

I'm trying to learn bitwise or, and, xor. I'm curious how each works. Plus I want to know what this would do

Y min -4 bitwiseOr y max 4 

Last seen on 15:27, 10. Oct 2022
Joined Jan 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Basically if you use one or…
Wed, 09/25/2019 - 17:40

Basically if you use one or the other it will trigger the effect, but using both wont trigger it.

So basically Lets say Place a block and Break a block for XOR if they do both, it wont trigger the effect, but if they do one or the other it will.

Last seen on 14:12, 3. Jun 2023
Joined Nov 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
hm, yes and no. Logic…
Thu, 09/26/2019 - 09:51

hm, yes and no. Logic operations AND, OR and XOR take 2 boolean values as input. AND returns true if both inputs are true, OR if at least one is true, XOR if only one is true. Bitwise operations work by converting the number to binary and working bit by bit. For example, 6 can be converted to 0110 and 3 to 0011. Bitwise AND returns 1 if both bits are, bitwise OR returns 1 if at least one is, bitwise XOR returns 1 if only one is.

6 AND 3 becomes:

0110 AND
0011 =
0010 --> 2 in decimal system

6 OR 3 becomes:
0110 AND
0011 =
0111 --> 7 in decimal system

6 XOR 3 becomes:
0110 XOR
0011 =
0101 --> 5 in decimal system

Generally you won't really have to use bitwise operations, so don't worry about them too much

Last seen on 22:41, 16. Oct 2023
Joined Mar 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
So let's say on the "move…
Wed, 03/11/2020 - 15:59

So let's say on the "move provided entity to x", how would I give it so the player can choose the moved position but doesn't feel jenky while being thrown upwards. I'm wanting to make a sword when right clicked moves the player up 5 spaces and than again 2 spaces, but no more and still move freely in the air after the move. So far it's not easy. This was similar concept due to when I posted this, except I was trying to make it work with a key bind back then. I mean I got a sword that moves you up 5 and than 2 relying on the ground block but it still after the move code makes it hard for a player to move while going up.