Class ServerCodeOfConductEvent
java.lang.Object
org.geysermc.geyser.api.event.connection.ConnectionEvent
org.geysermc.geyser.api.event.java.ServerCodeOfConductEvent
- All Implemented Interfaces:
org.geysermc.event.Event
Fired when the Java server sends a code of conduct during the configuration phase.
API users can listen to this event and tell Geyser the player has accepted the code of conduct before, which will result in the
code of conduct not being shown to the player.
Java clients cache this locally, but bedrock clients don't. Normally Geyser uses a simple JSON file to implement this,
but an alternative solution may be preferred when using multiple Geyser instances. Such a solution can be implemented through this event and SessionAcceptCodeOfConductEvent.
- Since:
- 2.9.0
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionServerCodeOfConductEvent(@NonNull GeyserConnection connection, String codeOfConduct) -
Method Summary
Methods inherited from class org.geysermc.geyser.api.event.connection.ConnectionEvent
connection
-
Constructor Details
-
ServerCodeOfConductEvent
-
-
Method Details
-
codeOfConduct
- Returns:
- the code of conduct sent by the server
- Since:
- 2.9.0
-
accepted
public boolean accepted()- Returns:
trueif Geyser should not show the code of conduct to the player, because they have already accepted it- Since:
- 2.9.0
-
accept
public void accept()Setsaccepted()totrue.- Since:
- 2.9.0
-