[Tutorial] How to turn the player into a fish

Started by ChickenSpeed12 on

Topic category: User side tutorials

Joined Jun 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
[Tutorial] How to turn the player into a fish
Wed, 07/26/2023 - 12:23 (edited)

Hellooo there! If you're here, you're probably one of two people. Either

(a). You're working on a mod that turns the player into a fish, or

(b). You curiously clicked on this forum topic.

I was making a mod, and in it, I made the player turn into a fish, so I decided to share my work! But I also made sure that you would input the code yourself instead of importing it, so you would understand how it works and could change it to your liking!

Anyways, that doesn't matter! Lets get on with the tutorial!

Workspace

This is my workspace, and this is where we will be working.

First, we need to add a variable. This is the variable that says you are a fish or not. How you enable this is your decision, but for beginners, this is how you add a global variable.

Click on "variable."

Variable

Add your variable. Make sure its logic and player persistent. It could be player lifetime, though.

Now, make your procedure. You can call this whatever you like.

Now, create this. I forgot to add this, so you won't see it in the first pictures. And make sure to put EVERYTHING inside this procedure. This is the procedure that checks if we're a fish or not. Make sure you change "No additional trigger" to "On player tick update."

Now, make the following procedure and put it in your if statement. This procedure checks if the player is in water or not. 

Now its time to add potions! You can edit any value you want! You don't even have to add these!

Now change the if to an if else if. You can do this by clicking on the cog and then doing anything you want with it. Then, add the statement in the following photo. This detects if the player still has oxygen.

Now  remove the potions and add slowness. by setting the slowness level to 255, the player can't walk, so it means you have to jump around like a fish.

Now add this to the else if. You actually have to set it to 5 so the default player breathing doesn't takeover(You may be able to set it to 4, but I dont know).

Now to make sure the player can actually breath underwater, add this. Although the max oxygen IS 300, MCreator might keep adding up after that.

Now, add this(change the < to a ≤).

Even when the oxygen is at zero, we'll have to damage the player ourselves.  Change DRYOUT to whatever you like, but I recommend DRYOUT or DROWN.

We're done with player breathing! But now you might want to make it so the player doesn't sink in the water. Its incredibly simple! Just add a bunch of 

"Set no gravity of [Event/target entity] to {?]". There's four of them. Can you find them all?

Now lets make it so the player can't eat certain things! First, Make a new procedure.

Now add this.

 

Now this.

This will basically stop the player from eating, but we want it to stop the player eating certain foods! Now let's add a tag now.

Now edit so its a bit like this. If you do forge, I believe it means other mods can add stuff to your tag. You need to set "Tag type" to items, and "Elements under this tag" Can be set to whatever you like! Make sure to also copy the "Tag registry name."

Now you can change your procedure to this! For the tag, add your tag namespace, like forge or minecraft, and then a :, and then paste your tag.

Now you've got your player on a diet! But if you did some really bad foods(like raw cod) then you might want to make the foods(like raw cod) a little better. Make a new procedure.

Now while I count the amount of "Now"s in this forum topic, make this.

Now while you could settle for this, I prefer adding a bit more stuff. Like this!

Now we're all done! This is my first ever tutorial, so I hope you like it!

P.S,

There are 17 "Now"s. Correct me if I'm wrong

Edited by ChickenSpeed12 on Wed, 07/26/2023 - 12:23
Joined Jun 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
If you've got any more…
Wed, 07/26/2023 - 12:23

If you've got any more tutorial ideas let me know!

Joined Feb 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Most sane mcreator user:
Sun, 08/06/2023 - 01:27

Most sane mcreator user: