#help-development
1 messages · Page 2072 of 1
then I'd use the chunk's pdc
I wrote a tiny library that allows you to get a persistent data container for every block location https://www.spigotmc.org/threads/custom-block-data-persistentdatacontainer-for-blocks.512422/
ty 🙂
np 🙂
okay im slightly angry at myself
spent all day playing with spawners trying to get them to work for custom blocks lmfao
tried noteblocks
keep in mind my server tps is like 11
11 tps
for some reason my i7 cant run 20tps
probably because i spent all day running /reload confirm on it
9750H
How can that not run 20TPS?
have to keep in mind they are running the client and server on the same system
also they are probably not using optimal JVM flags for both client and server
It's a pretty mid tier CPU lol
maybe do a timings report 😛
I have an i7-4770K so I am going to assume its the non optimal flag usage 😛
yep its just normal java -jar
- only 16 gigs of ram
Only issue with note blocks is event at 20tps you can slightly see the block its at beforehand even at 20tps :((
This is just testing code, so its not organized at all
so ignore unchecked casts etc
LMAO
i think my servers still struggling from spawners earlier
ill send a new video at 20 tps
what happens if you cancel the blockplaceevent after setting the noteblock?
yes
I think currently the client thinks they set a noteblock but then it doesn't happen since there's already a block there, idk
so maybe the client thinks for 1 tick that a regular noteblock is sitting there
you have to force set the blockdata
or manually do setType(Material.NOTEBLOCK)
before applying the block data
Its doing setType here
my idea i had was cancelling blockplaceevent before setting the type but same behavior
just cancels place alltogether
on 20tps its slightly noticable without cancelling
Is there a way to directly get the direction to the player from a certain location?
you can just get the player and then getFacingDirection cant you?
is that a thing? Lemme try that
Location#getDirection returns a Vector
cant remember what vectors translate to in the terms of north south east west etc
oh didn't see. hm weird, then
just subtract both location's vectors from each other
my pc is not only 11 years old but its also by definition falling apart and i still can run at 20 tps with no issue, you got something else going on there
yeah sadly im not sure if its fixable, i could try calling the code in a task but it may create a "input lag" non the less
this gets a location that looks at another location
i was playing with BlockEntities earlier
IIRC oraxen does it without that "lag"
ItemsAdder too
see here
The order matters right? Should the player's location or the armorstand's location be first, because I want to make an armorstand look at the player.
check out the method I've sent
e.g. if you want the direction from Loc1 to Loc2, use Loc1 as original, Loc2 as destination and it returns a location that is at the same "location" as Loc1 but is directly facing Loc2
I'll try that, thank you!
np
ill have to look into theyre src's in a few imma try tunning these as a task rq
So I have this code where it will get the yaw and pitch to make player look at specific location, but for some reason the player looking at the opposite way rather than looking at the exact location.
Location subtracted = enterLocation.setDirection(modelLocation.subtract(enterLocation).toVector());
switch the args
enterLocatino.setDirection(enterLocation.substract(modelLocation)).toVector());
try this
@EventHandler
public void onDeath(BlockPlaceEvent event) {
Block block = event.getBlock();
event.setCancelled(true);
BlockData data = Bukkit.createBlockData(Material.RED_CANDLE);
Candle candle = (Candle) data;
candle.setCandles(4);
candle.setLit(true);
event.getBlockReplacedState().setBlockData(candle);
}
this way you can cancel the event and set the blockdata in the same tick
weird that getBlockReplacedState doesnt exist on 1.18.2
I am on 1.18.2 too
no, it's 15:21
👀
choco I decided to rename MessageAPI to Oyster Message
it can't get fancier than that
did my suggestion work?
Still testing it, one sec.
Shrimp
You know what? It's an improvement
everyone loves oysters
I guess unless you have a shellfish allergy
It doesn't work, still facing the wrong way.
Essentially same issue, where the block is stone for a slight millisecond
However when its 20tps this is a lot less noticable
This is on about 18tps
when i record my tps drops lmao
Yeah you're not going to be able to get around that
Client is placing stone, server tries to place stone, calls event, you tell it otherwise, server has to tell the client "no no no, it's not stone anymore"
Only way you'll fix that is by giving the player a model data'd note block
even then I think it will show as a note block for a sec
ah when i actually add the system for this it will be a modeled data note block
rn its just a modeled data stone atm
i could
make it netherrack/similar material
would make it a lot less noticable
can I add custom data to an Player with a method? smth like player.add(Role.A);, Role could be an enum
Give a note block item with custom model data, set its BlockDataMeta to the note block you want to place
Should be seamless
You'll have to wrap the Player in another class. You can't add methods to an existing interface not in your project (unless you're using Kotlin's extension functions I guess... but
)
ooo actually very good idea
thanks!
yea, I dont want to add a new method, my question was if Player already got a method for custom data, bc I couldnt find one
weird. then just check out the link I've sent above
of course you can add custom data, using the player's persistent data container
thanks
is the potion drinking sound sent by the server or it is played by the client?
pretty sure it's client sided
have you never played on a server with lag? 😛
i only play at 127.0.0.1
thanks
😄
lol npnp. Glad you got it sorted
real chads are idle in the voice chat, listening but never talking
lmao i was silent the whole time figuring this out
that flicker was gonna drive my crazy
and with this i dont even need to handle anything for block place
okay but i will have to handle block break but imma have to do that anyways
You basically just create your own parser
if string endswith "m"
string.remove("m")
Integer.parseInt(thatString);
ban for thatparsedint
I'd use regex
([0-9]+)([a-z]+)
i cant use regex for shit
the first group will be the number, the second group the uit
( ... ) are groups
[0-9] means 0 to 9
and + means (1 or more of the previous thing)
?
why is there a ":"
he was prolly string.split(":")
Oh makes sense
dalton the human compiler
Oh makes sense
@tender shard , I think I found the problem since it's only occurs in 1.16, basically I'm trying to spawn a packet-based armor stand that looking at specific direction, but for some reason the method to set armor stand location in 1.16 is causing the issue.
public static void main( String[] args ) {
String string = "52w";
Pattern pattern = Pattern.compile("([0-9]+)([a-z]+)");
Matcher matcher = pattern.matcher(string);
if((matcher.find())) {
int number = Integer.parseInt(matcher.group(1));
String unit = matcher.group(2);
System.out.println("Number: " + number);
System.out.println("Unit: " + unit);
}
}
np
btw you wanna compile the pattern only once, you can put it in a static final variable
nothing
it's just not needed
it's just a tiny waste of CPU everytime
that looks easy
regex is easy if you know how to write it
String[] splitMessage = e.getMessage().getContentRaw().split(" ", 4);
int endpos = splitMessage[2].length();
int beforeEnd = endpos-1;
String del = splitMessage[2].substring(0,beforeEnd)+"";
String time = splitMessage[2].substring(beforeEnd,endpos)+"";
int delay = Integer.parseInt(del);
TimeUnit unit = getUnit(time);```
i just steal it from google
regex isn't hard at all, the syntax is just a bit complicated sometimes
thats js btw
It's the only way ik how to do it
what is?
i read int as let lmao
sleep exists yk?
im addicted to answering spigot questions
I'm editing the commands.yml file and adding alliases, but some of then don't show up/work.
oponly:
- execute if entity $$1[tag=op] run $$2-
unban:
- oponly @s tellraw @s {"text":"Trying to unban $$1...","color":"red"}
- oponly @s pardon $$1 -
unban-ip:
- oponly @s tellraw @s {"text":"Trying to ip unban $$1...","color":"red"}
- oponly @s pardon-ip $$1
Edit: Found the problem was something else i accidentally edited 🤦♂️
besides that one
also could have a 99% chance of breaking if changing situations lol
idk jack shit about that
pls use formatting
;-;
okay gnight yall
hello, anyone knows what regulates the distance at which a mob spawner works? in the server code
also why u using oponly and weird tellraw
wait
oponly is a command which i added to test if a player has op
the issue might be where u do -ip $$1
CreatureSpawner#setRequiredPlayerRange(int) default is 14 or 16 pretty sure its 16 (IE one chunk away)
the spacing
EW
only thing bothering me are the double parantheses around matcher.find()
how can I create a chat message with a chat command linked, like Click here and then a command get triggered
?chatapi
sad
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
thanks
Trying to do an async block search, how can I execute a task after it’s done?
Can I someone how tell the program to run something after it”s done?
runtask
simply use runTask in the Scheduler
Does anyone know what causes the /command:command syntax to show up in the tab completer, as it only seems to happen sometimes and I'm not sure what causes it
Would there happen to be 2 commands with the same name?
short question
As far as I know, no
whats the difference between .getPlayer() and getPlayerExact();
the docs dont really give much info
I believe getPlayer can do partial names. GetPlayerExact requires the name to be exactly xyz
^
kk ty
My plugin.yml only defines one command, so I'm pretty sure there is just one
Whats the name of the command
tag
and the tabcomplete shows as /tag:tag
I'll go investigate
I mean you can investigate but your command conflicts with a vanilla tag
so you have to specify the namespace
this has happened with non-vanilla commands though
You can execute commands with a namespace
is this okay to retrieve the UUID of a player regardless of if hes online or not? ```java
public static UUID getPlayerUUID(String player)
{
Player pOn = Bukkit.getPlayer(player);
OfflinePlayer pOff = null;
if (pOn == null)
{
for (OfflinePlayer p : Bukkit.getOfflinePlayers())
{
if (p.getName().equalsIgnoreCase(player))
{
pOff = p.getPlayer();
break;
}
}
}
return ((pOn != null) ? pOn.getUniqueId() : ((pOff != null) ? pOff.getUniqueId() : null));
}
then he should be targeted by the last known name
last known to the server
which would also be the last known name to the admin retrieving the uuid
Which could be wrong
huh
yea but
getOfflinePlayers() what i iterate is retrieved from the known player list
If you're doing something that has the word "admin" in it use a database
anyone here have experience with QualityArmoryVehicles? It seems that PlayerEnterQAVehicleEvent never fires for me
public class Mission1PlayerEnterVehicleHandler implements Listener {
@EventHandler
public void onCarEnter(PlayerEnterQAVehicleEvent event) {
System.out.println("cancelled");
event.setCanceled(true);
return;
}
@EventHandler
public void onTurn(VehicleTurnEvent event) {
System.out.println("turn");
return;
}
}
``` it never seems to print fired when I enter a vehicle but turn works correctly
Have you registered the listener?
I mean yeah since the turn shows up
Do they have a support discord? Ask there
every command is registrated as namespaced command + non namespaced by default. apparently naming commands in ur plugin like vanilla commands e.g /op overrides the non namespaced version. you can disable namespaced commands in the Bukkit.yml but i wouldnt suggest it. it gurantees that you can always find your command even if other plugins use the same name.
Yeah you should ask them directly
I couldnt find it so im assuming its private for buyers and it came with a setup that the server owner purchased
ive worked myself in how command maps work the last few days, when registering a command the command gets registered multiple times
Well you'd have to ask whoever made the API
namespaced, non namespaced, aliases
and all the commands then link to one and the same command instance
thats why u get /minecraft:op and /op
/bukkit:reload /reload /bukkit:rl /rl
thats kinda annoying but I see the reasoning behind it
Thanks for the help people
ive actually written this
public static void patchOpCommand()
{
Bukkit.getServer().getConsoleSender().sendMessage("CONSOLE: " + ChatColor.DARK_RED + "Patching OP Command, this must occur after loading.");
try
{
Field mapField = Bukkit.getServer().getClass().getDeclaredField("commandMap");
mapField.setAccessible(true);
SimpleCommandMap commandMap = (SimpleCommandMap) mapField.get(Bukkit.getServer());
Field cmdsField = SimpleCommandMap.class.getDeclaredField("knownCommands");
cmdsField.setAccessible(true);
@SuppressWarnings("unchecked")
Map<String, Command> cmds = (Map<String, Command>) cmdsField.get(commandMap);
Command opCmd = new OpCommand("minecraft:op");
Command deopCmd = new DeopCommand("minecraft:deop");
cmds.replace("minecraft:op", opCmd);
cmds.replace("op", opCmd);
cmds.replace("minecraft:deop", deopCmd);
cmds.replace("deop", deopCmd);
cmdsField.set(commandMap, cmds);
mapField.setAccessible(false);
cmdsField.setAccessible(false);
}
catch (Exception e)
{
e.printStackTrace();
}
}
to override the op command for example
but you can still disable namespaced commands in the Bukkit.yml
if you hate it too much
lol no need for all this
how then
Hello can someone explain me how to use this : java Event.getClickedInventory().getHolder()
loop through Bukkit.getOnlinePlayers() and getOfflinePlayers()
.getOfflinePlayer() is deprecated
if the name equals the input then return the uuid found
Well, what's your use case?
returns the inventory owner iirc
Can't tell you how to use it if you have no reason to use it
ur method has a lot of useless checks
and its obfuscated as well
if you wanna avoid requests to mojang just do as i said
loop through both offline and online players, then in each loop check if the name of the entity equals the input
if so return it
Or use a databse. Log on join.
wat
that sucks
reinventing the wheel
and taking space for no reason
If you want to mess with offline players it has a reason
Bukkit.getPlayer() requests the player from the mojang server?
getOffline does
but i first try to retrieve a player whos online with given name. if that fails i iterate trough Bukkit.getOfflinePlayers() and try to retrieve it from there
why
I create a gui but idk how to check if is the ClickedInventory is the gui
Someone know
just loop through online players and offline players
create a custom inventory and on inv click check if the clicked inventory is an instance of your custom inv
thats why i want to avoid iterations if possible
Databasee
xD
no
WHY ARE YOU STORING
IT.
bukkit already does that for you
youre doing the same
LMFAO
youre gonna loop anyways?
You store the UUID for persistence. You should never use the name to get an offline player
what if i cast getOfflinePlayers() into an ArrayList, getOfflinePlayer() and then check if the arraylist contains the offline player. then this could only be jinxed if 2 players on my server swap names which is highly unlikely XD
yea ik thats what i mean
i just didnt write it out now
Well usually you want to avoid being stuck in that scenario
Hence using some sort of database
but how do i target an offline player by uuid. i mean, isnt it super inconvenient to say like /tempban 123123-2143134-234-234
this
yea database
Store
- Last known name -> UUID
When they join. Do a quick verify and voila it's always up-to-date
OfflinePlayer
Minecraft pulls the skin asynchronously
declaration: package: org.bukkit.profile, interface: PlayerTextures
Yeah. player.getPlayerProfile().getTextures()
http://textures.minecraft.net/texture/b3fbd454b599df593f57101bfca34e67d292a8861213d2202bb575da7fd091ac
Hey I have a problem with a plugin, when the do /fly i put him in a ArrayList but if the player leave the server and come back he is on the ArrayList but when he do /fly the plugin put him again in the list, do you know what I can do to patch that ?
if (TFLY_UTILS.isFlyer.contains(p)) {
Bukkit.broadcastMessage("1");
endFly = (Long)this.getFlyer(p).get(p.getUniqueId());
now = System.currentTimeMillis();
diff = endFly - now;
if (diff <= 0L) {
this.getFlyer(p).remove(p);
if (TFLY_UTILS.TempFly.containsKey(p)) {
TFLY_UTILS.TempFly.remove(p);
}
p.sendMessage("§B§LFLY §8§l» §cVotre de temp de fly est désormais finie.");
} else {
if(!p.isFlying()){
p.setAllowFlight(true);
p.setFlying(true);
}
p.sendMessage("§B§LFLY §8§l» §aTemps restant: §e" + TFLY_UTILS.getTime(endFly) + "§a.");
}
} else {
Bukkit.broadcastMessage("0");
if (TFLY_UTILS.getRank(p).equals("capitaine")) {
endFly = System.currentTimeMillis() + tickUtils.getTick("Heures", 4);
this.setFlyer(p, endFly);
} else if (TFLY_UTILS.getRank(p).equals("second")) {
endFly = System.currentTimeMillis() + tickUtils.getTick("Heures", 2);
this.setFlyer(p, endFly);
}else if (TFLY_UTILS.getRank(p).equals("maître_d'équipage")) {
endFly = System.currentTimeMillis() + tickUtils.getTick("Heures", 1);
this.setFlyer(p, endFly);
} else if (TFLY_UTILS.getRank(p).equals("quartier-maître")) {
endFly = System.currentTimeMillis() + tickUtils.getTick("Minutes", 30);
this.setFlyer(p, endFly);
}
p.setAllowFlight(true);
p.setFlying(true);
TFLY_UTILS.isFlyer.add(p);
p.sendMessage("§B§LFLY §8§l» §aVotre fly est activé profités en sinon il sera perdu pour ajourd'hui.");
}
public static ArrayList<Player> isFlyer = new ArrayList();
Because Player instances are invalidated when they leave
mwoa the bible
Quick fix would be to use a Set<Player> but I personally advise a Set<UUID>
You think if I put the UUID thats work ?
Yeah don't store the whole player object just use UUIDs
Using a List<UUID> would work too, but a Set<UUID> is preferrable
Ok I gonna try thx !
if you use a list check if the list contains the player before, otherwise use a set and use Set#add which returns whether or not the player could be added
but ye uuid's are preferrable
that sucks if u use an arraylist
Literally no point of using it
Thats ok thx you +1
for (int x = minX; x <= maxX; x++) {
for (int z = minZ; z <= maxZ; z++) {
for (int y = minY; y <= maxY; y++) {
if(world.getBlockState(loc.set(x, y, z)) instanceof InventoryHolder) {
...
}
}
}
}
```This is looping from 2 chunks away in each direction (so diag -2 chunk 0 0 to diag +2 chunk 15 15), and its taking a second or two, is there a way i can speed it up
what are you trying to do, that looks rather inefficient
almost looks like you are trying to xray
By not doing it
no its on the server
I am trying to find blocks that are chest-like
genius
imagine
well you are only moving in a diagonal line ... you could use a vector for that
nope
16x16x256
a chunk has a lot of blocks
that code will only run the match when you increment x,y,z so you are moving diagonal only
Chunk#getTileEntities ?
no?
o
lol
rn it only does stuff like, chests, barrels, furnaces, etc
will getTileEntities do the same?
Yes
it gets tile entities
you can find all the silverfish you want now
hm?
I believe it stores them rather than searching for them?
like it has an array of tileentities and whenever one gets added/removed it updates that?
I have no idea how it works tbh
Anyways, there is an event named PlayerInteractEvent, is there one for when the player stops using an item as well?
Guys join the Alex cult today
that was my idea #verified
ik, just spreading the news
ohk
So what exactly is the purpose of this
wdym
What is the purpose of searching through an entire chunk for inventories
I am makin a plugin for someone just wanted to know if I could have made the search faster
as I don't really work with blocks most of the time
mostly player-related data
Are you searching every chunk on-load?
searching for mines and the end portal
lol
otherwise its an abusive greifing plugin
how would i call the two generic types when the one is the start value and the other one is a value after transformation?
K V isnt what im looking for
B and A
hmm
Before After
mhm ye
idc what they use it for
I am just makin what I am told xD
that worked out well for a lot of people
y e s
scary
but like
To Be Answered
To Be or not To Be
TBA x-rated
doesnt search for carwash in tenor gifs
football function
Facebook function
then it would be M E T A
change the A to an I
Ibelievethisisanouput
Input
Output
mhmmh
or was this suggested
btw
after talking about getting uuid from name
i searched in my old projects and found dis
gettin name from UUID?
private UUID getPlayerUUID(String nameOfPlayer) {
return Optional.of(Bukkit.getOnlinePlayers().stream()
.filter(onlinePlayer -> Objects.equals(onlinePlayer.getName(), nameOfPlayer))
.collect(Collectors.toList()).get(0).getUniqueId())
.orElse(Optional.of(Arrays.stream(Bukkit.getOfflinePlayers())
.filter(offlinePlayer -> Objects.equals(offlinePlayer.getName(), nameOfPlayer))
.collect(Collectors.toList()).get(0).getUniqueId()).orElse(null));
}
thats so messy LMAO
I can't even read this
I CANT EITHER
yes
how efficient was it
380 characters
to do what 52 characters also can
if you need that plugin you're just bad at bracket management 
Yeah since its a one liner with no variables
nah i use it because it looks cool
it makes thing look more readable eitherway
i have that too but its rainbow
but why
Who the fuck wrote this
old 2hex
old me
Bro 💀
Lol
The youngest picture of you, is also the oldest picture of you
Jesus christ
You can only buy used mirrors
Performance on that thing would definitely be 0
aaaaah
I did?
nah, -6
I just rate code that Luuk sends me.
yeah
I've never passed anyone
I have to manually give it performance
better than getOfflinePlayer though
LOL
Not really.
ouch harsh
and its O(n) as well
getOfflinePlayer won't crash your server.
itll freeze
& if you need to you can run it async.
OfflinePlayer is O(1) or O(internet speed)
Oh yeah
data
offlinePlayer will run async iirc
since itll send a blocking request
^
getOfflinePlayer()?
it will
Read the rest of the conversation before commenting on the first message you see.
indefinitely being frozen is pretty much the same as crashing
Can anyone help? https://pastebin.com/rJ9WkNUM
Weak
For real
Thread.sleep(Long.MAX_VALUE);
no no
LMAO
I got you a better one @grim ice
cuz it doesnt accept a long
Thread.currentThread().interrupt();
System.exit(0);
java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkArgument(ZLjava/lang/String;CLjava/lang/Object;)V
public void crash() {
crash();
}
OH VM
@grim ice It is a long...
NVM
LOLLLLLLL
don't call crash()
That works too
The JVM: yep that's fine
int[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][] crashArray = new int[100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100];
Not sure as I've never looked into structures myself, but @grim ice should be able to comment on that.
that will sleep for 2924712 centuries
how to get warped into the 74th dimension
its fine as long as u dont spam them
However IO Operations should be done offthread yk
like deleting a structure
It should
Yeh
ohk
now, can i check when a player stops using an item? (Such as: Spyglass, Bow, Trident, etc)
from 1.17.1 yeah structures exist
thats why my entity serializer only works for 1.17.1 :(
kinda limits it tbh
that's pog
#OldVersionsShouldntBeSupported
my whole library is just abstracting an already abstracted concept but add to that a cool strategy
and that's when you give the middle finger to 1.16.5 and lower users
because old versions shouldn't be supported
i also have chunkserializer btw Lol
iirc 1.16.5 is like 1-2 years old
it just takes a chunk makes it a structure and done
but it prob bugs a little
yeah its bugged rn i fucked a little
L
i forgor structures only contain 48x48x48
yeah
do var count = world.getMaxHeight() / 48
i would ceil it
Why is that tho i compile everything in a shaded jar everything should be found 🤔
ceil it
if you floor it you might loose data
Fred. James. Bill
Im trying to make a custom turtle mob right now, but im so confused about all the Classes/Interfaces and when to use what.
There is org.bukkit.turtle, org.bukkit.craftbukkit.v1_18_R2.entity.CraftTurtle and net.minecraft.world.animal.Turtle.
Does anybody know some good resources about all of these?
you can use JavaPlugin#getConfig to get the config of that plugin
and then getString(path) to get a string set at a path
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
Hi, how can i set a block to be a Crop with a specific state? For example wheat state 1
Probably by getting the state of the wheat and setting it
@Override
public void onEnable() {
protocolManager = ProtocolLibrary.getProtocolManager();
System.out.println(protocolManager);
Bukkit.getPluginManager().registerEvents(this, this);
}```
and ideas how this is possible? or why it's happening at least?
with ProtocolLib*
- Did you add it as a depend
- Did you add it to your plugins folder
both yes
its loaded actually at the server startup before worlds
no errors no nothing
is it possible your plugin is getting loaded before protocol?
They recommend loading the manager in the onLoad. I wonder if moving it there would do anything
lets try
it doesn't matter mostly but are u running craft bukkit lol
WHY
no i'm not lol
oh good
if you could read correctly lol
yea i coudn't
also no, on load load does same result
Hmmmm do you have it as a provided dependency in your pom?
how else would he compile it
yea else i wouldn't even get the classes
No no like scope
uhh
<repository>
<id>dmulloy2-repo</id>
<url>https://repo.dmulloy2.net/repository/public/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.18.2-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.comphenix.protocol</groupId>
<artifactId>ProtocolLib</artifactId>
<version>4.8.0</version>
</dependency>
</dependencies>```
I'm guessing because you're shading it in and calling the plugins copy and not the servers 
Anyways have fun with it 
Is there a stop interact event? (like stop pulling a bow, stop using spyglass, etc?)
the answer you seek is when you use the maven shade plugin, maven shades in all dependencies listed unless you use the provided scope (Telling it not to)
Basically
no, those things are client side
alright then
don't think a packet gets sent back to the client to stop doing it
PlayerAnimationEvent go brrrrrrrr
The client would send one
i hate packets
yes the client would send one, but you won't stop the action client side though which is what they are looking for most likely
is it actually possible to send a "custom" packet from a server to the client, which contains the uuid and an integer? if yes, how tf
Yeah that you can't
nope because the client wont recognize it
it might actually disconnect
You can only send from client to server not server to client
unless
the client is modded
it is
that's the thing
i got a fabric mod which sends a packet to the server, perfectly fine
Yes I handle this myself
well how would I check for this?
now i need to send a packet to all connected clients with the sent information (uuid and an integer)
if you send a custom packet to the client that doesn't have a mod to recongize it, odds are the client is going to ignore it or in extreme cases either disconnect or crash the client
Just a scheduler?
last one 
as Mike said, odds are a packet probably gets sent for the bow action from client to server
yes it does
gotta love it
but idk if it does for others
either a event exists for it, or if not you are going to have to use NMS to hook into the relevant packet
such as spyglass/trident
What a work of machiavellian art
almost anything really
I use forge for my stuff 
i mean like
how would i send that packet with that 2 tihngs
protocolManager.sendWirePacket(p, 9000, b); this apparently isn't te right thing... i guess bc the id isn't existing?
you would have to implement your own packet and inject it into MC packet/protocol handler stuff
god
Did somebody saw raw netty
you wouldn't be able to use protocollib because it only helps with mc protocol nothing more
so protocollib goes away
ProtocolLib has a mental breakdown if it tries to read my custom packets
Like huge mental breakdown
like how do i even create such a packet
its just a class that implements the packet structure
and then you inject it into the nettty
and hopefully the client gets it
Gonna need NMS
i do what? 
netty is the dependency that mc/spigot uses for network handling stuff
lol
so i guess like this? lol, gotta love nms when i see that a methods already
reflection is going to be your friend here
actually not sure if reflection is needed 🤔
I think the netty instance is public?
yeah if they were going to mess with already existing packet stuff they would need reflection
but since its a custom packet
i have honestly no idea what tf you guys are talking about ngl
wouldn't be required just inject it into the netty instance
You'll make your packet and send it through netty.
Client will need to have something to receive it
Forge has something a lot more cute which is
Oh you might wanna slap on some mappings where you can
i mean
fabric has this ig? seems to be the same, but idk
ClientPlayNetworking.registerGlobalReceiver(new Identifier("channelName"), (client, handler, buf, responseSender) -> {
});```
i mean it listens to incoming packets
I assume that's for intermod communication.
i can send packets perfectly fine from fabric to spigot
works fine
but i am only confused now about the other way
spigot to fabric
Probably going to need NMS
such names
@Override
public void a(PacketDataSerializer packetDataSerializer) {
}
@Override
public void a(PacketListener packetListener) {
}```
already nms'd me lol
i'm just confused about everything rn
i guess first is the sending action, and second the receiving action? idk
An incoming and outgoing packet
there is channels for sending and receiving
only the packet stuff
@EventHandler
public void kaas(InventoryMoveItemEvent event) {
System.out.println("kaas");
}
why does this even not get called when i move an item from one inv to another one?
you hook into the channel you want for what you are wanting
if you are wanting to intercept packets you hook into the receiving channel
if you want to send packets you hook into the sending one
i just want to send a packet with a player's uuid and an integer to the client.
that's bascially all
did you register the class in the main class?
yes i did
the event gets called when moving between inventories
not when you move it to another slot in the same inventory
IE, chest to player inventory or hopper to chest for example
i checked both and it still didnt fire
then only way you are not catching the event if that is indeed the case is you really are not registering it
or doing so improperly
Bukkit.getPluginManager().registerEvents(new shopsystem(), this);
so... is there any "tutorial" or explaination about those packet shit online somewhere?
the event 2 lines above it does work so that wouldnt be the case
entityPlayer.playerConnection.sendPacket(); Just shove stuff down the pipe till something works 
network programming
god
using an outdated mc version?
1.16.5
How do I get the itemstack of a custom skull
figured, have no idea if it has changed since then
excuse me, what? 
I only use latest api
Also name your classes correctly. ShopSystem not shopsystem 
What you don't enjoy obfuscated source code?
That's like part of the experience
what experience? i'm sitting here with open mouth
how tf would i know what tf a is
or b
or c
or so on
Welcome to obfuscated code
lmfao
obfuscate means render obscure, unclear, or unintelligible.
In your case the second definition fits better which is bewilder
this is what IDE's are for, I usually just have my IDE open up those methods for me
so I can see where they are at
ctrl+b
and then guess further which I need
sometimes its trial and error
you just pick one and hope it does something you want
System.out.println("a(xyz) was called uwu")
Override a base out packet and just override all the methods with super() calls to see what does what.
You have to send it of course
happened many times
so...
this is it for this packet class? or do i need something else for it?
Alright I have a test plugin. I assume you're using 1.18.2
yea
@EventHandler
public void onChat(AsyncPlayerChatEvent e) {
if (e.getMessage().equalsIgnoreCase("send packet")) {
((CraftPlayer) e.getPlayer()).getHandle().b.a(new CustomPacket());
}
}```
i guess...
btw yes, i was just too lazy to make a command
funny as always
lol
anyway, let's test ig
YEAAAAAAAAAAAAAAAAAAA
NICE
so... that means what?
That means step 1 complete
i guess?
Okay wait I need to make a meme
oh no
Or I can't because unreal engine is preventing me from using my PC
Getting minecraft to not do that
Ikr I'm so helpful 
yea agree
uh
its pretty easy iirc
i forgot how to do so
but it was easy
tho
how would i make it realize that those are the same packet? like... where in spigot (i guess) can i say like an id or something that the packet has
There should be an ID field
yes
how would i find that like wtf
Well I'd open up a few packets and see what they share in common
i mean, doesnt look like htat to me
I think a would be it since it's a read byte
i mean, b is a minecraftKey
which is the identifier in fabric
which i can listen to
that may be the "id"
wonders if today is i hate fabric day?
lol
owo?
i dont suppose you could just catch the packet in wireshark and determine it?
communicating with the client from aplugin ?!?!?!
yea with a mod
I was gonna do smth like that for smooth end crystal beams using plugin messaging
with choco's veinminer mod as an example
Hi, how can i set a block to be a crop with a specific state? for example the images i've sent
I'll answer you again
You get the state
didn't see your message actually
Then set it to whatever state you want
Ageable
What does this mean?
the question is exactly that
how do i set the state?
blockstate
declaration: package: org.bukkit.block.data, interface: Ageable
images looked like a platish ything
um....
?
almost all websites don't work without html
yeah obviously
thats a server config
that's how Websites work
that has to do with server settings and what not
they just direct you to a file
No?
most websites stop it from happening
Not all websites use html
dude
most webservers are configured to just ignore the ending
it has to do with teh server hiding get and put commands
no
i mean its just a configuration
it just has to do with url rewrite rules as well as you can just tell the webserver to ignore the endings unless those files actually exist
u can fix it by using this on ur htaccess:
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.html -f
RewriteRule ^(.*)$ $1.html
if your server parses multiple file types, that can have unexpected results
index and index.php are generally the same and you could have your server set to serve php files by default thus you can also put a index.html file in there without problems
Not really if you know what ur doing
I usually put index.html files that have something different 😛
since most of my sites just serve php files lol
ive only seen .html and .php extensions
on my country websites
(3rd world dumb country)
where knowing how to open a pc is genius
depending how you configure the webserver you can literally use any ending you want
or no ending
yea
you can use .html ending for .php files 🙂
lol
mine works with and without the file extension
confuses some people who try to do some weird things 😛
asp, rb, pl, etc
btw im seriously bad at front end
i know basic css properties but
i cant make anything that looks good
you can
anyways goodnight
just have to stop building the walls without the floor
true
but with the html and css knowledge we got from school we arent going to get far
Make your own simple css lib and use it for everything. Do a mobile-first approach and you'll make beautiful websites
HAH
what is a css lib
I BARELY KNOW CSS U WANT ME TO MAKE A LIB FOR IT
You make a giant css file with all your goodies in it
avoid javascript that's for nerds
ah lol
e.g Tailwind
you need to flesh out your back end design first and then you need to figure out what it is you want to show, then you can connect the relevant pieces to the back end. The prettiness comes once you have things working
Bootstrap as well
Bootstrap is ew
ic
get a box and sharpie, draw a square and some smaller squares inside - call it done
when they ask, say you cant afford a computer
SO is there to code your backend for you 😊
that gives me a great idea
I have a new competition for around this years christmas time 😉
depending how things go, I will host the event 🙂
or you could get a spider collection and squish it on paper
not much of a collection if you are squishing them
TIL: player.getItemInUse() does not do what it says on the tin
it has tin?
whats that
I can't tell you now
is that for spigot devs
elfmas
that's like... more than 8 months from now
and?
better
gives you time to learn websites
no that would be too easy
if this event gets popular enough, we could probably get a physical location for it 😄
2hex's place
Should call it 2hexate10
lol
ah yes
perform unauthorized trespassing into a random african kid's house and host an event in it
kekw
sounds like my neighbors
Hey, I'm getting an internal error with NametagEdit, I don't get what the problem is. Stopped, reinstalled the plugin, started already a few times. Here is the error from the console: https://pastebin.com/H1sKe5gP
Yes I too love trespassing into random African kid's houses and partying
shame no one liked the name I gave
7 ate 9
2hexateyourmotherandfather
according to the tv ads here in the US, they don't have houses 🤔
interesting
your search history determines the ads you get you know @vocal cloud ?
if its the digital service, you are out of luck
but it does make one wonder what channels you watch
Jeopardy weeknights at 8
it means 2,6,8,10 but I guess it was too good it flew over everyones heads


