#Best way to handle specific block interactions

2 messages · Page 1 of 1 (latest)

quiet island
#

So, I am working on a feature on the server side of things for player shops.

These shops will be in-world and I want to handle block interactions for where these blocks are.

The way I have planned to do this, is to have different events check to see if the block interacted with are a certain type of block (Specifically the Display Case block from Cobblemon) and then check a Map<BlockPos,UUID> to see if the position of that block is a valid key.

If it is, then I can use the UUID to get the shop owner and handle all of that.

My question is just to know if there is a better way to have this work that would be more efficient for server performance and what not.

hasty marsh
#

That depends, does your mod need to be fully server side or can it have a client side component too?
If you can have client code then I'd send the positions to the client (as mc usually does) and let them handle the checking.