How to effectively script

Avatar

By Turtl 30 January 2020 11:59

Banned · 479 comments

This tutorial shows what you should learn/do to effectively start scripting.


1.Good IDE


First of all download some good IDE better than notepad/notepad++.I recommend Visual Studio Code and IntellIJ Ultimate1, other that I know but I never used are: Atom, Sublime Text, Brackets.

2.Learning minecraft documentations


Second step is learning how minecraft documentations work, so first go to the website scriptapi.liquidbounce.net, now it shows for you three tables, one with names of a package and optional description to it (biggest one), second showing only names of a packages (left top corner), third showing names of all classes (left bottom corner).

If you want to search things for the player search for EntityPlayer in classes [you  can use CTRL+F combination to enable search in web browser].If you found it, left click on it and the biggest space will show your class. It shows all informations about it, for example: net.minecraft.entity.player.EntityPlayer shows you class that you can import for a player in script: Java.type('net.minecraft.entity.player.EntityPlayer').If you scroll more to the bottom you will see things you can do with that player, protected/private things means you can't change them unless you edit the java code.If you scroll even more to the Methods inherited from ... you will see methods which you can use for sure. In our case (EntityPlayer) it shows two things, first methods from class net.minecraft.entity.Entity and second from net.minecraft.entity.EntityLivingBase, why it is like that? because some of these methods works on all entities which are 'living' [net.minecraft.entity.EntityLivingBase], and one only for all entities [net.minecraft.entity.Entity].
For example we want to get somehow output that Player is whenever eating or not. If we'll search for it we'll finally notice it, if you can't see method that you want but you can't notice it just use CTRL+F.In this case [player is eating] method is named isEating, so how to use it?

3.Using methods


I'll show you syntax for using isEating
Ready syntax should look like this: mc.thePlayer.isEating
but what does it mean?
. -> shows that you want to use class from this class.
mc -> Minecraft instance.
thePlayer -> mc.thePlayer means Your entity [EntityPlayer].
isEating -> method from any entity.
so full mc.thePlayer.isEating means: Use method isEating from entity thePlayer from instance of Minecraft named mc

4.Using functions


You may notice that some of methods uses (), what does it mean?
It means that is function, example of that function is getName() from Entity. To use it you need to do: entity.getName() instead of entity.getName.
example: mc.thePlayer.getName() returns you your name.

5. Learn how to use google


And most valuable of these things is google. If you can use it you can do everything.

6. Learn JavaScript


You can learn JavaScript here https://www.w3schools.com/js/ on other site/youtube channel you want. This thing is very needed to start effectively script.

Last edited by Turtl (30 January 2020 12:00)


turtl gonna rape, uh sry, rap for u

Avatar

By Aftery 30 January 2020 12:23

Member · 595 comments
Turtl wrote

This tutorial shows what you should learn/do to effectively start scripting.


1.Good IDE


First of all download some good IDE better than notepad/notepad++.I recommend Visual Studio Code and IntellIJ Ultimate1, other that I know but I never used are: Atom, Sublime Text, Brackets.

2.Learning minecraft documentations


Second step is learning how minecraft documentations work, so first go to the website scriptapi.liquidbounce.net, now it shows for you three tables, one with names of a package and optional description to it (biggest one), second showing only names of a packages (left top corner), third showing names of all classes (left bottom corner).

If you want to search things for the player search for EntityPlayer in classes [you  can use CTRL+F combination to enable search in web browser].If you found it, left click on it and the biggest space will show your class. It shows all informations about it, for example: net.minecraft.entity.player.EntityPlayer shows you class that you can import for a player in script: Java.type('net.minecraft.entity.player.EntityPlayer').If you scroll more to the bottom you will see things you can do with that player, protected/private things means you can't change them unless you edit the java code.If you scroll even more to the Methods inherited from ... you will see methods which you can use for sure. In our case (EntityPlayer) it shows two things, first methods from class net.minecraft.entity.Entity and second from net.minecraft.entity.EntityLivingBase, why it is like that? because some of these methods works on all entities which are 'living' [net.minecraft.entity.EntityLivingBase], and one only for all entities [net.minecraft.entity.Entity].
For example we want to get somehow output that Player is whenever eating or not. If we'll search for it we'll finally notice it, if you can't see method that you want but you can't notice it just use CTRL+F.In this case [player is eating] method is named isEating, so how to use it?

3.Using methods


I'll show you syntax for using isEating
Ready syntax should look like this: mc.thePlayer.isEating
but what does it mean?
. -> shows that you want to use class from this class.
mc -> Minecraft instance.
thePlayer -> mc.thePlayer means Your entity [EntityPlayer].
isEating -> method from any entity.
so full mc.thePlayer.isEating means: Use method isEating from entity thePlayer from instance of Minecraft named mc

4.Using functions


You may notice that some of methods uses (), what does it mean?
It means that is function, example of that function is getName() from Entity. To use it you need to do: entity.getName() instead of entity.getName.
example: mc.thePlayer.getName() returns you your name.

