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
  • [RESOLVED][1.12.2] Trying to get universal bucket into a custom creative tab?
The update for 1.13 is being worked on - please be patient. (Updated 02/14/19)
Sign in to follow this  
Followers 0
tigres810

[RESOLVED][1.12.2] Trying to get universal bucket into a custom creative tab?

Started by tigres810, February 10

8 posts in this topic

tigres810    0

tigres810

tigres810    0

  • Tree Puncher
  • tigres810
  • Members
  • 0
  • 15 posts
  • Report post
Posted February 10 (edited)

So I made a fluid that adds a bucket from forge how I can get that bucket and add it to a custom tab? Also I need to check his name for a generator thingy.

 

Any help?

Edited February 11 by tigres810

Share this post


Link to post
Share on other sites

diesieben07    6104

diesieben07

diesieben07    6104

  • Reality Controller
  • diesieben07
  • Forum Team
  • 6104
  • 40199 posts
  • Report post
Posted February 10

In your creative tab override CreativeTabs#displayAllRelevantItems. Call super, then add whatever additional stacks you want to appear to the list.

To obtain a filled bucket stack, use FluidUtil#getFilledBucket.

Share this post


Link to post
Share on other sites

tigres810    0

tigres810

tigres810    0

  • Tree Puncher
  • tigres810
  • Members
  • 0
  • 15 posts
  • Report post
Posted February 10

Can you send me a example? It's a bit confusing the getfilledbucket stuff.

Share this post


Link to post
Share on other sites

diesieben07    6104

diesieben07

diesieben07    6104

  • Reality Controller
  • diesieben07
  • Forum Team
  • 6104
  • 40199 posts
  • Report post
Posted February 10

What's confusing about it? It's a method and you call it.

Share this post


Link to post
Share on other sites

tigres810    0

tigres810

tigres810    0

  • Tree Puncher
  • tigres810
  • Members
  • 0
  • 15 posts
  • Report post
Posted February 10 (edited)

Idk how to get the Item from getfilledbucket, I need to return the fluid or how is that?

 

Im trying 

Quote

@Override
    public void displayAllRelevantItems(NonNullList<ItemStack> p_78018_1_) {
        // TODO Auto-generated method stub
        super.displayAllRelevantItems(FluidUtil.getFilledBucket(new FluidStack(ModFluids.FLUX_FLUID, 1)));
    }

but it gets an error

 

Also I tried 

Quote

@Override
    public void displayAllRelevantItems(NonNullList<ItemStack> p_78018_1_) {
        super.displayAllRelevantItems(p_78018_1_);
        FluidUtil.getFilledBucket(new FluidStack(ModFluids.FLUX_FLUID, 1));
    }

but the bucket isn't there

Edited February 10 by tigres810
I forgot to add some things

Share this post


Link to post
Share on other sites

tigres810    0

tigres810

tigres810    0

  • Tree Puncher
  • tigres810
  • Members
  • 0
  • 15 posts
  • Report post
Posted February 11

Okay thanks for the help I figure it out by myself on the post u made long ago: 

Quote

 

Its like u sayd: 

Quote

@Override
    public void displayAllRelevantItems(NonNullList<ItemStack> items) {
        super.displayAllRelevantItems(items);
        items.add(FluidUtil.getFilledBucket(new FluidStack(ModFluids.FLUX_FLUID, 1)));
    }

Ill leave it there if somebody needs it!

Share this post


Link to post
Share on other sites

diesieben07    6104

diesieben07

diesieben07    6104

  • Reality Controller
  • diesieben07
  • Forum Team
  • 6104
  • 40199 posts
  • Report post
Posted February 11

That old post has nothing to do with your problem...

  • Haha 1

Share this post


Link to post
Share on other sites

tigres810    0

tigres810

tigres810    0

  • Tree Puncher
  • tigres810
  • Members
  • 0
  • 15 posts
  • Report post
Posted February 11

