Closed Tanerx closed 8 months ago
getItem().getItemStack().getLocation().getWorld().getName() ItemStack class doesn't have the getLocation() method
Also, why don't you use the event CE provides? https://ajneb97.gitbook.io/conditionalevents/event-types/item-events#item-pickup
ItemStack class
I'm trying to do it this way to learn more about custom type. I changed it as below and I still get the error. I would appreciate it if you could show me where I made a mistake.
PickupItemEvent:
type: custom
custom_event_data:
event: org.bukkit.event.player.PlayerPickupItemEvent
player_variable: getPlayer()
variables_to_capture:
- 'getItem().getItemStack().getWorld().getName()'
actions:
default:
- 'message: &cPickupItemEvent'
- 'cancel_event: true'
You must check the methods of the ItemStack class here: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/inventory/ItemStack.html
I'm testing to cancel PlayerPickupItemEvent event but I'm getting a error. What is the right config for this ?
Full server log: https://mclo.gs/MeL6zzc
Thanks.