#Non-depreciated way to check if PlayerInteractEvent is cancelled?
1 messages · Page 1 of 1 (latest)
isCancelled();?
declaration: package: org.bukkit.event.player, class: PlayerInteractEvent
As the title says, it's depreciated.
it shows you in the description
it tells u how to check it then
Pro tip if something in the api is deprecated there's always an explaination in the javadocs as to why and what to do instead
Event.Result
Yeah I read the description, and was able to get the results... but I couldn't figure out how to check if those results are cancelled? Perhaps I'm missing something obvious here :P
if they are allowed then its not cancelled
if denied then cancelled
if default then they are not modified
p sure
and to set cancelled you use setUseInteractedBlock or useItemInHand and pass in the Result
what do I pass the result to? 😅
what
as in, how do I check if it is allowed, denied, or default
if (useItemInHand == Event.Result.Allow)
Same goes for useInteractedBlock