#help-development
1 messages Β· Page 1093 of 1
public class PlayerConnectionSpoof extends ServerGamePacketListenerImpl {
private static final Connection DUMMY_CONNECTION = new Connection(PacketFlow.SERVERBOUND) {
// Implement the abstract methods here, but keep them empty
@Override
public void setListener(PacketListener packetListener) {
}
};
public PlayerConnectionSpoof(ServerPlayer player) {
super(MinecraftServer.getServer(), DUMMY_CONNECTION, player);
}
}
Then when you create a ServerPlayer:
GameProfile gameProfile = new GameProfile(UUID.randomUUID(), id);
ServerLevel world = ((CraftWorld) location.getWorld()).getHandle();
this.nmsPlayer = new ServerPlayer(MinecraftServer.getServer(), world, gameProfile);
this.nmsPlayer.connection = new PlayerConnectionSpoof(this.nmsPlayer);
thanks wait i will implement it
if you go deeper than 2 levels, torvalds will bonk you
Omg i am so fucking thank you
but is there any documentation about how this connection thing and login procedure works internally in nms i know its nms but has someone done something like this
This is the pure protocol specification. Nothing about the nms internals
yeah i saw this website without that i couldnt have done the Packets for the Player but i meant in code someone who gets over the Project structure of NMS
How might I create a map of locations and block types from a world edit clipboard?
hey, how would i go about adding a custom modeled block using a resource pack? π
Anyone knows if there is an interface to check if a mob is resizable?
There is no clean way to do that right now
*If you are speaking about adding additional blocks instead of replacing them
not adding additional π i meant through mushroom blocks i believe that was a method before?
i think i got the mushroom block thing working but the mushroom block seems to be rendering with my model and overlapping so its weird
for ItemMeta#setFood(FoodComponent) how are you meant to use FoodComponent
are there any implemenations of this interface or an intended way of usage
or do you gotta make an implementation yourself
cupboard can be null
wdym
?img
Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.
Here's some screenshot utilities that you can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org
i sent on pastebin
oh I see
they are two separate methods..
I don't think it's smart enough for that, idk if the rest of the method can return false as well in any other parts?
idk, it's weird but yeah
returns false in other parts, but that's okay. returns true only if cupboard is not null
then this shouldn't happen
How can I add and check if there is a custom NBT tag on an Item π€ ?
quick question if I wanted to remove the +2 Armor +3 Damage text from an Item when I hover it what do I have to change on the ItemMeta?
im trying to remove that from the item
?pdc
For 1.8 :>?
?1.8
Too old! (Click the link to get the exact time)
Yes and?
Heyo, would it be possible to send message as OfflinePlayer? I tried calling the event (AsyncPlayerChatEvent) but it requires Player object. I want to achieve seamless integration with existing chats plugin that may change formatting of messages
how would sending a message to someone that's not online work
pretty much
How can I match the formatting of messages in the server?
He might be trying to integrate it with the chat plugins
Or create a fucked up instance like an npc or something
Exactly, that's why I need the formatting or some other thingy
Add a setting that allows for cutomization
Alright then, thanks for help
Okay
there is a good nbt api by BananaPuncher
you could google it youll find the github repo
surely you're running your own 1.8 fork anyway? you could add your own api for it
im sure your interference would be of benefit if you have less assumptions and more helping:D
(not everyone who makes a 1.8.8 is making it for his own server, version is outdated but was never cancelled on twitter and finally almost nobody runs their own fork, people just run forks please stop with your weirdness :D)
Alright thanks :).
how can I refresh a player's tab? Like have it sync with the server's
yes
where π
I block all tab packets coming from the server during a certain period
I then often get complains from users that a tab plugin isn't working properly
these modifying the outgoing player info packets
you would most likely have to recreate those packets, or just hide and show all players
(so I can't just spoof them myself)
Have you tried capturing and resending at a later point
I thought of that, but then what am I supposed to do during like a player info remove?
also, these can stack greatly
so like a lot of overhead
There isn't much else you can do
it most likely will :/
it won't
what version are you on
1.12-1.21
it sends an update with a single specified player
I can just send my own packets at this point
brother
.
I just said that I'm looking for a better solution as tab plugins break
integerations into those tab plugins for a refresh is possible π
nothing else you can do really
you do know
that literally every plugin can possibly modify tab
you can't really say whether it does
soooo?
way easier
well thats your only choice, the fact that you block player tab packets is actually sad
I guess I have to do research it myself then
canβt do anything about it
what?
what are you on about?
you don't really seem like a good dev to me
unlucky for you
or just trying to make me make a worse plugin
no its just that youβre doing something that is so stupid like blocking tab packets and then complaining about how it breaks tab
is it? I highly doubt that. IvingEntity doesn't have a setSize method, just tried for spider, also doesn't have it
my advice, donβt block tab packets
I already figured out ther is no interface for it
there is a scale attribute
at the end it is a very simple xy problem isnβt it
?xy
livingEntity.getAttribute(Attribute.GENERIC_SCALE).setBaseValue(newScale);
this is from 1.20.5
you seem very full of yourself
you're so small yet act so big
where's this aggresion coming from?
im the aggressive one?
I hope you can read tho
oh you're one of them
you seem very special
can't place you in a majority of any sort
ok π
I love you brother
let's not fight
we just had an unnecessary conflict
peace out
π
It works exactly like the setSize method?
I dont know any setSize method
There is on a few interfaces
if you just want to size those specific mobs, the most specifc interface is just the mob itself
but its only a thing for slimes and phantoms
Yeah, but because it doesn't use an interface, I have to to the implementation for every individual mob
so not a lot of trouble I imagine
No for more
like what
Actually no, you are right indeed
Was just checking
but I don't care about non LivinEntities
I didnt even know you could set the size of phantoms until you told me haha
so I guess I'll just do the implementation like that
haha, I also don't see a reason why you would π
But hey, apperently it's possible
does anyone know what the technical reason is for registering configurationSerializable objects? is it so spigot can find the type to construct for the data when deserializing?
im asking because im trying to make a similar system which might be solved by using registers too
I believe it's mainly done for the deserialization part, and telling upfront that it's use SnakeYML
Because the format is different than a regular YML
right but the whole configuration api is snakeyml
yes partly
whats the other part?
but also because deserialization can happen through different ways for example
that is w constructor, static method, or sometimes even delegated to another class
right
so the registering allows spigot to get all information it needs to create the object
yes
on skibidi
hamburger -> help -> my productivity
@river oracle the idea behind the java private final HashMap<UUID, User> playerData = new HashMap<>();
is to save data later correct?
but what if its not saving?
well I mean you still have to save and load the in-memory-data to on-disk-data
yeah putting it into memory aka java playerData.putIfAbsent(playerUUID, new User(playerUUID, new FileHandler("players", playerUUID.toString() + ".yml")));
then to get it and modify java public User getUser() { return playerData.get(playerUUID); }
use computeIfAbsent
but else
sure
save it on quit event
and load it on the apple event
Did that, and also onDisable.
but when i get that data from Join event theres nothing
im also setting it before anything else with java public void setUser(UUID playerUUID) { this.playerUUID = playerUUID; playerData.putIfAbsent(playerUUID, new User(playerUUID, new FileHandler("players", playerUUID.toString() + ".yml"))); }
well now
ComputeIfAbsent
user = new User(playerUUID, new FileHandler("players", playerUUID + ".yml"));
playerData.computeIfAbsent(playerUUID, k -> user);```
something like this?
never used this before
always just checked containsKey
you are trolling
var user = map.computeIfAbsent(id, key -> {
return new User(key,...);
});
i guess im stupid because i cant get it to work
Hey! I've noticed a fun issue while working on Geyser-Spigot recently - i am currently working on disabling the plugin if it is wrongly configured; however it seems that running Bukkit.getPluginManager().disablePlugin(this); doesn't actually disable the plugin and continues to call onEnable of the plugin.
Relevant code:
https://github.com/onebeastchris/Geyser/blob/detect-improper-setups/bootstrap/spigot/src/main/java/org/geysermc/geyser/platform/spigot/GeyserSpigotPlugin.java#L151-L162 checks in onLoad, that disable the plugin if need be.
However, it looks like onEnable is still called; leading to errors when enabling the plugin. Isn't disabling the plugin during onLoad supposed to stop onEnable from being run? Or am i misunderstanding it?
Do someone know why I can't access any 1_20_R4 nms? I've been working with a multi supportive version but this is the only one giving error
It says cannot find symbol also but don't get any error on intelij
here's my pom :
I don't know why this is happening
It could be the .jar?
bad class file: C:\Users\adriw.m2\repository\org\spigotmc\spigot\1.20.6-R0.1-SNAPSHOT\spigot-1.20.6-R0.1-SNAPSHOT-remapped-mojang.jar(/net/minecraft/core/BlockPos.class)
class file has wrong version 65.0, should be 61.0
Please remove or make sure it appears in the correct subdirectory of the classpath.
Should I download it using java 17?
Getting this error with build tools https://pastebin.com/E9at5p2p
Any Ideas?
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Tried with 21 and 22
Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.13.0:compile (default-compile) on project spigot-api: Fatal error compiling: error: release version 17 not supported
oh its build tools
I used java 21
Just ran /lib/jvm/jre-21-openjdk/bin/java -jar BuildTools.jar --rev 1.21.1 --remapped
use git
Sorry?
I know what git is. I just need the shit in my m2 folder
okay thanks anyway
build tools should put things into your m2 automatically
ayyye y2k im stupid and need helps if your willing
not atm I'm busy
okay
Yes, but it keeps failing to run
I have tried java 17, 21, and 22
/lib/jvm/jre-21-openjdk/bin/java -jar BuildTools.jar --rev 1.21.1 --remapped
what minecraft version
I have tried 1.21.1, and 1.20.6
same error
I also cannpot get the gui to open
what is the command to open the gui?
double click the jar if you don't have a .desktop file to open them use java -jar BuildTools.jar --gui
though I'd just reccomend making a .desktop file for jars
Same error with gui
as expected
I am going to downgrade build tools and see if it helps
show the debug information as well in a paste too please
show your debug info too please
What is the flag for debug info?
wrong java version by the looks
almost definitely
ignore me I was scrolled up
but debug info shuld show if they have other versions installed
I have like 5 other java versions installed
I onder if its cause they are the red hat varients?
please send Debug Info in a paste and we'll go from there
Yep working on that. Running it rn just loading
If I try using java 8, it just stops me right away, saing unsupported java version
java 21 and 22 get stuck here
- You have all JRE's you can nolonger buildand run spigot with a JRE
- Java 22 is still a bit buggy especially on windows, not sure about linux, but I've seen nothing but issues
Download a JDK version for java 21. Ensure it is selected when compiling.
Oh shit they use the microsoft one now right?
as of the switch to 1.20.6 I believe
JRE's are trash anyways
especially if you are a developer having a JRE is worthless
as a user JRE's also just limit the software you can run
Okay that would explain it. Installed, runnning now π
what about JBR
thats a jdk technically
Same error with 21 jdk :/
sudo /lib/jvm/java-21-openjdk-21.0.4.0.7-2.fc40.x86_64/bin/java -jar BuildTools.jar --rev 1.21.1 --remapped
I tried both
for some reason buildtools thinks you're using java 17 here's what I'd do
open the GUI
and explicitly set the jar
its possible maven may be falling back to your default JRE which is at 17
that or set the JAVA_HOME env var in your terminal once around for this
Oh thats smart. Okay Ill give that a shot. Can I enable remapped from the gui?
Okay ill give it a shot
if that doesn't work change your JAVA_HOME to direct towards your java 21 JDK in the command line
then run buildtools with java should pickup on the change automatically
Kniw the command to do that off the top of your head?
just set a variable in bash
okay Ill try the tool first
Okay thanks for the help β€οΈ
you must go
That worked. Thank you so much!
New error! π
java.lang.ClassCastException: class org.bukkit.craftbukkit.v1_8_R3.block.CraftBlockState cannot be cast to class org.bukkit.block.Furnace (org.bukkit.craftbukkit.v1_8_R3.block.CraftBlockState and org.bukkit.block.Furnace are in unnamed module of loader 'app'
this error happen when the block isnt furnace?~
check if it's a furnace before casting
blockstate instanceof Furnace
or check the block Material before getting the block state
can i remove from the cache while i interact?
Collection<Furnace> furnaces = furnaceService.getAll();
for (Furnace furnace : furnaces) {
Block block = furnace.getLocation().getBlock();
if (block.getType() != Material.FURNACE && block.getType() != Material.BURNING_FURNACE) {
furnaceService.remove(furnace);
continue;
}
@Override
public Collection<Furnace> getAll() {
return cache.values();
}
@Override
public void remove(Furnace furnace) {
furnaceRepository.delete(furnace);
cache.remove(furnace.getLocation());
}
not like that, you should use either the collection's Iterator (and call Iterator#remove to remove the "current entry"), or use something like Collection#removeIf
i would like service.remove
isnt possible with iterator then
uh you could pass the iterator instance but that's yuck
alternatively, you can copy the collection before iterating it
i ll make this @Override
public void remove(Furnace furnace, boolean cacheRemove) {
furnaceRepository.delete(furnace);
if (cacheRemove) cache.remove(furnace.getLocation());
}
and use iterator.remove
and remove method with false boolean on 2ΒΊ arg
its correct right
and so when you remove an entry from the original one, the copy won't complain about removing while iterating (since you're removing from another collection)
eh, I am not a fan of this approach tbh, it just doesn't feel right
it feels error prone, what if you forget to pass the correct value you're intending to pass?
Somehow fixed after a restart? Welp Im happy
I prefer it this way. I'm not going to create a new list for this
another solution is to have a method in furnace service, like, "removeStaleEntries" or something, that calls removeIf on the values and such
I mean you don't have to create a new collection, it's just one option out of many
if you're okay with that solution, go for it
thx
How could i make something like this?
Is that a plugin?
clear your caches
fully
oh well if restarting fixed it W
I think that is what it was. They were in like some temp folder. I kept deleting them, but I dont think they were actually being removed. Restarting allowed me to remove them all the way. Maybe cause I ran as super user to test one time... ? Not sure. Working now though
I'm wondering if this is a book
Nvm, would be hard to get the hover message I think
I think so its for an smp they gave me a mod but its just for keybinds for the abilities
Yeah actually reading into it, hover and click events are supported in books, although you can't force the client to open a book.
Are you right clicking an item to open the GUI?
No it opens on join
Is it a 1.8 server? I think that version you could force players to open a book
isnt there Player#openBook?
Tbh I haven't looked into it too much. I just remember trying to open a writable book for a player. Maybe it works for already written books
Could you send me like a wiki or vid abt it as i canβt find anything online
What part? The server is likely using a resource pack which will be the hard part
https://www.spigotmc.org/wiki/the-chat-component-api/#events
Here's components for hover messages
Yes but it won't work without the player holding a book
Its so strange
Client moment
[ERROR] Failed to execute goal on project BetterShops: Could not resolve dependencies for project me.saif.bettershops:BetterShops:jar:0.0.1: The following artifacts could not be resolved: me.saif.bettershops:API:jar:1.0-SNAPSHOT (absent): me.saif.bettershops:API:jar:1.0-SNAPSHOT was not found in https://hub.spigotmc.org/nexus/content/repositories/snapshots/ during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of spigotmc-repo has elapsed or updates are forced -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
I'm thinking API is not being built before dependencies are being resolved
how do I ensure API is built first. I can do it via intelliJ but i want it such that if the repo is cloned, anyone can just build it
i'm running mvn clean install btw
oh my god
i swapped the order of API and Plugin in the parent pom
putting API firt fixed it
In case you are unaware, but you can place dependencies needed for modules in the parent pom and therefore not duplicate your dependency lists as well as ensuring projects sharing a dependency all have the same version.
yep, did that
Love setting up module projects because of that
how do you create an empty pdc?
This is probs just an inventory ui
You need to get the adapter context from an existing PDC and call newPersistentDataContainer() on it.
What do you need this for?
Nothing special, just custom fonts, as well as tooltips
adding a tag container to an item's pdc
also, ty
Compare different mappings with this website: https://mappings.cephx.dev
perhaps cause you're severely outdated.
Several ways but they all require either nms or packets
hi can I ask about NMS code here?
are you updating it?
Sure, but its generally not supported
You can see the new way of declaring dependencies @orchid trout : https://packetevents.gitbook.io/docs/getting-started
do you have any tutorial?
i've tried thiss
but somehow the method og g return to float
nolonger null
if you prefer videos there are good ones for learning packets and nms on yt
1.12 lays quite a bit in the past. You basically have to look into nms and fix this yourself by understanding the code.
oh ok
can i have a link please?
to "reload a chunk" (I mean change its blocs) sending a new chunk data packets is sufficient or I need to unload it?
sure
https://www.youtube.com/watch?v=5AVezxCH-oM
https://www.youtube.com/watch?v=KT74rgElSi0
https://www.youtube.com/watch?v=2FcnwD2MHOA
(the last use protocol lib but packets are explaineds)
Do you want the player to see something else than whats on the server?
exact
Spigot has methods to send blocks to the client
just to the client (not real chunk content?)
declaration: package: org.bukkit.entity, interface: Player
Or for a single block:
https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/entity/Player.html#sendBlockChange(org.bukkit.Location,org.bukkit.block.data.BlockData)
declaration: package: org.bukkit.entity, interface: Player
bruhhh ;-; i just didn't know where is the g() in spigot 1.11 gone when update to 1.12
this is 1.11
can be used for sending a lot of blocs? Imagine I should change all the chunk (+-70 000 blocs)
Nope, def not
I should use nms so
Reading decompiled code makes it even more difficult.
Im so glad i dont have to work with ancient versions like that.
What are you trying to do in the first place?
I am making a replay system, I want to sent the old chunk to the player (chunk when the record start)
That is going to be unimaginably expensive
This might be a really really tricky system to develop
How do you track those chunks?
sure no replay plugins really restore the chunk
first I wanted to use packet events I intercept all chunks load packets and store it if I start a replay I get the packet to resend it to replay the problem here, is that if between the time the chunk packet is loaded and the chunk is modified I have to update this packet but manipulating chunk packets is quite complex and I would have liked to do it differently, then I thought of nms with this code (I had to recreate a similar chunk to send it but it didn't seem to work) and here I am
(I can show you the nms code if you want)
One way to do it @sterile breach is have the world presaved as a slime world, Load it when you need it. Then do what hypixel does and track when blocks are broken, and when blocks are placed.
just the basic explanation
They of course do more than just blocks
Ihv already done the replay code itself the problem is the map
What kind of map is it? Skywars? Generated?
ah I see
in other worlds
Yeah depends on how big the world is. But I would still recommend slimeworldmanager or whatever to store the world in.
Itβs a very optimized format to store worlds in
And they load quite fast, in memory
to replay I tp my player here and replay on the map
We are talking about possibly terrabytes of data here. Its not viable.
The only way to handle this, is to save deltas, and not the entire world.
so I should save chunks
hi, can somebody help me i get this exception whenever i try loading in my world Caused by: net.minecraft.ResourceKeyInvalidException: Non [a-z0-9/._-] character in path of location: c:\\users\\oussama\\desktop\\iyad\\minecraft server\\plugins\\eftm\\eftm worlds\\eftmtemp at worldCreator.createWorld(); I dont think the world is the problem cuz i really just downloaded a parkour world for testing and renamed the main folder to eftmTemp and placed it in the correct path, this is the only exception im getting.
Nope, just the changes to chunks so you can reconstruct them later on.
In other words, the deltas
I am not sure to have understood but if this is what I think (do what happened on the chunk backwards) is not possible because chunk can change after record (maybe I want to replay it 5 hours after record and between the end record and start replay chunk can change for others reasons)
save the timestamp next to the change
maybe the tick counter
Yes, you need to keep track of every single change that occurs in any chunk ever if you want a replay like that.
Remove the space from your "minecraft server" folder
okay I save all actions everywhere (at least where necessary) or I get bukkit chunk and convert it to send it into chunk data packet
Just make sure you understand what this means. Because its an actually complicated and delicate problem to solve.
Look at CoreProtect. They actually have the entire logic built already. You might be able to just use them as an API for yourself.
ah yes coreprotect can do the job
You would have to read their DB and apply the actions retrospectively on current chunks. You will have to do a lot of multithreading and async programming to make this not straight up crash your server. And a very clever format to keep the entire replay in memory.
I hope you have a ton of experience, because this sounds like a very advanced project
sure
I dont have your knowledge but I realize that it seem to be more optimized to just send an update chunk packets no? (to restore with the coreP I should to send a lot of packet (can be bigger for the client))
make a field X and Y and show in the config the formule like this
(X* level) + (Y * difficulty)
Our fellow dev boxbeam created a really nice expression parser
You can literally do something like:
attack-power: "cos(0.5 * level) * log(3.5 * difficulty^2)"
etc
This dependency is meant to be shaded. So you will basically "copy" the entire code into your own project, making it available on
runtime. The server owner doesnt have to do anything.
Just add those two entries and make sure you have the maven shade plugin installed in your pom.
Caused by: net.minecraft.ResourceKeyInvalidException: Non [a-z0-9/._-] character in path of location: c:\\users\\oussama\\desktop\\iyad\\minecraftserver\\plugins\\eftm\\eftm worlds\\eftmtemp
i removed every space
Im still seeing one. Anyways, is this map downloaded from somewhere?
yepp from a website, lemme try fixing the space thingy first
guys
if (this.passengers != null) {
EntityLiving passenger = (EntityLiving) this.passengers.get(0);
this.yaw = passenger.yaw;
this.lastYaw = this.yaw;
this.pitch = (passenger.pitch * 0.5F);
setYawPitch(this.yaw, this.pitch);
this.aN = this.yaw;
this.aP = this.aN;
float speed = 0.4F;
this.k(speed);
Float speedmultiplicator = 3F;//Here you can set the speed
sideMot = passenger.be * speedmultiplicator;
forMot = passenger.bf * speedmultiplicator;
if(forMot <= 0.0F) {
forMot *= 0.25F;// Make backwards slower
}
java.lang.reflect.Field jump = null; //Jumping
try {
jump = EntityLiving.class.getDeclaredField("bd");
} catch (NoSuchFieldException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
} catch (SecurityException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
jump.setAccessible(true);
if (jump != null && this.onGround) { // Wouldn't want it jumping while on the ground would we?
try {
if (jump.getBoolean(passenger)) {
double jumpHeight = 0.5D; //Here you can set the jumpHeight
this.motY = 1D; // Used all the time in NMS for entity jumping
}
} catch (IllegalAccessException e) {
e.printStackTrace();
}
}```
this is my code for making rideable entity in 1.12.2
the left, right move and jump working
but i don't know why
Anyone know how to use external dependencies w NBT-API
the move forward and move backward it not
can someone help pls
Are you using maven?
yeah
Then just add NBT-API as a dependency to your project (with the provided scope), and install npc-api on your server as well.
Debug it with messages. Check if anything is 0.0 in there.
I don't need to shade it right?
Nope, the rule is:
If its a plugin you have to install on your server, then you dont shade it.
Otherwise the classes will be present multiple times on the classpath. Once from the original plugin and once from you.
Caused by: net.minecraft.ResourceKeyInvalidException: Non [a-z0-9/._-] character in path of location: c:\\users\\oussama\\desktop\\iyad\\minecraftserver\\plugins\\eftm\\eftm_worlds\\eftmtemp
I see, let me try that
Could be a problem with the world. There might me modded items/blocks in it causing this problem
i tried making my own empty world witha couple of blocks, set up the spawn point, i deleted all data inside folders and renamed it properly
but didnt wokr
gave me same thing
Your File declaration is kinda scuffed
whats wrong with it
The double backslash is unusual. I would recommend using nio
i never heard of that could u explain please
Wait...
Then name of your world is
"c:\\users\\oussama\\desktop\\iyad\\minecraftserver\\plugins\\eftm\\eftm_worlds\\eftmtemp"
That is not a valid name for a world
whyy
Im just realizing what you are doing right now
Because thats not a world name, thats an entire path.
A valid world name would be "world" or "cool-server-world", but not "c:\\users\\oussama\\desktop\\iyad\\minecraftserver\\plugins\\eftm\\eftm_worlds\\eftmtemp"
but but but
they said i could use a directory instead of a name
if i want to not have my world in the main server files
The WorldCreator takes in a String. And this String is the name of your world. Not the path to your world folder.
The world folder is defined when the server starts.
wait a sec so i have to pace the eftmTemp where?
One moment, let be check if you can use a relative path there
But you can for sure not use an absolute path
Caused by: net.minecraft.ResourceKeyInvalidException: Non [a-z0-9/._-] character in path of location: minecraft:plugins\\eftm\\eftm_worlds\\eftmtemp
Nope, you are bound to the world container
So the name is a folder in your worldcontainer
No relative path allowed
so where do i place the world
guard clauses, comments, better variables names
Then check which value is being set when the player moves forward
multiplicator
worldcontainer. On default its right where your server jar is.
you mean a multiplier
yo is a good way of getting better finding plugins and almost remaking them
so i just place the world folder in the main server folder?
For some reason, the dependency I did earlier is not working
<dependency>
<groupId>de.tr7zw</groupId>
<artifactId>item-nbt-api-plugin</artifactId>
<version>2.13.1</version>
<scope>provided</scope>
</dependency>
depend: [NBTAPI]
"NoClassDefFoundError"
Yeah, why not. Could also come up with something new, but remaking old plugins is fine too.
it 0.0
Did you add the codemc repo?
I've found success in having an idea and just working on it
doesn't have to be the best work but just work
Yeah
@lost matrix This worked!!! thnx man
<repository>
<id>codemc-repo</id>
<url>https://repo.codemc.io/repository/maven-public/</url>
<layout>default</layout>
</repository>
How do you compile?
Uh
I just use the build thing and it goes to the target
bruhh idk why the forward and backward not working hmmm
Its like directly in my folder
but right and left side working
So... do you build artifacts or do you run maven goals?
Artifacts
So you could also just delete your pom because you dont want to use maven.
I swear this comes up twice a day. I need to write a ?maven command
When using maven
- Never manually add any dependencies/artifacts to your project
- Always manage everything through your pom
- Always build using maven goals
Specifically for you:
Go to the top right of your IDE
Click on the maven symbol
Open your project name there
Open Lifecycles
Run clean once
Run install once
I see, thank you
And from now on, you only compile using maven lifecycles
@lost matrix i found out the issue
the new 1.12.2 a() got new f2
it was the forward
so just use the passenger f2 and set for vecile and done
thank you so much @lost matrix
Glad i could help
Can someone help me make a clickable placeholder for essentials
you need a class that extends PlaceholderExpansion()
override persist, onRequest, getIdentifier, getAuthor, getVersion
onRequest is the big thing
player and params
placeholder has a page on how to make extensions
but I dont think this is really what you wanna do
override fun onRequest(player: OfflinePlayer, params: String): String? {
if (params.equalsIgnoreCase("thing")) {
return "some cool string"
}
}
have fun bye
How does that do anything clicking a chat message
Doesnβt have what Iβm looking for
omg are their docs kotlin!?!!!??
huge W
you would have to explain what you mean in more detail
no I just wrote it in kotlin
based
good
I've been converted
my condolences
it's great over here
now I see why people ping you for kotlin
It only burns the eyes a little.
no
wtf
you code in rust, your eyes presumably are already just a single burning pit of delusion
As someone who's had to go through salt water training on the eyes, I can say looking at rust code hurts more
Whenever a player should die in an EntityDamageEvent, I cancel the event, set the damage to 0, set the fall distance to 0, however when they join back they still die?
Perhaps change the health instead of the damage or something
example:
@EventHandler(ignoreCancelled = true)
public void onEntityDamage(EntityDamageEvent event) {
event.setCancelled(true);
event.setDamage(0);
event.getEntity().setFallDistance(0);
if(event.getEntity() instanceof Player player) player.kickPlayer("heyo");
}
fuck you
I'm stupid
Always blame the code, we are all victims.
nah bro the hell is that nick π
how delete shadow text? 1.20.1 witch resource pack
gongas aka reeachyz aka zaugusto aka ola i assume
Are you the real rustMINE
no wait nvm
that guy uses 1.8
ah so, you can't set an offline player's fall distance
https://github.com/PuckiSilver/NoShadow check out the commits before 1.20.6
makes fucking sense
Any way to serialize something without the == type thingy?
Donβt worked wich itemsadder
type annotation in yaml
^
too small project to do that
wym
or maybe yall know how to deserialize a list of objects?
parse a map list
After loading the shader into our resource pack, the item adder stops working
Even without a plugin
yea but i have to do unsafe casting to read the props
then ask their support
skill issue
what kind of objects
we are not itemsadder
You need it in the resource pack, donβt you?
based
yes π
map list returns Map<?, ?> and ConfigurationSerializable takes Map<String, Object>
rad do I sleep yet
ConfigurationSerializable
how else is it gonna work? telepathically
It's only 4:09
yea
well you would ideally deserialize it reverse serializing it... like how did you serialize it?
or wait
i know what you mean
Would you tell me a bedtime story in a couple hours rad? :p
chat I just wondered why my code didn't work when I didn't even compile
this is how i serialized it
no π
i don't ask tho
YES I DID IT
But IF you did
I FIXED MY CODE RAHHHHHHH
dub
I don't ever have to fix my code because it always works π
sure buddy
Don't ask me about legacy string parsing
Bros name is TextComponentImpl{color=...

what could be the cause of my server straight up taking 15s to load on one specific world π whenever I respawn it takes so fucking long lmao
You remember before I knew of minimessage I was doing the & formats manually to gradients kek
its instant everywhere else lmao
components for chat, string for anything else
yup
wtf
getList() should deserialize the objects for you
do i just trust the casting
I am actually gonna go sleep tho, neurologist said I should be sleeping 10-12 hours a day...
yes
what a waste of time
cringe
absolutely real
Though I should abide, I've been skimping the sleep since january
you can catch ClassCastException probably
Anyways bye everyone, love you guys, especially rad β€οΈ
ItemStack item = (plugin.getConfig().getItemStack("gkits.gkitbuilder.option1.builderspick.item"));
anyone know why this only returns null?
soryy i couldnt format i dont have the button on my keyboard
probably a bad path, or the entry at that path is not an ItemStack
yeah that's wrong
oh
that's for deserializing ItemStack
it has to be a serialized ItemStack
whats that
thing:
apple:
==: org.bukkit.inventory.ItemStack
type: IRON_DOOR
meta:
==: ItemMeta
meta-type: UNSPECIFIC
display-name: grey leno
lore:
- Lore 1
- Lore 2
- Lore 3
essentially writing an ItemStack class data into a yml
I suppose
its the class serialization
oh alr ty
this is automatically written and read by spigot
you just have to either provide or get the itemstack back depending on what you want
ok tyvm imma try it now
ahh nobody recommending my lib even though it has more functions π
yeah
deal with it
more functionality but functions worse
jk
had throw in some word play
real
average magma skill issue
in my defense I modeled this after blockbench which makes sense since you make models with blockbench
problem is blockbench doesn't provide data when it is default
even though it is significant
well... shit
ngl blockbench is kind of a messy system
the way it handles storing data is baffling
scheduler, kick sync
why no replay mod xD
me?
yea the camera flight looks so cool and then it itches out at the end
I've actually never used that mode before, testing it real quick it actually doesn't work all that well because the final encounter is doing too much packet trickery
also this shot was mostly for my team to brainstorm some stuff, not for any kind of serious use
What should I do if someone is in a web and damages a player? Should I control the webs on the map and walk through them and if there is a player in the web, deal damage? Or should I walk through all the players and if any are in a web, deal damage?
Ah XD looks great anyway!
yeah I'll be recording an actual video today
kind of is a shame about the replay mod though
i think keeping track of the players will be easier
==: org.bukkit.inventory.ItemStack
type: DIAMOND_PICKAXE
meta:
==: ItemMeta
meta-type: UNSPECIFIC
display-name: &cBuilder's Pickaxe
lore:
- ChatColor.AQUA + "Builder's GKit" + ChatColor.WHITE + "Item"
anyone know how i would color code the lore and the display-name idk how to
its yaml not java
sorry if im being dumb or anyth i started this yesterday haha what does that mean?
you cant write ChatColor.whatever or do plus operations (or any operation)
oh
actually the replay mod might be viable
or do i have to edit itemmeta
you also can;t use &c as it will not be translated when deserializing the ItemStack
yes use the & or section symbol or whatever
alr ty
for example
or some custom method and then replace it in your code
noone has
I do
oh
its annoying af
its a mac thing i think
just copy/paste
what
I have a swedish keyboard. It's in the top left
where is your hashtag
shift + 3
its not on a UK keyboard
its not on my qwerty either
are you on an imac?
no
oh
wtf is 1/2
Β½
thats a really random thing to have ona keyboard
weird keyboards
its the most common fraction but still
yeah
This is my keyboard layout
when did you ever use that
bro has degrees
Meanwhile mobile
mines just a 60% keyboard
I can type a bunch of stuff via long-pressing
amateurs.
cant wait until im home and have arrow keys again
Ρ
’§°«»¿
i hate having to press function for everything i do
Β£ay
quick questiion if i want enchantments do i just add enchantments: etc
create the item via code, then config.set("path", itemStack);
Imagine a plugin that would let you write any object into a bukkit config for debugging/testing purposes
omw to serialize Player
I mean as long as you can dump it into base64 you can do this with a single method
omw to serialize server states
replay mod but for servers
gson reflection magic:
dropitem or dropitemnaturally to player death? what the minecraft "use" for player deaths
but less performance?
==: org.bukkit.inventory.ItemStack
type: DIAMOND_PICKAXE
meta:
==: ItemMeta
meta-type: UNSPECIFIC
display-name: Β§bΒ§lBuilder's Pickaxe
lore:
- ""
- "Β§bBuilder's GKit Β§bitem."
enchants: "DIG_SPEED=5"```
how do i format the enchants: it keeps messing it up
ive tried without "" but it didnt owrk
wokr
did you add it in game then save?
illl try that
create the item exactly as you want its final form to be
then config.set to save it
how would i config.set from ingame would i have to make a command
yes
trigger however you want
idk its a loop regardless, either keepong track of all cobwebs ever whoch idk how you even wanna do that, or loop over all players
where is config.set
rn my onnly way to acces config is trhoug my listeners
getConfig().set
oh
PlayerMoveEvent, check if player is in cobweb start damaging, srop damaging once playwr leaves cobweb
i did it but i dont think that my config saved
how do i make it so that i can have a config.yml in the plugins folder
getConfig().save()
is it not in yoru plugin folder?
then saveDefaultConfig();
at teh beginning of onEnable
no
ok will do now
is that all i need to do
will it make a config.yml now
yes, if it's already in your jar, it gets copied to the plugin folder
it didnt save it
ItemStack iteminhand = event.getWhoClicked().getInventory().getItemInHand();
plugin.getConfig().set("gkits.gkitbuilder.option1.builderspick", iteminhand);
}
thats what im doing rn
idk if its right
so check if it isnt null?
also save it after set
oh
io in the main thread go boom
when i do getconfig().save it wants me to give it a file or smth do i just put config.yml
erm, no
what do i put in the save() arg
nothing. getConfig().save()
it wants an argument
its saveconfig()
bukkit moment where half the items are air and the other half are null
ty
Plugin#saveConfig()
ty it worked
Isn't replaymod just saving packets?
I corrected myself after saying that
?pdc
Idk if the recording messed up or the server did but I got it working g correctly
Actually, I wanna see a plugin that catches all packets and then replays them
I wonder how messed up it would be
BROOOOOOOO
playermoveevent is bomb way
playermoveevent is called +1000 times per second brother
I prefer to cycle through all players on each tick
https://paste.md-5.net/ukerulugih.cs why only items on backpack drops?? OBS: items on backpack have the same debug on combineitemstacks
that doesnt really sound any better
I mean you can listen to the move event and do some debouncing
whats an example of a tooltip with ItemMeta#setHideTooltip()?
like durability or something?
or the box you get when hovering over it?
event.getWhoClicked().getInventory().addItem(item);```
would this work with the * or na
what are you expecting this to do
give me all of the items from gkits.gkitbuilder.option1
yeah you gotta loop
like
when you do ItemStack item you're assigning whatever your config has to that
an ItemStack is just 1 item
you cant assign several ItemStacks to 1 ItemStack
true
how would i do a for loop
like a
for item in bla
cause then
i could just
for each item in the *
YamlConfiguration#getConfigurationSection#getKeys()
in getConfigurationSection you pass gkits.gkitbuilder.option1
and its keys will contain every subsection in it
oh hashtags are used to convey you need an object of the class there
plugin.getConfig().get("gkits.gkitbuilder.option1").getValues(true).forEach...
yea
or something close
for future reference, because you will get this more
when people do like ItemStack#getItemMeta()
we mean you need an ItemStack instance on which you do .getItemMeta()
not literally "ItemStack#getItemMeta()"
ty guys
anyway back to my question, does anyone have an example of a tooltip in the context of ItemMeta#setHideTooltip()
durability/the box you get when hovering over an item or something else
its to hide the whole text box
so the thing you get when hovering over an item
Does someone know if this is a public command handler?
/head is for example a main command to put a item on your head
And /head main has the same feature
But with /head help you get the help menu with that commandhandler, so you also can have multiple subcommands
sounds pretty easy to do..
uhu
if its open source you can see if its a library they used
This is on a server i play but every command in their server core is with this command handler
So i was wondering if it was a public command handler they used because it seems cool
Yeah i also think it is custom or a edit of a existing one but i will ask it π
bomb way
yes
@EventHandler
public void onPlayerDeath(PlayerDeathEvent event) {
Player killPlayer = event.getEntity().getKiller();
System.out.println("a");
if (killPlayer == null) {
System.out.println("b");
return;
}
why killplayer is null if i kill him?
That's the entity that killed him. Was he killed by a player?
yes
and b is printing?
yes
Try EntityDamageByEntityEvent and check if health less than or equal to 0
π
I would like to know why this doesn't work
maybe becaused spigot.respawn is called on other playerdeathevent?
If you have multiple listeners it might cause issues, but if respawn is called before getKiller might turn null