5. Learn how to use google


And most valuable of these things is google. If you can use it you can do everything.

6. Learn JavaScript


You can learn JavaScript here https://www.w3schools.com/js/ on other site/youtube channel you want. This thing is very needed to start effectively script.

1. Whats wrong with npp?
3,4. This is just 6.
6. This should be a good start: https://youtu.be/PkZNo7MFNFg


website
@Aftery#5051 on Discord
stawbery reloded))
bDED6E9.pngCC3ddf6.pnge2adC5a.png1cBc37C.png2d41fd9.png

Avatar

By Turtl 30 January 2020 12:32

Banned · 479 comments

1. Whats wrong with npp?
3,4. This is just 6.
6. This should be a good start: https://youtu.be/PkZNo7MFNFg

Notepad++ doesn't show suggestions at all thats why i don't like it, 4 yes its useless maybe but 3 explain how this 'works'


turtl gonna rape, uh sry, rap for u

Avatar

By yorik100 30 January 2020 13:47

Member · 748 comments
Turtl wrote

This tutorial shows what you should learn/do to effectively start scripting.


1.Good IDE


First of all download some good IDE better than notepad/notepad++.I recommend Visual Studio Code and IntellIJ Ultimate1, other that I know but I never used are: Atom, Sublime Text, Brackets.

2.Learning minecraft documentations


Second step is learning how minecraft documentations work, so first go to the website scriptapi.liquidbounce.net, now it shows for you three tables, one with names of a package and optional description to it (biggest one), second showing only names of a packages (left top corner), third showing names of all classes (left bottom corner).

If you want to search things for the player search for EntityPlayer in classes [you  can use CTRL+F combination to enable search in web browser].If you found it, left click on it and the biggest space will show your class. It shows all informations about it, for example: net.minecraft.entity.player.EntityPlayer shows you class that you can import for a player in script: Java.type('net.minecraft.entity.player.EntityPlayer').If you scroll more to the bottom you will see things you can do with that player, protected/private things means you can't change them unless you edit the java code.If you scroll even more to the Methods inherited from ... you will see methods which you can use for sure. In our case (EntityPlayer) it shows two things, first methods from class net.minecraft.entity.Entity and second from net.minecraft.entity.EntityLivingBase, why it is like that? because some of these methods works on all entities which are 'living' [net.minecraft.entity.EntityLivingBase], and one only for all entities [net.minecraft.entity.Entity].
For example we want to get somehow output that Player is whenever eating or not. If we'll search for it we'll finally notice it, if you can't see method that you want but you can't notice it just use CTRL+F.In this case [player is eating] method is named isEating, so how to use it?

3.Using methods


I'll show you syntax for using isEating
Ready syntax should look like this: mc.thePlayer.isEating
but what does it mean?
. -> shows that you want to use class from this class.
mc -> Minecraft instance.
thePlayer -> mc.thePlayer means Your entity [EntityPlayer].
isEating -> method from any entity.
so full mc.thePlayer.isEating means: Use method isEating from entity thePlayer from instance of Minecraft named mc

4.Using functions


You may notice that some of methods uses (), what does it mean?
It means that is function, example of that function is getName() from Entity. To use it you need to do: entity.getName() instead of entity.getName.
example: mc.thePlayer.getName() returns you your name.

5. Learn how to use google


And most valuable of these things is google. If you can use it you can do everything.

6. Learn JavaScript


You can learn JavaScript here https://www.w3schools.com/js/ on other site/youtube channel you want. This thing is very needed to start effectively script.

Notpad++ much good

Avatar

By Aftery 30 January 2020 14:05

Member · 595 comments
Turtl wrote

1. Whats wrong with npp?
3,4. This is just 6.
6. This should be a good start: https://youtu.be/PkZNo7MFNFg

Notepad++ doesn't show suggestions at all thats why i don't like it, 4 yes its useless maybe but 3 explain how this 'works'

well id personally recommend npp. Also, 3 and 4 is still redundant imo


website
@Aftery#5051 on Discord
stawbery reloded))
bDED6E9.pngCC3ddf6.pnge2adC5a.png1cBc37C.png2d41fd9.png

Avatar

By _SunnyCrafttt 30 January 2020 14:22

Member · 137 comments

Don't use Notepad++ use Notepad is installed by default and it is very comfortable and it should be put on to be used


> Fix the LiquidLag <

Avatar

By Turtl 30 January 2020 15:12

Banned · 479 comments

Thing that I don't like notepad++ doesn't mean that someone doesn't like it if you want use it lol


turtl gonna rape, uh sry, rap for u

Avatar

By Aftery 30 January 2020 16:11

Member · 595 comments
_SunnyCrafttt wrote

Don't use Notepad++ use Notepad is installed by default and it is very comfortable and it should be put on to be used

shut uo


website
@Aftery#5051 on Discord
stawbery reloded))
bDED6E9.pngCC3ddf6.pnge2adC5a.png1cBc37C.png2d41fd9.png