How to force player doing something?

Started by QB on

Topic category: Help with Minecraft modding (Java Edition)

Active 4 years ago
Joined May 2019
Points:
895

User statistics:

  • Modifications: 1
  • Forum topics: 31
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 122
How to force player doing something?

So I wanted to force players to jump if they have something in their inventory, is that possible so far?

Active 1 year ago
Joined Mar 2020
Points:
654

User statistics:

  • Modifications: 0
  • Forum topics: 1
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 13
I don't think so, the "if…
Sat, 03/21/2020 - 14:40

I don't think so, the "if they have something in their inventory" part is possible (obviously) but the force to jump part really isn't. the closest thing I can think of is temporarily putting a slime block under the players feet, a piston under the slime block then activating the piston, then removing all of that when finished.

Active 4 years ago
Joined May 2019
Points:
895

User statistics:

  • Modifications: 1
  • Forum topics: 31
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 122
Ah, thank for the reply, I…
Sat, 03/21/2020 - 14:50

Ah, thank for the reply, I'll scrap the idea.

Active 1 year ago
Joined Mar 2020
Points:
654

User statistics:

  • Modifications: 0
  • Forum topics: 1
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 13
ur welcome :3 anyway, it's…
Sat, 03/21/2020 - 22:07

ur welcome :3

anyway, it's not possible to force a player to jump even without using mcreator, so don't feel bad.

Active 4 years ago
Joined May 2019
Points:
895

User statistics:

  • Modifications: 1
  • Forum topics: 31
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 122
Ok, thanks a lot, I'll keep…
Sun, 03/22/2020 - 02:33

Ok, thanks a lot, I'll keep that in mind_ :)

Active 3 years ago
Joined Nov 2019
Points:
873

User statistics:

  • Modifications: 0
  • Forum topics: 8
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 358
you can make the target…
Mon, 03/23/2020 - 19:16

you can make the target player accelerate upwards to produce a jumping effect. Just use a "Custom Code snippet" procedure block and put this "entity.motionY += 0.1d;" in.

Active 4 years ago
Joined May 2019
Points:
895

User statistics:

  • Modifications: 1
  • Forum topics: 31
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 122
Hmm, I did what you…
Mon, 03/23/2020 - 19:37

Hmm, I did what you instructed, but it doesn't seems to work, the gradle task failed, thanks anyway :)

Active 4 years ago
Joined May 2019
Points:
895

User statistics:

  • Modifications: 1
  • Forum topics: 31
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 122
D:\my stuff\RWAS Resources…
Mon, 03/23/2020 - 19:39

D:\my stuff\RWAS Resources\RWASWorkspace\build\sources\main\java\net\mcreator\rwas\MCreatorSheathedFatesEndRangedBulletHitsBlock.java:51: error: illegal start of expression
}/entity.motionY+= 0.1d/if(entity instanceof EntityPlayer)
 ^
D:\my stuff\RWAS Resources\RWASWorkspace\build\sources\main\java\net\mcreator\rwas\MCreatorSheathedFatesEndRangedBulletHitsBlock.java:51: error: illegal start of expression
}/entity.motionY+= 0.1d/if(entity instanceof EntityPlayer)
                        ^
D:\my stuff\RWAS Resources\RWASWorkspace\build\sources\main\java\net\mcreator\rwas\MCreatorSheathedFatesEndRangedBulletHitsBlock.java:51: error: not a statement
}/entity.motionY+= 0.1d/if(entity instanceof EntityPlayer)
                          ^
D:\my stuff\RWAS Resources\RWASWorkspace\build\sources\main\java\net\mcreator\rwas\MCreatorSheathedFatesEndRangedBulletHitsBlock.java:51: error: ';' expected
}/entity.motionY+= 0.1d/if(entity instanceof EntityPlayer)
                                                          ^
D:\my stuff\RWAS Resources\RWASWorkspace\build\sources\main\java\net\mcreator\rwas\MCreatorSheathedFatesEndRangedBulletHitsBlock.java:52: error: not a statement
   ((EntityPlayer)entity).inventory
     ^
D:\my stuff\RWAS Resources\RWASWorkspace\build\sources\main\java\net\mcreator\rwas\MCreatorSheathedFatesEndRangedBulletHitsBlock.java:52: error: ';' expected
   ((EntityPlayer)entity).inventory
                 ^
D:\my stuff\RWAS Resources\RWASWorkspace\build\sources\main\java\net\mcreator\rwas\MCreatorSheathedFatesEndRangedBulletHitsBlock.java:52: error: not a statement
   ((EntityPlayer)entity).inventory
                  ^
D:\my stuff\RWAS Resources\RWASWorkspace\build\sources\main\java\net\mcreator\rwas\MCreatorSheathedFatesEndRangedBulletHitsBlock.java:52: error: ';' expected
   ((EntityPlayer)entity).inventory
                        ^
8 errors
:compileJava FAILED

Active 4 years ago
Joined May 2019
Points:
895

User statistics:

  • Modifications: 1
  • Forum topics: 31
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 122
Did I do something wrong?
Mon, 03/23/2020 - 19:47

Did I do something wrong?

Active 3 years ago
Joined Nov 2019
Points:
873

User statistics:

  • Modifications: 0
  • Forum topics: 8
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 358
Maybe if you pasted a screen…
Tue, 03/24/2020 - 11:51

Maybe if you pasted a screen shot of the procedure? Judging by the error output it looks like you didn't put in the semicolon at the end of the statement.

Active 4 years ago
Joined May 2019
Points:
895

User statistics:

  • Modifications: 1
  • Forum topics: 31
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 122
sorry because I answer this…
Wed, 03/25/2020 - 17:04

sorry because I answer this a bit late, here is the screenshot of the procedure after I added a semilocon at the end of the statement (but it still doesn't work)

procedure: https://imgur.com/tWrpL23

Active 5 years ago
Joined Feb 2014
Points:
734

User statistics:

  • Modifications: 0
  • Forum topics: 1
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 11
You left forward-slashes at…
Mon, 09/14/2020 - 12:13

You left forward-slashes at the start and end of the code snippet! Those are there because the default text is a multi-line comment that says "code".

/*code*/
entity.motionY += 0.1d;

 

Active 2 years ago
Joined Feb 2022
Points:
546

User statistics:

  • Modifications: 0
  • Forum topics: 7
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 7
Ive tried adding that…
Fri, 02/04/2022 - 18:39

Ive tried adding that command too and it just doesnt work and gets compilation errors, im kinda new to the program i have no idea if i messed something up, yes i tried putting the ; but it still doesnt work

Active 9 months ago
Joined Jan 2022
Points:
530

User statistics:

  • Modifications: 1
  • Forum topics: 1
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 4
I tried doing this too but…
Thu, 02/10/2022 - 21:46

I tried doing this too but it gave me a warning saying that the following items don't compile properly and the only item on the list was the procedure