Closed czerk89 closed 2 months ago
I also found that gamemode-switch
doesn't clear items either and limit-modes
works in this case. I have the following item that is using limit-modes: SURVIVAL, ADVENTURE
and successfully generates during world-switch
. However, it also generates when I switch into a world that's set to CREATIVE. So that shouldn't be happening.
superhero-item:
id: FIREWORK_STAR
charge-color: RED
name: '&eSuperhero Token'
slot: 6
limit-modes: SURVIVAL
lore:
- '&7Press mine to turn on superhero mode.'
- '&7'
- '&7Press place to turn off superhero mode.'
interact-left:
- 'console: heal %player%'
- 'console: god %player%'
- 'console: fly %player% on'
- 'message: &eYou can fly and no longer be hurt.'
- 'player: [close]'
interact-right:
- 'console: heal %player%'
- 'console: ungod %player%'
- 'console: fly %player% off'
- 'message: &eYou can no longer fly and can be hurt again.'
- 'player: [close]'
commands-sound: BLOCK_NOTE_BLOCK_PLING
commands-cooldown: 1
itemflags: inventory-modify, hide-flags, death-drops, self-drops, unbreakable, item-store, overwrite, cancel-events, inventory-close, move-next, death-keep, placement, death-drops
triggers: join, respawn, gamemode-switch, world-switch
permission-node: itemjoin.dragonhub
enabled-worlds: world
But I also created the below item that is a gamemode switcher. But when switching modes, the above item does go away. The above superhero-item
should only remain in SURVIVAL and should disappear due to gamemode-switch
based on my understanding in the wiki. But when I toggle gamemode-item
between CREATIVE and SURVIVAL, item superhero-item
remains.
gamemode-item:
id: BEACON
name: '&eGamemode Switcher'
slot: 7
lore:
- '&7Press mine to switch to survival mode.'
- '&7'
- '&7Press mine to switch to creative mode.'
interact-left:
- 'console: gamemode survival %player%'
- 'message: &eYou are now in survival mode.'
- 'player: [close]'
interact-right:
- 'console: gamemode creative %player%'
- 'message: &eYou are now in creative mode.'
- 'player: [close]'
commands-sound: BLOCK_NOTE_BLOCK_PLING
itemflags: inventory-modify, hide-flags, death-drops, self-drops, unbreakable, item-store, overwrite, cancel-events, inventory-close, move-next, death-keep, placement, death-drops
triggers: join, respawn, gamemode-switch, world-switch
permission-node: itemjoin.gamemode
commands-warmup: 1
enabled-worlds: world
Thank you for all the testing you are doing. There have been some recent changes I made to creative mode handling which may be the reason for these issues. I am currently working on testing this, I will let you know once I have additional info/a snapshot available.
Everything you stated seems to line up with how I designed limit-modes and the gamemode-switch trigger so there is definitely an issue on my end.
Wow okay, I was wrong, this bug was due to the WorldGuard integration and has existed for well over a year so its quite disappointing that I am just finding out about this.
I have done some tweaks and tested using the item examples you provided. Everything seems to function properly now.
Link; https://ci.craftationgaming.com/downloads Remember to remove your old ItemJoin.jar file
Thanks again for the bug report! Let me know!~
EDIT: Offical release is now available; Link; https://www.spigotmc.org/resources/itemjoin.12661/download?version=542784
Server Version
paper-1.20.4-454
Resource Version
6.0.5-RELEASE-b928
Dump Information
https://ci.craftationgaming.com/dump?id=mimejiyiwe
Describe The Bug
When I add
limit-modes: CREATIVE
to an item, it no longer triggers; aka no longer shows up in my hot bar.Expected Behavior
I would expect the item to show only in creative game mode.
Steps To Reproduce
/gamemode 0
and/gamemode 1
, and still nothing happens. Theoretically,gamemode-switch
trigger should kick in.limit-modes: CREATIVE
and change nothing else. Reload the plugin.Additional Info
There's an gamemode switch example on the wiki that uses
limit-modes: CREATIVE
, so I would expect it to work. But let me know if I'm missing something.Checklist