Slowing block

Started by Raveun on

Topic category: Help with modding (Java Edition)

Last seen on 00:43, 4. Jan 2022
Joined Apr 2015
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Slowing block

Hey guys im using the forum because I have no clue to how to make it, I was wondering how to make a cloud block which can slow down an entity and/or a player when he goes into the block

Last seen on 04:35, 17. Jan 2021
Joined Sep 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
This is probably possible in…
Fri, 06/19/2020 - 23:17

This is probably possible in MCreator using procedures, however, if you need/want to code here you go;

   /**
    * Called when the given entity walks on this Block
    */
   public void onEntityWalk(World worldIn, BlockPos pos, Entity entityIn) {
      double d0 = Math.abs(entityIn.getMotion().y);
      if (d0 < 0.1D && !entityIn.isSteppingCarefully()) {
         double d1 = 0.4D + d0 * 0.2D;
         entityIn.setMotion(entityIn.getMotion().mul(d1, 1.0D, d1));
      }

      super.onEntityWalk(worldIn, pos, entityIn);
   }

From SlimeBlock.java.

Last seen on 00:43, 4. Jan 2022
Joined Apr 2015
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Oh thanks mate, how did you…
Sat, 06/20/2020 - 00:02

Oh thanks mate, how did you find the .java from a block/item etc... ?

Last seen on 00:43, 4. Jan 2022
Joined Apr 2015
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
But for coding, I don't know…
Sat, 06/20/2020 - 00:03

But for coding, I don't know where to start, can I use mcreator to use copy paste this code ?

Last seen on 04:35, 17. Jan 2021
Joined Sep 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Oh thanks mate, how did you…
Sat, 06/20/2020 - 00:18

Oh thanks mate, how did you find the .java from a block/item etc... ?

IDE

But for coding, I don't know where to start, can I use mcreator to use copy paste this code ?

Yes, you can use MCreator. Just put it inside the last bracket, }.