Package net.neoforged.neoforge.event
Class BuildCreativeModeTabContentsEvent
java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.event.BuildCreativeModeTabContentsEvent
- All Implemented Interfaces:
CreativeModeTab.Output
,net.neoforged.fml.event.IModBusEvent
public final class BuildCreativeModeTabContentsEvent
extends net.neoforged.bus.api.Event
implements net.neoforged.fml.event.IModBusEvent, CreativeModeTab.Output
Fired when the contents of a specific creative mode tab are being populated in
CreativeModeTab.buildContents(CreativeModeTab.ItemDisplayParameters)
.
This event may be fired multiple times if the operator status of the local player or enabled feature flags changes.
In vanilla, this is only fired on the logical client, but mods may request creative mode tab contents on the server.
-
Field Summary
Modifier and TypeFieldDescriptionprivate final MutableHashedLinkedMap
<ItemStack, CreativeModeTab.TabVisibility> private final CreativeModeTab.ItemDisplayParameters
private final CreativeModeTab
private final ResourceKey
<CreativeModeTab> -
Constructor Summary
ConstructorDescriptionBuildCreativeModeTabContentsEvent
(CreativeModeTab tab, ResourceKey<CreativeModeTab> tabKey, CreativeModeTab.ItemDisplayParameters parameters, MutableHashedLinkedMap<ItemStack, CreativeModeTab.TabVisibility> entries) -
Method Summary
Modifier and TypeMethodDescriptionvoid
accept
(ItemStack stack, CreativeModeTab.TabVisibility visibility) getFlags()
getTab()
Returns the creative mode tab currently populating its contents.Returns the key of the creative mode tab currently populating its contents.boolean
-
Field Details
-
tab
-
parameters
-
entries
-
tabKey
-
-
Constructor Details
-
BuildCreativeModeTabContentsEvent
@Internal public BuildCreativeModeTabContentsEvent(CreativeModeTab tab, ResourceKey<CreativeModeTab> tabKey, CreativeModeTab.ItemDisplayParameters parameters, MutableHashedLinkedMap<ItemStack, CreativeModeTab.TabVisibility> entries)
-
-
Method Details
-
getTab
Returns the creative mode tab currently populating its contents.- Returns:
- the creative mode tab currently populating its contents
-
getTabKey
Returns the key of the creative mode tab currently populating its contents.- Returns:
- the key of the creative mode tab currently populating its contents
-
getFlags
-
getParameters
-
hasPermissions
public boolean hasPermissions() -
getEntries
-
accept
- Specified by:
accept
in interfaceCreativeModeTab.Output
-