Warping system

Started by Logdawg940 on

Topic category: Help with modding (Java Edition)

Last seen on 23:14, 21. Jul 2020
Joined Jun 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Warping system

Hello! I'm trying to make a warping system and I'm needing some help with it. I want a block that, when placed, opens a gui that allows you to name the warp. If you are on the warp and press shift a gui appears and comes up with every active warp. If you click one of the assigned items you are warped to the warp with the same name as the item. If you could also add in a waiting system that would be nice.  So quick lil recap, you place a warp, name it, go on it, press shift, select a warp, the warp waits a bit, and then you're warped to your selected destination. I'm trying to keep it not coded if thats possible. :p

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

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
 I'm trying to keep it not…
Mon, 06/01/2020 - 17:46

 I'm trying to keep it not coded if thats possible. :p

Too late lol.

you place a warp, name it

So make a block, and in onBlockActivated method open a guy to the player using,

Minecraft.getInstance.displayGuiScreen(new YourScreen());

You are going to want to open that server side ^^^^.

For the "name it" part you are going to want to add in the GUI a textbox.

Once the players types in the name and clicks "confirm" then add that name as a key to a global list along with the coords.

This will add it to the "world warp list".

Now for the second part,

 go on it, press shift, select a warp

Use the same method "onBlockActivated" but this time check if the player is using shift,

Minecraft.getInstance().gameSettings.keyBindSneak.isKeyDown();

Then open a different gui that shows the list of all of the possible warps. Toggle a warp and go!

For,

the warp waits a bit

Just use a simple timer

Last seen on 23:14, 21. Jul 2020
Joined Jun 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I don't know how to do a …
Mon, 06/01/2020 - 18:01

I don't know how to do a "simple timer"

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

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
private int timer = 60 // 3…
Mon, 06/01/2020 - 18:13
private int timer = 60 // 3 Seconds

public void tick()
this.timer -= 1;
if (this.timer <= 0)
{
this.timer = 0;
//DO WHAT YOU WANT HERE
}

 

Last seen on 23:14, 21. Jul 2020
Joined Jun 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
okay thank you!
Mon, 06/01/2020 - 18:19

okay thank you!

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

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Well, keep in mind that the…
Mon, 06/01/2020 - 18:23

Well, keep in mind that the tick method I used as an example. You will need a tile entity for your block for this to work. There is going to be a lot that goes into this block. But if you get any error I'm here (my discord is in my profile).