Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modifyCreativeTab example doesn't work and causes crash when using removeDisplay #925

Open
micka190 opened this issue Nov 13, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@micka190
Copy link

Minecraft Version

1.20.1

KubeJS Version

2001.6.5-build.16

Rhino Version

2001.2.3-build.6

Architectury Version

9.2.14

Forge/Fabric Version

47.3.0

Describe your issue

Trying to use KubeJS to hide certain modded items from a creative tab, since they're disabled in the modpack.

Saw that the documentation had an example for just that:

StartupEvents.modifyCreativeTab('minecraft:redstone_blocks', event => {
	// Adds example item after redstone
	event.addAfter('minecraft:redstone', 'kubejs:example_item')
	// Removes redstone
	event.removeDisplay('minecraft:redstone');
})

I tried it in my modpack, and it seemed like removeDisplay(...) did nothing. I confirmed I had the correct creative tab selected by changing its icon and name (which worked). Decided to make a fresh instance with only KubeJS and its dependencies in case it was a problem with some other mod.

The above example results in a crash when opening my creative inventory in-game with only KubeJS and its dependencies insalled.

I assumed that maybe the addAfter(...) call was the problem, since I don't have the kubejs:example_item defined anywhere, but the following also causes a crash when opening the creative mode inventory:

StartupEvents.modifyCreativeTab('minecraft:redstone_blocks', event => {
	event.removeDisplay('minecraft:redstone');
})

I've attached a crash log pastebin below.


Is removeDisplay(...) still supposed to work? I've seen some posts online about the functionality no longer being supported, but it's still documented, so I assume it's supposed to work?

Crash report/logs

https://pastebin.com/EZAQtM8e

@micka190 micka190 added the bug Something isn't working label Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant