Jump to content

deyahruhd

Members
  • Posts

    3
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

deyahruhd's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. First: double playerX = Math.floor(Minecraft.getMinecraft().thePlayer.posX); The floor function maps a number to its largest preceeding integer (e.g. 29.99 -> 29.00), so you will have a value ending with .00. Second: if (coordinate > 0) { float v = coordinate - .99; if (x = (int) x) { // the player's positive coordinate ends with .99 } } else { float v = coordinate + .99; if (x = (int) x) { // the player's negative coordinate ends with .99 } } Note: if the coordinates have more than two digits after the decimal point, this code will mess up. If that is the case, be sure to truncate the floats.
  2. The solution to your problem is so incredibly simple. It's seriously part of basic Java knowledge. ClassicBrickStairs does not have a constructor that takes a Material. It takes a Block and an int. The Block it takes in is the "material" it is made of, so if I wanted to make grass stairs I would put a grass block in there.
  3. Get the position of the block relative to the entity's position, multiply the resulting vector by some factor then move the entity with that vector. If you want it to act like gravity, have the factor be affected by the entity's distance to the block. All simple vector math.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.