Jump to content

Recommended Posts

Posted

Hello everyone.

I would like to make an teleportation system. When the player press J, an GUI appear and he have to choose the x, y, z coordinates. When he click on the button " Teleport " or whatever, he's teleport to the chosen destination.

 

But I have no idea for make this kind of GUI and for the teleportation system.

 

I have already this code for my KeyBind (into my ClientProxy) :

private static KeyBinding keyBindTest;

public ClientProxy()
{
	FMLCommonHandler.instance().bus().register(this);
	keyBindTest = new KeyBinding("modtest.key", Keyboard.KEY_J, "key.categories.gameplay");
	ClientRegistry.registerKeyBinding(keyBindTest);
}

@SubscribeEvent
public void onEvent(KeyInputEvent event)
{
	if(keyBindTest.isPressed())
	{
		keyTestTyped();
	}
}

private void keyTestTyped()
{
	Minecraft.getMinecraft().thePlayer.addChatComponentMessage(new ChatComponentText("test"));
}

 

If you have any ideas...

 

Best regards,

Posted

First of all, why are you working on 1.7.2? Update.

 

Then, what exactly is your problem? I mean, nobody is going to just write the GUI for you and you have not even started on it...

 

I'll update on 1.7.10 but I won't work on 1.8.

 

Then, when I asked someone for a code? " If you have any ideas... " It seems to me that ideas an code are not the same.

Posted

You could add three Textfields to unter coordinates and a confirm button. After pressing The confirm button send a package with The coordinates to The Server which will handle The teleport

Posted

You could add three Textfields to unter coordinates and a confirm button. After pressing The confirm button send a package with The coordinates to The Server which will handle The teleport

 

Thanks I'll try your method.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.