PSN:
PSN, I'm assuming, stands for Psychic Super Narwhal.
Member Details
Hey folks,
How would I listen for Nether Portal Creation? I can't seem to find an event. I'd like to stop them from being created unless a specific condition is met.
Thanks,
JavaMatrix
Rollback Post to RevisionRollBack
If I'm being mean, tell me. Chances are, I'm not trying to be.
I reject your reality and substitute Minecraft.
Java means Coffee and Coding. Matrix means Math and Programmers who Fight Robots. Together, they mean me.
PSN:
PSN, I'm assuming, stands for Psychic Super Narwhal.
Member Details
Thanks for the reply! Unfortunately, WorldEvent.Load doesn't specify dimension and can't be canceled, and PlayerInteractEvent only records interactions like clicking and right-clicking blocks. Thanks for the suggestions, though.
Rollback Post to RevisionRollBack
If I'm being mean, tell me. Chances are, I'm not trying to be.
I reject your reality and substitute Minecraft.
Java means Coffee and Coding. Matrix means Math and Programmers who Fight Robots. Together, they mean me.
Anytime you need to have general "awareness" of what is going on in the game, you can usually use some sort of tick handling event. You should only use them if you don't have other, more targeted, methods to achieve your goal.
To avoid being too much of a processing burden you can skip ticks as well, like only do full processing every half second or something.
Anyway, the idea would be say to handle the ServerTickEvent (on FML event bus). You could keep track (i.e. in a list or array) of all the known nether portals and then when you detect a new one is present you can do whatever it is you want to do -- in this case I guess you'd want to delete it immediately if your condition isn't met?
PSN:
PSN, I'm assuming, stands for Psychic Super Narwhal.
Member Details
Indeed I would... but how would that perform, say on a server with a thousand nether portals (a modest number for a server)? I don't want to induce great gobs of lag.
Thanks for the reply, I've upvoted you for your help.
Rollback Post to RevisionRollBack
If I'm being mean, tell me. Chances are, I'm not trying to be.
I reject your reality and substitute Minecraft.
Java means Coffee and Coding. Matrix means Math and Programmers who Fight Robots. Together, they mean me.
How would I listen for Nether Portal Creation? I can't seem to find an event. I'd like to stop them from being created unless a specific condition is met.
Thanks,
JavaMatrix
To avoid being too much of a processing burden you can skip ticks as well, like only do full processing every half second or something.
Anyway, the idea would be say to handle the ServerTickEvent (on FML event bus). You could keep track (i.e. in a list or array) of all the known nether portals and then when you detect a new one is present you can do whatever it is you want to do -- in this case I guess you'd want to delete it immediately if your condition isn't met?
Thanks for the reply, I've upvoted you for your help.