Jump to content
  • Home
  • Files
  • Docs
Topics
  • All Content

  • This Topic
  • This Forum

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • [1.15.2] How to create a screen with background and slots?
Currently Supported: 1.16.X (Latest) and 1.15.X (LTS)
Sign in to follow this  
Followers 1
david072

[1.15.2] How to create a screen with background and slots?

By david072, July 4, 2020 in Modder Support

  • Reply to this topic
  • Start new topic

Recommended Posts

david072    0

david072

david072    0

  • Tree Puncher
  • david072
  • Members
  • 0
  • 2 posts
Posted July 4, 2020

Hello.

I am new to Minecraft modding.

Now, I want to open a screen when an item is right clicked. I have a class which extends Screen and if I now right click the item, you can see something happens.

But now I need to render a background texture, but after much researching I only find tutorials for older versions.

Also, I wonder how I can add slots to the screen.

 

Thanks a lot.

 

  • Quote

Share this post


Link to post
Share on other sites

Budschie    5

Budschie

Budschie    5

  • Creeper Killer
  • Budschie
  • Members
  • 5
  • 168 posts
Posted July 4, 2020 (edited)

To render a background texture, I think you should use "AbstractGui.blit".

The methods parameters may be unnamed.

To display the texture you want to display, you have to bind it with a resource location first.

Edited July 5, 2020 by Budschie
too unprecise
  • Quote

Share this post


Link to post
Share on other sites

poopoodice    112

poopoodice

poopoodice    112

  • Dragon Slayer
  • poopoodice
  • Members
  • 112
  • 895 posts
Posted July 4, 2020

see how vanilla screens do them in

drawGuiContainerBackgroundLayer()

slots are in the container, and screen only shows what is in that container

  • Quote

Share this post


Link to post
Share on other sites

TheGreyGhost    819

TheGreyGhost

TheGreyGhost    819

  • Reality Controller
  • TheGreyGhost
  • Members
  • 819
  • 3280 posts
Posted July 5, 2020

Howdy

 

This tutorial project has some examples of screens

https://github.com/TheGreyGhost/MinecraftByExample

-see mbe30, mbe31, mbe32

 

-TGG

  • Quote

Share this post


Link to post
Share on other sites

david072    0

david072

david072    0

  • Tree Puncher
  • david072
  • Members
  • 0
  • 2 posts
Posted July 7, 2020 (edited)

Ok, Guys it works now.

Thanks a lot for your help.

 

Edited July 7, 2020 by david072
  • Quote

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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.

    • Insert image from URL
×
  • Desktop
  • Tablet
  • Phone
Sign in to follow this  
Followers 1
Go To Topic Listing



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • poopoodice
      What is the method to left click?

      By poopoodice · Posted 7 minutes ago

      Check Minecraft#processKeyBinds where it checks for attack keybind (left mouse).
    • kiou.23
      Mod won't load when in dev environment

      By kiou.23 · Posted 7 minutes ago

      You need to update the build.gradle to have your modid instead of the default examplemod you'll want to modify the group, the modid and pretty much everywhere where "examplemod" is shown, you'll want to replace with your own modid   note: you have a static field in your main mod class (Warwolves.java) called MOD_ID, whenever you need the mod id, you should be referencing this field, instead of typing the string every time note 2: don't create an ItemBase class https://championash5357.github.io/ChampionAsh5357/tutorial/minecraft/ciar#code-style-5
    • BoGuBoy
      3rd party hosted Server wont launch

      By BoGuBoy · Posted 12 minutes ago

      Thanks for the reply i got a response from the head support so ill look into changing hosts thanks for the quick response bud
    • Gubipe
      What is the method to left click?

      By Gubipe · Posted 1 hour ago

      I am trying to make a custom autoclicker for my client side mod which will be used on my smp server so that when someone presses down the key "v" it will toggle an autoclicker for them. I was wondering if anyone could tell me what the method is to register a left click? I would appreciate it!
    • DaemonUmbra
      tempête de Neige primal winter

      By DaemonUmbra · Posted 1 hour ago

      Please keep this forum in English. Are you a developer for the mod or are you a player?
  • Topics

    • Gubipe
      1
      What is the method to left click?

      By Gubipe
      Started 1 hour ago

    • Silivek
      1
      Mod won't load when in dev environment

      By Silivek
      Started 5 hours ago

    • BoGuBoy
      2
      3rd party hosted Server wont launch

      By BoGuBoy
      Started 4 hours ago

    • Ronshark
      1
      tempête de Neige primal winter

      By Ronshark
      Started 4 hours ago

    • iHamster
      12
      Stuck with block movement

      By iHamster
      Started January 6

  • Who's Online (See full list)

    • kiou.23
    • Squrikle
    • AdleyMD
    • Leronus
    • Cloven
    • Otep
    • Zeher_Monkey
    • BoGuBoy
    • AubriTheHuman
    • will.haskamp@icloud.com
    • Joshthehoneskid
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • [1.15.2] How to create a screen with background and slots?
  • Theme

Copyright © 2019 ForgeDevelopment LLC · Ads by Longitude Ads LLC Powered by Invision Community