Still it worked post closed

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
Followers 0
Go To Topic Listing Modder Support

  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • Xander402
      How to add a tooltip using ItemTooltipEvent?

      By Xander402 · Posted 1 hour ago

      Yeah, thank you. Everything works fine.
    • Mclovintits
      Need Help

      By Mclovintits · Posted 1 hour ago

      My client keeps crashing when I join my server, I don't know what to do.    This is the error it give me on my server. [21:12:03] [Server thread/ERROR] [FML]: FMLIndexedMessageCodec exception caught io.netty.handler.codec.EncoderException: java.lang.RuntimeException: Undefined discriminator for message type journeymap.common.network.DimensionPermissionPacket in channel jm_dim_permission at io.netty.handler.codec.MessageToMessageEncoder.write(MessageToMessageEncoder.java:106) ~[MessageToMessageEncoder.class:?] at io.netty.handler.codec.MessageToMessageCodec.write(MessageToMessageCodec.java:116) ~[MessageToMessageCodec.class:?] at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:738) ~[AbstractChannelHandlerContext.class:?] at io.netty.channel.AbstractChannelHandlerContext.invokeWriteAndFlush(AbstractChannelHandlerContext.java:801) ~[AbstractChannelHandlerContext.class:?] at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:814) ~[AbstractChannelHandlerContext.class:?] at io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(AbstractChannelHandlerContext.java:794) ~[AbstractChannelHandlerContext.class:?] at io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(AbstractChannelHandlerContext.java:831) ~[AbstractChannelHandlerContext.class:?] at io.netty.channel.DefaultChannelPipeline.writeAndFlush(DefaultChannelPipeline.java:1032) ~[DefaultChannelPipeline.class:?] at io.netty.channel.AbstractChannel.writeAndFlush(AbstractChannel.java:296) ~[AbstractChannel.class:?] at net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper.sendTo(SimpleNetworkWrapper.java:250) [SimpleNetworkWrapper.class:?] at journeymap.common.network.PacketHandler.sendDimensionPacketToPlayer(PacketHandler.java:57) [PacketHandler.class:1.12.2-5.5.3] at journeymap.server.events.ForgeEvents.on(ForgeEvents.java:73) [ForgeEvents.class:1.12.2-5.5.3] at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_753_ForgeEvents_on_EntityJoinWorldEvent.invoke(.dynamic) [?:?] at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90) [ASMEventHandler.class:?] at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:182) [EventBus.class:?] at net.minecraft.world.World.func_72838_d(World.java:1206) [amu.class:?] at net.minecraft.world.WorldServer.func_72838_d(WorldServer.java:1058) [oo.class:?] at net.minecraft.server.management.PlayerList.func_72377_c(PlayerList.java:377) [pl.class:?] at net.minecraft.server.management.PlayerList.initializeConnectionToPlayer(PlayerList.java:166) [pl.class:?] at shadows.fastbench.net.HijackedDedicatedPlayerList.initializeConnectionToPlayer(HijackedDedicatedPlayerList.java:19) [HijackedDedicatedPlayerList.class:?] at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.completeServerSideConnection(NetworkDispatcher.java:255) [NetworkDispatcher.class:?] at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.access$100(NetworkDispatcher.java:72) [NetworkDispatcher.class:?] at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher$1.func_73660_a(NetworkDispatcher.java:205) [NetworkDispatcher$1.class:?] at net.minecraft.network.NetworkManager.func_74428_b(NetworkManager.java:285) [gw.class:?] at net.minecraft.network.NetworkSystem.func_151269_c(NetworkSystem.java:180) [oz.class:?] at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:790) [MinecraftServer.class:?] at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:397) [nz.class:?] at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:668) [MinecraftServer.class:?] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:526) [MinecraftServer.class:?] at java.lang.Thread.run(Unknown Source) [?:1.8.0_201] Caused by: java.lang.RuntimeException: Undefined discriminator for message type journeymap.common.network.DimensionPermissionPacket in channel jm_dim_permission at net.minecraftforge.fml.common.network.FMLIndexedMessageToMessageCodec.encode(FMLIndexedMessageToMessageCodec.java:76) ~[FMLIndexedMessageToMessageCodec.class:?] at io.netty.handler.codec.MessageToMessageCodec$1.encode(MessageToMessageCodec.java:67) ~[MessageToMessageCodec$1.class:?] at io.netty.handler.codec.MessageToMessageEncoder.write(MessageToMessageEncoder.java:88) ~[MessageToMessageEncoder.class:?] ... 29 more    
    • DavidM
      How to add a tooltip using ItemTooltipEvent?

      By DavidM · Posted 2 hours ago

      Check my updated reply (I misunderstood your question at first).
    • Xander402
      How to add a tooltip using ItemTooltipEvent?

      By Xander402 · Posted 2 hours ago

      Okay, so I'll do. I know what to do with my custom mod items, I don't have any trouble with adding tooltips to them.
      I do similarly to what you said, but I have all the tooltips in my lang file in case I wanted to translate the mod.
      But I don't think I'm allowed to re-initialize and override a VANILLA item, like minecraft:diamond...
    • DavidM
      How to add a tooltip using ItemTooltipEvent?

      By DavidM · Posted 2 hours ago

      1. Do NOT use static initializers. 2.  1.12.2: event.getTooltip.add(String);   1.13.2: event.getTooltip.add(ITextComponent);  
  • Topics

    • Xander402
      4
      How to add a tooltip using ItemTooltipEvent?

      By Xander402
      Started 2 hours ago

    • Mclovintits
      0
      Need Help

      By Mclovintits
      Started 1 hour ago

    • DavidM
      0
      [1.13.2] Replacing Entity#setDead

      By DavidM
      Started 3 hours ago

    • DavidM
      0
      [1.13.2] Creating Entity From NBT

      By DavidM
      Started 3 hours ago

    • Drachenbauer
      29
      [1.13.2] converting mod from 1.12.2 How to fix the errors?

      By Drachenbauer
      Started Saturday at 08:17 PM

  • Who's Online (See full list)

    • Kaelym
    • Mango106
    • Mahmoud Eyad
    • DaemonUmbra
    • smmmadden
    • quadraxis
    • WindsOfBoreas
    • MysticalNitemare
    • Paul Malyarevich
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • [RESOLVED][1.12.2] Trying to get universal bucket into a custom creative tab?
  • Theme
  • Contact Us

Copyright © 2017 ForgeDevelopment LLC Powered by Invision Community