Speedgot
PacketInjectorAPI [1.8-1.21.3] - Manage packets easily
-----
Simple API for managing packets. Powered by LightInjector!
Download Now
73.5 KB .jar
Overview
Documentation
Updates (
--
)
Reviews (
---
)
Version History
Discussion
GitHub:
https://github.com/frengor/PacketInjectorAPI
Javadoc:
https://frengor.com/javadocs/PacketInjectorAPI/build-server/
Jenkins:
https://jenkins.frengor.com/job/PacketInjectorAPI/
Example Usage:
Banning a word from chat:
Code (Java):
public
class
MainClass
extends
JavaPlugin
{
@Override
public
void
onEnable
(
)
{
PacketEventManager eventManager
=
PacketInjectorPlugin.
getInstance
(
)
.
getPacketInjectorAPI
(
)
.
getEventManager
(
)
;
eventManager.
registerPacketReceiveListener
(
this
, event
->
{
if
(
event.
getPacketName
(
)
.
equals
(
"PacketPlayInChat"
)
)
{
String
message
=
(
String
)
event.
getValue
(
"a"
)
;
// Might change between mc versions
if
(
message.
contains
(
"bannedWord"
)
)
{
event.
setCancelled
(
true
)
;
event.
getPlayer
(
)
.
sendMessage
(
"§cDon't swear!"
)
;
}
}
}
)
;
}
}
View on SpigotMC
Resource Information
Author:
----------
Total Downloads:
4,538
First Release:
Jun 20, 2018
Last Update:
Oct 26, 2024
Category:
---------------
All-Time Rating:
2 ratings
Version
-----
Released:
--------------------
Downloads:
------
Version Rating:
----------------------
--
ratings
Ask Questions / Get Support