#Plugin Help

1 messages · Page 1 of 1 (latest)

open fern
#

Hi, let me explain

#

https://prnt.sc/5SG3w7xe_RF2

I have this event on a listener, and it affects the functionality of my plugin on another listener

I just want to know how can i move the action to another listener, i need to import

woeful pendant
#

like call a method from another class?

open fern
#

Yes

woeful pendant
#

make it public, keep an instance of the class and call it thorugh that

#

I'd really recommend learning java before starting plugin dev, it helps a lot

open fern
#
    public void onBreak(BlockBreakEvent event) {
        blockStorage.removeData(event.getBlock().getLocation());
    }```

Something like this
open fern
woeful pendant
#

whaty method are you trying to use

woeful pendant
#

use the entire event handler?

#

like the onBreak method?

#

you can't, its an event handler

solid birch
#

technically you can but it's icky

woeful pendant
#

don't confuse them

#

you shouldn't, so it's not important

#

What exactly are you trying to do? are you trying to break a block?

solid birch
#

I have some context as one of the methods is actually my code

solid birch
#

That MONITOR listener removes block data from a database when a block is broken

#

He has another listener that does some checks to prevent random people from breaking those blocks

open fern
#

I store the block, and it save the data on a database