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.16.3] how to make block click to open custom gui?
Currently Supported: 1.16.X (Latest) and 1.15.X (LTS)
Sign in to follow this  
Followers 1
peanutexexe

[1.16.3] how to make block click to open custom gui?

By peanutexexe, October 29, 2020 in Modder Support

  • Reply to this topic
  • Start new topic

Recommended Posts

peanutexexe    0

peanutexexe

peanutexexe    0

  • Tree Puncher
  • peanutexexe
  • Members
  • 0
  • 5 posts
Posted October 29, 2020

hi I'm korean.

I'm not good at English

 

I want block click on custom gui

 

I'm beginner

I running a translator now

 

한국인들 저좀 살려주세요

 

당근  <- This is korean Language

carrot

 

 

Now I want gui is crucible

 

First thank you

  • Quote

Share this post


Link to post
Share on other sites

vemerion    56

vemerion

vemerion    56

  • Creeper Killer
  • vemerion
  • Members
  • 56
  • 220 posts
Posted October 29, 2020

What have you tried so far? Have you looked at the vanilla source code to get an idea of what you would need to do?

 

If you only need a GUI, you would have to create a new class that extends the Screen class, which you would pass into Minecraft.displayGuiScreen(). If you also want a container (i.e. you want the block to hold items), you would also need a tile entity to store the items and a container to interact with it.

  • Quote

Share this post


Link to post
Share on other sites

peanutexexe    0

peanutexexe

peanutexexe    0

  • Tree Puncher
  • peanutexexe
  • Members
  • 0
  • 5 posts
Posted October 29, 2020 (edited)

My computer power line is has my mom

 

But I remember block code 
 

# = tab

 

package •••;

 

import •••;

 

public class RegistryHandler {
 

#public static final DeferredRegister<Block> BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, •••.MOD_ID)

 

#public static void init() {

##ITEMS.register(FMLJavaModLoadingContext.get().getModEventBus());

#}
 

#public static final RegistryObject<Block> crucible = BLOCKS.registry(

##”crucible”, () -> new Block(

###Block.Properties

####.create(Material.Iron)

####.

hardnessAndResistance(5.0f, 6.0f)
+                           .sound(SoundType.STONE)
+                           .harvestLevel(1)
+                           .harvestTool(ToolType.PICKAXE)

 
 

 

here 

 

It's a cell phone that posts comments.

 

 

sorry

 

um... forge 1.16.3 is [(“ItemName”, ItemName::new)] is starting error

Edited October 29, 2020 by peanutexexe
  • Quote

Share this post


Link to post
Share on other sites

Draco18s    2402

Draco18s

Draco18s    2402

  • Reality Controller
  • Draco18s
  • Members
  • 2402
  • 15920 posts
Posted October 29, 2020

Sounds like you want a block that is a container of some kind (like the furnace).

You might be best served by looking at a working example:

https://github.com/TheGreyGhost/MinecraftByExample/tree/1-15-2-final/src/main/java/minecraftbyexample/mbe31_inventory_furnace

 

There's a lot of moving parts to get what you want and trying to explain through machine translation will be difficult.

  • Quote

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Share this post


Link to post
Share on other sites

timko    0

timko

timko    0

  • Tree Puncher
  • timko
  • Members
  • 0
  • 1 post
Posted October 29, 2020

also 

6 hours ago, Draco18s said:

Sounds like you want a block that is a container of some kind (like the furnace).

You might be best served by looking at a working example:

https://github.com/TheGreyGhost/MinecraftByExample/tree/1-15-2-final/src/main/java/minecraftbyexample/mbe31_inventory_furnace

 

There's a lot of moving parts to get what you want and trying to explain through machine translation will be difficult.

also 1.15.2 has old methods and you need some methods to decode the method names

  • Quote

Share this post


Link to post
Share on other sites

peanutexexe    0

peanutexexe

peanutexexe    0

  • Tree Puncher
  • peanutexexe
  • Members
  • 0
  • 5 posts
Posted October 30, 2020 (edited)

Yes 1.15.2 has old and 1.16.3 is error

but I want not basic gui on crafting table or ...

Edited October 30, 2020 by peanutexexe
  • Quote

Share this post


Link to post
Share on other sites

peanutexexe    0

peanutexexe

peanutexexe    0

  • Tree Puncher
  • peanutexexe
  • Members
  • 0
  • 5 posts
Posted November 13, 2020
On 2020. 10. 29. at 오후 11시 21분, Draco18s said:

용광로와 같은 일종의 용기 인 블록을 원하는 것 같습니다.

작동하는 예를 살펴보면 가장 좋은 결과를 얻을 수 있습니다.

https://github.com/TheGreyGhost/MinecraftByExample/tree/1-15-2-final/src/main/java/minecraftbyexample/mbe31_inventory_furnace

 

원하는 것을 얻기 위해 움직이는 부분이 많고 기계 번역을 통해 설명하려고 노력하는 것은 어려울 것입니다.

 

Thank you is very good github file

  • 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

    • buffalobob
      Forge opening in Internet Explorer instead of Java

      By buffalobob · Posted 1 minute ago

      I will literally make out with you I was struggling with this for two hours and you fixed it papi chulo I love you
    • diesieben07
      [1.15.2] Render as 2D icon in GUI, 3D model in hand

      By diesieben07 · Posted 53 minutes ago

      The loader is an inner class: https://github.com/MinecraftForge/MinecraftForge/blob/1.16.x/src/main/java/net/minecraftforge/client/model/SeparatePerspectiveModel.java#L164   You need to register the loader (see where Forge does it). Then the loader will be called to load the JSON model into memory.
    • Woodside
      [1.15.2] Render as 2D icon in GUI, 3D model in hand

      By Woodside · Posted 1 hour ago

      Loader, is that another class I extend off of? Is that SeparaterPerspectiveModel? I really have no context for how these pieces of information fit together. Can you explain with some more detail?
    • ChampionAsh5357
      [1.16.4] Looking to add trades to villagers/wandering traders

      By ChampionAsh5357 · Posted 1 hour ago

      Villagers can be added via VillagerTradesEvent while wandering traders via WandererTradesEvent.
    • ChampionAsh5357
      [1.16.4] How i can put my strucnures in to FlatGenerationSettings.STRUCTURES

      By ChampionAsh5357 · Posted 1 hour ago

      Yes, as you can see it has the obfuscated name which translate to its unique srg name and then finally the mapped name. You will need the srg name as your parameter. The static keyword makes the field/method available at class level meaning you do not need an instance to grab the associated value. So, a null value can be passed in instead.
  • Topics

    • Stinkerpot
      5
      Forge opening in Internet Explorer instead of Java

      By Stinkerpot
      Started March 8, 2016

    • Woodside
      10
      [1.15.2] Render as 2D icon in GUI, 3D model in hand

      By Woodside
      Started 20 hours ago

    • basicsid
      1
      [1.16.4] Looking to add trades to villagers/wandering traders

      By basicsid
      Started 7 hours ago

    • Klarks
      9
      [1.16.4] How i can put my strucnures in to FlatGenerationSettings.STRUCTURES

      By Klarks
      Started 21 hours ago

    • monkeysHK
      3
      [1.16] Transparent Picture Render in GUI

      By monkeysHK
      Started Yesterday at 12:19 AM

  • Who's Online (See full list)

    • jbredwards
    • zOnlyKroks
    • Danebi
    • stegii
    • Amperka_pro
    • Pavel1ewq
    • GamingTiger101
    • diesieben07
    • yaj
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • [1.16.3] how to make block click to open custom gui?
  • Theme

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