#help-development
1 messages · Page 1248 of 1
package FineGamez.me.isometricView.managers;
import FineGamez.me.isometricView.IsometricView;
import FineGamez.me.isometricView.helpers.Enum;
import org.apache.commons.lang3.Validate;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.entity.Player;
import java.io.File;
import java.io.IOException;
public class GamemodeManager {
private final IsometricView plugin;
private FileConfiguration config;
private File GamemodeFile;
private YamlConfiguration GamemodeYML;
public GamemodeManager(IsometricView plugin) {
this.plugin = Validate.notNull(plugin, "Plugin cannot be null");
this.GamemodeFile = new File(plugin.getDataFolder(), "Player_GameModes.yml");
if (!GamemodeFile.exists()) {
try {
GamemodeFile.createNewFile();
} catch (IOException e) {
e.printStackTrace();
}
}
this.GamemodeYML = YamlConfiguration.loadConfiguration(GamemodeFile);
}
public boolean SetGamemode(Player p, String gamemode) {
if (p.isOnline()) {
GamemodeYML.set(String.valueOf(p.getUniqueId())+".last-seen-username", p.getName());
GamemodeYML.set(String.valueOf(p.getUniqueId())+".current-gamemode", gamemode);
SaveFile();
return true;
} else {
return false;
}
}
public String GetGamemode(Player p) {
return GamemodeYML.getString(String.valueOf(p.getUniqueId())+".current-gamemode");
}
public void SaveFile() {
try {
GamemodeYML.save(GamemodeFile);
} catch (IOException e) {
e.printStackTrace();
}
}
}
this is the gamemode manager script
sry for the big blob of script 😂
yeah maybe I should fix that
I mean, aside from not having a singleton for the manager, that code looks fineish
I wouldn't save to file every time someone switches gamemode since it's a sync operation, but I doubt they'd do it enough times for that to be an issue anyway
say you have 100+ active players?
I mean, unless they're all constantly switching their gamemode, it shouldn't be an issue
true, the gamemode would be the default gamemode for all players when joining the game
are you trying to make an isometric top-down thing
isometric view game yeah
think animal crossing meets minecraft meets isometric game
(I've never played animal crossing lol)
latency is always the stumbling step with these but hopefully it'll turn out playable
since the player can't predict the serverside movement
hopefully
client usually makes predictions to where things will go towards so that even with latency, the gameplay looks smooth
so the way it works normally is that the client, when you press a button to move, doesn't wait the server to tell the player to move in a certain way; the client just moves
you can't do that with server-side only movement as the client has no knowledge about it
yeah
the idea is to freeze the player
like by spectating an armor stand
you press W on your keyboard, and before anything can happen on the screen, the client needs to tell the server "i pressed W"
yeah
and then the server needs to tell the client "okay, now move this here"
hence why latency is always the stumbling step with these projects
there are some ways to alleviate this, like making the player character (or whatever it is that they control) have natural-feeling inertia that masks the latency
I mean ig one way is that since I was already planning on making a quality of life modpack for the server I could have a mod that fills in that space
but players playing without it would still experience latency
what about... hear me out... The server predicts the client
a bit like how autocomplete works on your phone...
🤡 let me know how that turns out
nah its a dumb idea
i wanted to do something similar except point-and-click
by listening to player mouse movement with the spectate+mount trick, and moving an actual cursor on the screen
yeah prob with that is that you need some sort of ui if you want the player to stay frozen
😂 ouch
roblox games be like
well ig most games use client side scripts but still
anyway dont know how I'll do this
https://pastes.dev/QeEUwEB5ce I made chatgpt fix this class since I was bored
when one issue dissapears another comes
no matter how many times I use it, I am still pretty amazed at the capability of free AI nowadays
lol thx I'll check it out
fr
if your gamemode only does body movement and not head movement, latency isn't as much of an issue really
true
yeah third person is far more tolerant to input lag than first person
but might still feel like bad cloud gaming
in first person you'll be throwing up with 150ms input lag
thats good ig
HOW?
shore but the client predicts your movement
well, I am on the other side of the world so it can't be helped
or are we talking about another full conversion game
that gets out of the window with all the ways HP likes to cancel events
I can't count the amount of times I've been played by a ghost block in bedwars
THATS HYPIXELS FAULT
like i get slightly nauseous from just like 5ms of input lag in first person camera movement
real
well okay that's probably an exaggeration, 15ms maybe
if the client is doing predictions properly and the server isn't messing with that, even 300ms shouldn't be much of an issue besides just having some disadvantage at high-mobility situations
@sly topaz welp ig AI isn't the best cuz I think it messed up here... ISOMETRIC game mode isn't a thing
(in the gamemode object)
but that would be overriding no?
but probably don't name it GameMode
I asked it to use an enum, it just called it GameMode because it used the name you gave it, but you can name it anything else
exactly
because yes, name conflict
oh ok
yeah thats what I thought lol
it's not an issue issue but it is a bit inconvenient and can be confusing
yeah
just use FQNs and it is never an issue 🤑
and then ofter you need to provide an exact location
nms patches be like
nms patches just do it for the sake of reducing diff most of the time tho
I really like it
same I think it'll add alot of possiblities to your world
standing on it is so op i love it
it's a breath of fresh air for the game, and lots of people are making their headcannon about the ghast lore now with this
yeah you don't want to have 200 diffs all conflicting in your import statements
but it does also make the code absolutely unreadable sometimes
like the ghast actually being an aquatic being and it confirming the headcannon that the nether was once frozen, one can also provide the explanation that ghast in the nether shoot fireballs to avoid getting dehydratated
lol ye I saw that one
true
it being able to ride 4 players is also really nice, it's been due time for a mount that can actually ride more than one or two players
I'd wish they let us mount like 20 players on the dragon lol
fr
that'd be awesome
i wish they'd make the scale attribute work for dragons so you could have more manageable sized dragon mounts
but atleast servers could do it with plugins
that'd be so cute
but prob hard cuz of all the different parts of it and hitboxes
the dragon is like 5 entities in one so it's kind of a complex entity (no pun intended)
ye thats what I'm saying
but would be cool nonetheless
like they could introduce a "baby dragon" which is a one part thing and make that scalable
its 13
maybe just 10 but I know we counted some time ago and it was about that many lol
yeah for sure alot
that was quick
would anyone know if there is a way to update the delay for sync repeating task? or is running a new task each update the only way?
use the runTaskTimer method, isn't sync repeating task deprecated?
it is indeed
if you want dynamic delay, you can just use a shorter timer and have a counter
okay thank you
i thought sync repeating ask was only deprecated for bukkitrunnable parameter?
one and the same, doesn't really matter what you use
new BukkitRunnable() {
private int counter = 0;
private int currentDelay = 1*20; // 1 second = 20 ticks
@Override
public void run() {
if (counter >= currentDelay) {
doTheThing();
counter = 0;
currentDelay = nextDelay();
} else {
counter++;
}
}
}.runTaskTimer(plugin, 0, 1);
this is how I would do it
thank you
anyone mind helping me update a paper/spigot plugin, I'm struggling with updating dependencies from jitpack dm me please would love to learn how
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
just explain your issue and someone may respond
getting an error Caused by: java.lang.NoClassDefFoundError: revxrsal/commands/exception/CommandErrorException when using 3.3.6
I got the source code from being commissioned, but after updating to jitpack.io/#Revxrsal/Lamp/3.3.6 or using 3.1.8 one it came with neither work and 3.1.8 can't be found when building
implementation("com.github.Revxrsal.Lamp:brigadier:3.3.6") any help? updating from 1.20.4 to 1.21.4
can you show your entire gradle file
looks like your package name is wrong
newest versions use maven central not jitpack
you got the artifact names wrong
it is com.github.revxrsal:lamp.common, not com.github.revxrsal.lamp:common. Same for the other one
also, you are using the old shadow plugin
you should use the gradleup version, which works with newer gradle versions properly
you are also not using spigot so I recommend asking in the paper discord
Set their equipment 👌🏻
And also for a custom skeleton, is there a target goal for ranged attacks?
like in the constructor
what constructor
custom mob constructor
i would just call this.setItemSlot(); in the constructor right?
I trying to add a check for premium users and this is not working. Any fixes?
Just check if their uuid equals their offline id
That won't check the official servers. I doing this because I might set my server to offline mode
check the players uuid version
online uuids are v4 i guess
und the other v2 or v3
or the other way around
ther is a check like this in bungee
offline uuids are version 3
you can just make the request yourself
Its not the request. The parsing of json is what I trying to do. The request is working properly
why do you want to parse it from the json
you want to check if the player is cracked or premium right?
you dont need no mojang api
you can do it like this:
UUID uuid = player.getUniqueId();
if(uuid.version() == 3)
{
// cracked
} else
{
// premium
}
Ok that works, how do I get the player skin from the online account?
query the name for the online uuid, and get the skin from that
What can I use to get the skins?
the mojang api
get the sklins?
You never have the skin on the server, only a link
you can dl it lol
On the server you have a base64 encoded URL to the skin
What do you need the skin for?
I thinking about setting my server to offline mode
don't
That is why I need the skins
you won't get support
also just use skinsrestorer instead lmao, complete sidenote
don't reinvent the entire town
Offline server still doesnt actually tell us why you want the skin
to apply it to a player using packets
If he just wants to apply online skins to offline accounts its simple, but He's not actually said why he wants the skin
I only setting the server offline to prove a point. I have game communities blacklisting mobile hotspots and all this stuff. So that was my goal. I already reported that server to mojang requested by someone from #general
Like static IP is required
What you actually mean is you are logging into offline servers yourself and they are banning you when you use a different IP tyo access the same account?
I've never seen an online mode server ban someone for using different IP's
I don't want to adv but years ago. I went into a offline/cracked server with a VPN, I got banned permly. Mobile hotspots and VPNs are IP changers
I was begging my ISP for a static IP for a week
yeah it happens on cracked servers for security
So I trying to prove that this can be enforced without blacklisting these networks
Minos prime BEGGED me not to
ultrakill reference?
generally even cracked servers don;t care about the IP as they use an auth plugin for security
You would think but they do. They told me that VPNs are strictly forbidden. Premium servers which my server is at the moment don't have this restriction. So my point is if the player is premium, there is no reason to ban VPNs for that player. But if the player is logged in using a cracked version, ban the VPN
That is why I needed these skin urls and all that. So I can make it like a premium server but cracked users can join
I don't have the money
For cracked you will find nothing free
I either program my own plugins. I started the dev because the plugins I wish to use was paid versions. JetsHoppers for a example, I would use it if it has a blockbreak but due to being a paid plugin, I cannot use it
Plus if I was going to put it on a hosting server, I have to prove that I purchased it as they don't allow cracked plugins
I might be exposing too much but at this point, I don't care long as my point is proven. Not all VPN users and all that is bad
outdated but similar (source) https://github.com/ad1tya2/AdiAuth
its GPL3 so you can update it yourself
What hosting provider do you use that's this invasive?
I not using a hosting provider but companies don't allow piracy
They generally don;t require proof of purchase either
Well, I cannot check given the rules of this server but I like to keep this safe
I just noticed I just sent a message to a admin of another server that is in this server
I just worked out why they ban VPN. It's to prevent griefers
today morning an incident happend to me
did u see #general
wrt to offline mode 💀
Like I told multiple communities. They can ban VPNs all they want but when they start banning mobile hotspots, that is extreme and the need for static IP is grown massively
bro they cannot differentiate a hotpost and vpn so easily
What is your point? I cannot be using the cable internet because I used 8 TB once on a (4 TB allowed). They threaten to terminate service
8TB 💀
what kind of server are you playing on that you're using 8tb of data
Ok i think upgrading the wifi is more viable
they kind of can actually, the cheap VPNs have IP ranges which are common to VPN, they can check whether your IP changed before and also if it is within that vpn range, unlikely that your internet provider has an IP in that range though still possible, hence why you have to check whether it changed first
you have a computer capable of running AI models, yet not the money to pay for a better internet service? lol
Or plugins?
I on super limited money, I on SSI
I don't know what SSI is
Social security income maybe
Yes
that makes the idea of them running AI models even more strange lol
I trying to move from ChatGPT but its not a easy task
that really doesn't answer my question
but when it comes to AI chatbots, you're better off waiting for the competition to get better so they're forced to provide a better free product than they do now
The limit is quite awful for 20$
yeah, I just use free, not worth it
My gf pays for premium
or rather, I don't depend on AI enough for it to matter anyway
stonks
if I find myself using a lot, I just switch to another provider like claude, gemini, deepseek, even grok at times lol
oh yeah same
I usually switch between gpt / copilot / grok / Gemini depending on what I'm doing
for code it is mostly chatgpt and claude though deepseek does a fairly decent job at it
or if it is too long then maybe mistral, but only with very specific instructions as it isn't as good with code
who owns claude
anthropic
who dat
the ones who make claude
that's really the only thing they're known for
one would expect such a good chatbot to be made by another technology giant but surprisingly anthropic has been pushing the bar just as much as openai, at least when it comes to code generation
frikin sussy python, why does it have to give output in float sometimes and sometimes int
now i gotta go find out when we get int and when we get float
just convert it to whatever you want it to be
They aren't all sunshine and rainbows, they basically DDoS'd multiple websites for hours at a time scraping content, i.e. they rendered things like forums unusable etc
that is how their models are so good
a metric fuckload ton of data
Yeah all the AI companies are adding a significant load from scanning sites
<head><title>403 Forbidden</title></head>
<body>
<center><h1>403 Forbidden</h1></center>
<hr><center>Microsoft-Azure-Application-Gateway/v2</center>
</body>
</html>
Can someone explain why I'm getting this error? Could it also be the reason my player skulls aren't displaying?
I mean the results, we all know these models are doing everything but actually pay licenses for the content they scrap
As a consumer I personally don’t really mind, I am aware it has become quite the issue on the open source infrastructures around, but I assume they’ll eventually find a way to mitigate it
The VPN provider saysThe static IP could be an issue if gaming servers, forums, or other services you use start associating it with your past reports or bans. If you’re concerned about privacy, a shared VPN IP might be a safer option because multiple users share the same IP, making it harder to track any one person. Additionally, if possible, you could switch between static IP when gaming and using a shared one when online.So I guess I done with multiplayer servers but only on my own servers. I in a place with no where to escape
you thought about contacting the staff team of any server to explain ur situation and its not a vpn or attempt to do anything malicious?
This seems like a lot of work to propose your diy “solution” to the server and they go: 👍 and don’t do anything about it because why would they build out a whole layer of ip identification for 1 or even a small handful of players
And this doesn’t even bring up the problem that the people using VPNs (that the server is trying to keep out) can switch to a mobile hotspot to join the server. Effectively patching in a work around to their anti-vpn plugin
how do I check if material is a spawn egg (any type)
try
material.asItemType() instanceof ItemType.Typed<?> typed && typed.getItemMetaClass().isAssignableFrom(SpawnEggMeta.class)
thanks ill try that
anyone know why i.getItemMeta().getItemName() is returning blank in EntityPickupItemEvent? (ItemMeta is not null, but the name is just returning blank / null)
also another question: How do I check if a Material is obtainable in the creative menu as an item? (EX: Material.LAVA would not be along with Material.NETHER_PORTAL) I have tried using Material.IsItem() but that only returns items and not blocks such as diamond block for example
declaration: package: org.bukkit.inventory.meta, interface: ItemMeta
my question is why no items are returning anything. they should all have item names (ex: dirt, seeds, etc.)
like .getDisplayName() is also empty. maybe when you pick up an item from the event it doesn't have a name until it enters your inventory? idk, thats my best guess
material#isItem || material#isBlock ?
does .isBlock return true for stuff like Material.LAVA? because if so then it's not what I want
idk try and play with that
what u want reach?
? I'm not sure what you are saying. I'd like to get the name of an item when you pick it up. For example, if you pick up dirt, it would return "Dirt" as that is the name of the item
alright yeah so it went as expected. It returns all blocks. I need a way to only return the ones that are both blocks and items. so ignore stuff like lava and fire and portal
Hi there,
I am currently having some issue on my server with: [Profile Lookup Executor #1/ERROR]: Got an error with a html body connecting to https://api.minecraftservices.com/minecraft/profile/lookup/bulk/byname:
I am aware that this is an issue of Minecraft it self but is there an work around which doesn’t cause this issue?
(Getting it with an GUI when showing the players head)
cache the resolved profiles the player heads display
I am currently working on a world reset system for a plugin, so that the world is unloaded, then the folder is deleted, and then the world is created again via the WorldCreator#createWorld, but it remains the same world and no new one is generated, does anyone know why?
make sure world is actually deleted and make sure all players are not in the world and world is unloaded before you delete it
Here are the steps:
- all players are teleported to a world that is not deleted.
- the world is unloaded
- the folder is deleted
- new world is created
This also works with the order, but the world still remains the same, that's the problem
same world meaning same seed or same exact world? (If you place blocks, does it keep the changes)
Is there a cache or something like that?
check the world files and make sure the file is actually getting deleted is what I would check
because if it isn't, worldcreator will just load up the same world again
Here you can see it, the folder is completely deleted, all files are gone
im not sure then thats odd
doesn't look like region files were deleted though
The directory is created manually. There is no file in it
well, show us the code that's doing the unloading & deletion I guess
Fun Fact: It works with the nether and end, not with the overworld. Seems like ChunkHolderManager does not unload the world why ever
my only guess is that the world isn't actually being unloaded and thus the same world is being loaded from memory, which would be a bug in the unloading code
are you using spigot or paper?
Paper
You can’t unload the main world
ah right
The game kinda requires a default world for various things
i will do an alternative then
the server can't tick if there is no world available
If you unloaded it the server would be very confused
There are other worlds available in my case
yeah but the server doesn't know that, because it wasn't made with multiple worlds in mind
could be fixed, but I doubt people care
Then its time i guess
I don't know if it's a Spigot or Mojang decision, but if it's Mojang then they should get off their asses instead of doing stupid things like the player locator bar shit lmfao
Mojang has nothing to do with world management, as far as vanilla goes, only the main world exists
multiple worlds is a concept bukkit-based platforms introduced
that said, you're using Paper so you'd have to ask them for it
ehh
I mean, dimensions don't really count as worlds
Pretty sure each one has its own ServerLevel
The server just needs a level, it doesn't need dimensions on that
of course, I don't mean on the technical sense
server.properties already includes the nether dimension skip
Can someone take a look at this thread, curious about getting list of obtainable items:
https://www.spigotmc.org/threads/getting-a-list-of-all-obtainable-items-in-survival-minecraft.684115/
but yea, a default world is 100% something the server expects but also like, is virtually free if you need it to be
air world with nothing in it, no spawning, the void biome
it just does nothing
Don’t forget to disable spawn chunks
there is no way to get which items aren't obtainable in survival except manually listing them
though there probably aren't many
well I am listing some of themmanually and am just using code to remove ones that arent items like portal blocks. But it isn't working as I am not getting all the items returned. I put more info in that thread
that is a big ass if block
you could probably exclude a bunch just by using ItemType instead of Material
one thing you could do, which I am unsure whether it works anymore is check whether their creative category is null
But that’s still experimental :(
doubt it is gonna change at this point
Either way Material#isItem delegates to ItemType anyway
if it does then welp
Creative category is deprecated, it’s all client side now
deprecated in the sense it doesn't work at all or that spigot is manually keeping the feature alive for a little
No idea
wonder if there's something in NMS to check if an item is obtainable in survival
You could probably dynamically determine what items are obtainable
Go through each LootTable and check the drops
the current LootTable API is kinda shit for that kind of thing
Hmm, yeah it kinda is
just had to make LootTable iterable and it'd have been perfect 😔
You can check the drops of each block (with various tools ig) and the results of crafting recipes, etc
I'd rather scrape the minecraft.wiki tbh
There are many elements in Minecraft that are completely inaccessible to the player in Survival mode. This is due to many factors, such as game balance, or due to the fact that the player accessing certain content would not have any logical sense in the context of playing Survival mode, such as barrier blocks and spawn eggs.
The article encompas...
does anyone know if any specific changes went into resource pack setup from 1.21 to 1.21.4? my pack doesn't work anymore.. i updated the pack_format to 46 which is i think 1.21.4, but no dice
it mentions the changes in each version of the format
yes this is where i found tha the pack version is 46 for 1.21.4, however i don't see anything that would cause a pack to not work anymore
actually good call. i'll check the client log
if you have models on the resource pack, it is most likely related to that
i do
because I can't really see any changes besides that
it complains im missing a metadata but i definitely have it. unless there's a new one
the broken elytra model is now called elytra_broken and the equipment models have been moved up from models/equipment to just equipment/
show the logs
it really is just that line, [12:38:29] [Render thread/WARN]: Missing metadata in pack perhaps the format is different now i just have to look. im not modeling anything besides paper though with some custommodel data pointing to different pngs
what doesn't work anymore about your pack?
the textures are defaulting
did you update the command you were using to get them?
nop
well, that's probably it
its in my plugin, it just adds custom model data to items
well, you're probably meant to use item_model data component now or some bs like that in the API
oh geez. i hope not
i think there's just something off in my pack though. because putting the zip into the resource packs folder it doesn't appear, but when i unzip it it does. i confirmed with another working that that this is not supposed to happen
hi guys any method to hide player oxygen bar?
check if the suggestion in this comment works
i do not have any shaders config in my pack
https://www.spigotmc.org/threads/solved-how-to-change-hud-air-bar-level-in-a-client-using-packets.464182/ you can try something like this if you are willing to
i just need to find a resource pack that adds "custom" items with custom model data for 1.21.4. its gotta be something changed
other than that, it is really not possible to modify the oxygen bar on the server side other than setting the remaining air itself
found this i think maybe it all changed 😦 https://www.reddit.com/r/MinecraftCommands/comments/1h8acl7/custom_model_data_1214_using_numeric_values/
do you have a reference to this?
would've been nice if they mentioned it in the minecraft wiki lol
yeah this shit is annoying. now i have to update like 150 items
you can probably automate it
oh im definitely gonna try
some quick and nasty regex or something
maybe there's a tool out there already
there are generators like https://misode.github.io/ but I don't think there are any resource pack format converters
https://chatgpt.com/g/g-675a4fa622d88191b9d8d2ece1b28d13-minecraft-model-converter there's a trained chatgpt apparently
Transforms Minecraft JSON files for CustomModelData 1.21.4.
haha
don't know how well it works, but it should get you somewhere
Can anyone contact me private if you could help me with a Custom Mining Manager using packets or whatever to use a Custom Mining speed (without flicker in the animation)
there's also this https://hangar.papermc.io/RICE0707/ItemModel_PackConverter
you don't need any of that in recent versions
you can just adjust the tool's speed
Yeah but I want to do it in 1.18.2
I don't think it is even possible to do reliably in that version
It is
latency taken into account?
Somehow hypixel did it so its possible..
Client side negative mining fatigue ftw
Eh, normally with latency the block reappears, with this system you just won’t start breaking it for a bit
Neither is really better
keep in mind alot of hypixel stuff is 1.8 I'm pretty sure since they support down to that version
some things would end up breaking otherwise
not saying it aint possible tho, prob easier since more updates
has anyone got a plugin to just increase the zombie spawn rate so theres a tonne of zombies or if anyone can easily throw one together as I have no idea about spigot plugins but I assume it should be pretty easy for someone who knows
CreatureSpawnEvent -> if zombie -> spawn more zombies 😄
Are there spigot pages for placing/spawning blocks?
?blocks
?place
I want to place a pressure plate at a certain loc when a command gets executed
location.getBlock().setType(...)
But theres no block there yet
so p.getLocation().getBlock().setType(Material.xxxx) ?
Yea
i dont think thats exactly the same as increasing the spawn rate tho
replacing other mobs would probably make more sense
the most robust approach is probably to cancel other mob types' spawns at a certain % rate (in the pre spawn event, to avoid creating the entity only to discard it)
the server is quite aggressive about reaching mob caps, so the total spawn rate of monsters won't diminish noticeably
the spawning logic will fire more and try spawning more mobs, with more zombies spawning as a result
manually replacing spawns with zombies works as well, but you will run into fringe issues like zombies spawning in creeper farms; the collision shapes and hence spawn checks aren't the same
You can probably use a data pack now
Trying to set the player textures, do I need to update the player for the textures to show?``` PlayerTextures tex = player.getPlayerProfile().getTextures();
String texBase64 = jsonObject.getAsJsonArray("properties").get(0).getAsJsonObject().get("value").getAsString();
//JsonObject jsonObject2 = JsonParser.parseString(Base64.getDecoder().decode(texBase64).toString()).getAsJsonObject();
tex.setSkin(new URL("<A Player's texture URL>"));
player.getPlayerProfile().setTextures(tex);
player.hidePlayer(plugin, player);
Bukkit.getScheduler().runTaskLater(plugin, () -> {
player.showPlayer(plugin, player);
}, 10L);```
Ignore that comment there, it has a error some where in that
huh are you trying to get a players skin
and then setting it to them again
That won't do anything
Also hiding the player from themselves won't really do anything
Not until they add mirrors
But how can mirrors be real if our eyes aren't real
Lets say I want to set to Jax_Macky's skin, it was not my skin. But soon it will be when I get the plugin working properly
setting a players skin can be a pain
Why you saying this? Its not easy I think it was?
it requires packets, profiles and a bit of hacks to fix inventories
You see I setting the textures from the player profile object
just setting it in the profile will not change it for all
There’s no setPlayerProfile unfortunately
?paste
Who?
This is how I did it on 1.19 https://paste.md-5.net/ejagutoxoh.java
Does it work in 1.21?
definitely not
oh setSkin method is ```java
private static void setSkin(ServerPlayer player, String[] skin) {
String texture = skin[0];
String signature = skin[1];
player.getGameProfile().getProperties().removeAll("textures");
player.getGameProfile().getProperties().put("textures", new Property("textures", texture, signature));
}```
Here do I get the signature from?
signatures are generated by mojang
I was thinking about that but is it accessible thru their API?
so from a skin site eg public static String[] skin1 = new String[] { //texture "ewogICJ0aW1lc3RhbXAiIDogMTY0NjkyNTYxMjk3NiwKICAicHJvZmlsZUlkIiA6ICI1ODkwNjAyNDYyMzE0ZGFjODM0NWQ3YjI4MmExZDI4ZiIsCiAgInByb2ZpbGVOYW1lIiA6ICJXeW5uY3JhZnRHYW1pbmciLAogICJzaWduYXR1cmVSZXF1aXJlZCIgOiB0cnVlLAogICJ0ZXh0dXJlcyIgOiB7CiAgICAiU0tJTiIgOiB7CiAgICAgICJ1cmwiIDogImh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOTMyZTk1MjAzM2E3ZWI5MmFmNmJiN2VjMWIwYjEyN2EyNDMwZTI4MTk4MTRmNjA4MmFiNjQxNzI1YjA4MzM4NiIKICAgIH0KICB9Cn0=", //signature "bzWAwCt5ZCniUE/UkCyQENvV6JVDEwhhdVMWvquTTHbh9YoC2Poh7vKmGfxk7SYIJs7/PuwzVskydGFQo4h8CEmU0qFCDNl+wWo3Gl0x3n6O/dvMvOxY4jRMd9TWGk8biFLXRAEU/WmzcyTQSlWfw+wNNimGki7yCTvO9fISpXFz3ac6320xsMI8Yx7vOSDP7M27VNleDvnJsVyVtZBGAC6Mt6lLMlBfPZbQjclT42Cb/h9ruH54BJ/X+O+a1H8f5Ky9fU2f6vlL/21Ne1CnWbp3ag+vF6eQyUPWGSoJyIU3YHVTgmQjXS3TavRgd0CRS5JUuyxmwipE7xOYwvhN6EyvAAqwpGfGzsW6Mrj0iu/KNxh21arV2VSlMiVEAkWn/Qd0/h1VTDSug8h3XxFka3Y3b/mPIx8ECEnpsIC3hhv4t3k+xixcoiDsqremUpack5pH3ZKr1nderHTPjQ+ZamNndNiysJIUAWh5OEhR2ceNeyCcU8/p3UtB6RW4lgFe0ZTvdFHX10GLt903WzLW1OlYbDIUNJfkRRiHEG7DoUSQcH/GHdkX+9lQ9mqoiGOHIZUq+qlmMA2f7bdmdbnjW4cr+2Ha8F6tnfccuyowm6NhONaJXSZUpDD2JsuYHNk6FPk3jiPo7CznsJ/nORnH9x7HHc7w/PrUV7GJaR4n7mk=" };
you can pull the texture (url) and signature for any skin registered with mojang
from http://sessionserver.mojang.com/session/minecraft/profile/
I do know about that but there is no signature value. Just the texture array in base64 string
?scheduling
ty bro <3
Wait, what is the signatures used for because if I was going to parse the base64 string, I can see my Deadpool skin?
no
if you parse the base64 you would get a section of json with a URL
there is no actual texture in it, its just a URL
the signature is from mojang to confirm the data
http://textures.minecraft.net/texture/da130994fb599cc0d94135068b3a033157217f95d42e1f9437358ea92d6e19e5
get the account UUID and append to http://sessionserver.mojang.com/session/minecraft/profile/
that gives you the texture info you need to apply a skin to a player
yes that is the texture. The server never uses/accesses it
it ONLY passs a URL to the client
the client pulls the texture, the server never does
If the client pulls the texture, I don't know why I don't see it when setting to Jax_Macky but ok. I will test this
Wait, I said something about a line that has a error. Any fixes?JsonObject jsonObject2 = JsonParser.parseString(Base64.getDecoder().decode(texBase64).toString()).getAsJsonObject();
You don;t see it because just setting the properties in the Profile will not show the skin
why are you decoding it?
I can pass a base64 string?
That is for the Json
just pass an array of properties, texture and signature
but as I stated that code is for 1.19 so will not work on 1.21
what does this even mean lol
the textures property value is a base64-encoded json object that contains the url for the skin
If you load the content from ?unsigned=false, you see the following:{ "id" : "0b605717d3a04cd48b673af1eb6449ca", "name" : "MrnateGeek", "properties" : [ { "name" : "textures", "value" : "ewogICJ0aW1lc3RhbXAiIDogMTc0Mjg1NzE4MTc5OCwKICAicHJvZmlsZUlkIiA6ICIwYjYwNTcxN2QzYTA0Y2Q0OGI2NzNhZjFlYjY0NDljYSIsCiAgInByb2ZpbGVOYW1lIiA6ICJNcm5hdGVHZWVrIiwKICAic2lnbmF0dXJlUmVxdWlyZWQiIDogdHJ1ZSwKICAidGV4dHVyZXMiIDogewogICAgIlNLSU4iIDogewogICAgICAidXJsIiA6ICJodHRwOi8vdGV4dHVyZXMubWluZWNyYWZ0Lm5ldC90ZXh0dXJlL2RhMTMwOTk0ZmI1OTljYzBkOTQxMzUwNjhiM2EwMzMxNTcyMTdmOTVkNDJlMWY5NDM3MzU4ZWE5MmQ2ZTE5ZTUiCiAgICB9CiAgfQp9", "signature" : "LSWINA6KhpBhN2Qk5OtLTCQut74n8jvmWjbJHLFkqz6Q2sepIcYs1Q9tU89wA//d7KBF3HOKeaebT6myMPrURtRDPkDnqx/wRdDGVtSGqFumWQcfsDCjLtOsXc+OCQvX2SY902FiVoNhy73Aa4upVp8mQG2Hz2YeBZis3rP7bqhx1aGWC/hb2lbRntxLiRPBlL7x5z7uPGZeRF9hU0mlHb3zppp6+qlo+FKzs1/OKXPESvBM1vM0is8lVXDR/kPJGf20UANr+cvi2ZKtKuTIFr4bxPqLjAyUoBosULurjOn1oaZnHy2/YqY7urmElNCQBJd8zTq/TzQIbMHCCiYzEHCPnOn007DA1gzRDuo0SryqXVpeBjYopGQaRcMfxxNYLdOmZJ7EQdWkznBOIrLPaKZ8mBkmUJHBMHG4EDd4bojLS59Vvd0j++YwfQzGkbCxCkepW/h1zbJHOk3rHXPwfNHzandtAbw5Qv2/kcvIMDQL+aO+JdkzaDEQjSqBTzzQaga+bk6hKwB06y9tIPwINt/oDPfGqIrk4rrbALzQ/NbBqneUJYdDhjnPJT3J44Xk9wXUIDp3AYDYq7JhVFr+cV6yFHur04UQ4PIsghX15uxikjZ/XADAhr6r7+Hzm8pQyGR9nyT0J2fBBvpJo9TkmuxRFp2DiBYP9l9CCrSac6E=" } ], "profileActions" : [ ] }
yes
yeah? that's the whole profile
I can pass the json string?
containing the textures property, with the base64-encoded json object containing the skin url
pass a json string where
that shows you how to use the profile
no
Why do people keep trying to reinvent the wheel (setting player skin) ?
SkinRestorer has API for this.
you shoudl not be accessing textures.minecraft.net at all
you also do not need to remove - from the UUID string
the last code I posted has sysout which show you how to get teh texture and signature properties.
you do not neeed to decode at all
So I just pass the json string to set the texture?
yes
just use the code Elgar shared earlier
Description Resource Path Location Type
The method setTextures(PlayerTextures) in the type PlayerProfile is not applicable for the arguments (String) AuthGate.java /MG-AuthGate/src/main/java/com/mrnategeek/authGate line 57 Java Problem
Yep GameProfile not Bukkit Profile
auth plugin :intjfall:
How can I get the GameProfile from player object?
Description Resource Path Location Type
The method restoreSkin(ServerPlayer) from the type AuthGate refers to the missing type ServerPlayer PlayerListeners.java /MG-AuthGate/src/main/java/com/mrnategeek/authGate/Listeners line 19 Java Problem
this is getting ridiculous
nms changes almost every version
which is why my 1.19 code will not run on your 1.21
I did not even test it. But this is one of the reasons I trying to avoid using NMS, things change and break
you cannot do this without nms
yes everyone shoudl avoid nms, but what you want to do requires nms
Life hack: Write the NMS once and force MD to upkeep it
If your PR ever gets accepted <3
What was that signature you was talking about?
textures are signed by mojang. if the signature does not match the client will reject it
the client will render the textures property on a player only if it has the correct signature
otherwise you'll get one of the default skins
Player heads don’t require a signature, but actual players (and NPCs) do
This was the line I was talking aboutplayer.getGameProfile().getProperties().put("textures", new Property("textures", texture, signature));
I'm crying
I done with this. I tried but I going in circles. I just going to start reporting cracked servers to mojang, I just need people to relax on VPNs and dynamic IPs
cracked players already demonstrate a willingness for illegal activities and as such "generally" do more griefing than premium players
just don't run offline mode
?offline
I was not going to run the server offline but these server really set a goal and its impossible to reach. I can already see a load of people being banned due to using a public wifi network. While these are risky, I don't recommend it but people are limited on money. Some people cannot get a house for a fixed IP known as static IP. The hotspot is useful so I don't risk being spyed on by hackers. You know VPN is a easy fix if these networks has to be used but do they cause a massive issue? They do. But if the server is authorized by mojang like my server is, its not a issue
public wifi doesn;t generally change ip
its all behind NAT but the public facing ip is generally static
Is public wifi actually that vulnerable to hackers
Or did VPN companies just need something to advertise
only by others actually ON the same wifi
^ ip banning is generally useless given everyone is behind a CGNAT
and ipv6 is nothing but pain
Well, I don't know. I seen a SA-MP game community ban a internet cafe, I forgot what it was for but think if a server limits its users to 3 per IP, only 3 in that cafe can connect
That’s why you don’t do that
it was likely banned because someone hacked/griefed from that IP
I'd do the same. If someone joined my server and hacked/griefed, I'd ban the IP
Hacking is possible but the SA-MP is San Andreas Multiplayer
I don't know. Most people don't allow alts so it makes multiple connections impossible
“Most people” citation needed
Source: Trust me bro
...
i run an offline mode server so i did have to ban the ip range of this one entire school because the kids kept stealing one anothers passwords from the client logs and it was causing repeated drama
generally though i think offline mode servers limit accounts per ip to like 5 to let siblings from a single household etc. to play without letting someone spawn 100 alts unsupervised
i don't think restricting accounts per ip makes sense for online mode though
did i fuck up
i accidently pressed del and somehting else
the code still exists if i look in file explorer but it doesn't show in intellij idea
what's the packet that gets sent when a player gets an item from the creative menu
because the SetCreativeItem one isn't working in my case
well it does fire
can't you just check if the inventory type is creative in an inventoryclickevent
nah needs to be with packet manipulation
I think what's happening is that the server is aware but the client is not?
huh
something tells me these don't match
maybe the properties are different
press ctrl + alt + shift + s
raw slots vs formatted slots type deal
if I put it in my 4th hotbar slot it goes to my boots
or whatever
i just deleted .idea folder, ty anyways
next time it happens
go modules
and set java folder
to sources
it happens a lot to me XD
k
If these cracked/pirated servers is that worried about VPN/Proxy. They can at least do what I about to do with this
Made this script with some help from the sa-mp wiki, had some trouble keeping some people out so I just said yolo and put this together, Hope it helps! Script will no longer kick anyone connecting fro
How should I check if the player holds a key with PlayerInputEvent? right now I can only get when they press it
You can't. The server doesn't get that information. That's mod territory.
Yes but that's only limited to those inputs. You can't get a generic key
I'll have to defer to someone else. I don't know
this is the industry standard for blacklisting bots/proxies and compromised ip's
understandable it's still an expirimental feature
afaik it should send another packet with the input being set to false when the key is released
Wynncraft with their magic spells for example?
well they use left click right click and stuff
but I mean like simulate my own movement system
I need to get when w is pressed and when its released
huh?
re: this
hey guys!
hi
wasup
good, trying to figure out how to get movement keypress
ic ic
now that i have my custom entities created, is there any way i can give them custom spawn eggs?
My current implementation is checking a custom spawn egg (given by commands right now) to have a specific NBT tag, and then cancel the spawn and spawn my own mob instead. Is there a better way to go about this?
the item registry isn't synchronized to the client, so custom items are off the table
damn
I can't use the getCustomModelData method for example?
and define a specific range to be for my mobs?
yes though that's not really a custom item
yeah but when we talk about plugins there is no such thing as a true custom item
ah i meant not exactly a custom item then, but a way to spawn my custom mobs
your best bet is to use a pdc or nbt tag to uniquely identify the item as your "custom item" and add a custom model data tag + pair that with a resourcepack predicate to apply a custom texture to it
use the pdc/nbt tag to spawn your mob on right click
yeah and spawn the mob where it was placed
^^^
how would i grab an online player's skull? i'm running a 1.18.2 server if that matters
i want to make an inventory that shows all online players that are a member of a kingdom, but SkullMeta can only use OfflinePlayer
is it something other than SkullMeta though to grab it?
no i mean using the player uuid fetch to the mojang api
then you need to modify the item data
to set the texture
skullmeta requires an offlineplayer though
.
.
something like this
you can use skinrestorer api too
or on paper i think you can just get the player's profile and then set it on the skullmeta and it'll work out of the box
if the player is Online there is an offline player available
sure
I think that offlinePlayer loads a lot of data but it could be a good option if there are few players
im aware of that. i need to grab online players though (offline is easy as you hinted at)
um
Bukkit.server.getOfflinePlayer(uuid UUID)
yea check if the player is online
use uuid to get OfflinePlayer
if not use offline one
actually you only need their profile
so as you are using only online players
your Player#getPlayerProfile()
ah yeah if you are using online players just use setOwner() or setOwning in paper then
lmao
Hello, i made a plugin named myHub for hubs.
can someone pls suggest me what can i add on it?
What is a "hub"?
USB C HUB
a "hub" is a center of activity.
I'd say add a teleport feature then
what do you mean
a hub
...
are we talking about a bungeecord plugin or individual plugin for each lobby server
its a plugin for spigot/paper to install only on the hub that also support bungeecord (send people to another servers)
sounds like that's all it needs
it's just a way to get to the various backend servers
so not a hub then
it is hub
well dangit I'm all out of ideas
well, what stuff do you have
I'd definitely add that stuff
search myHub
if it would be a bungeecord plugin you could add a message command which you could send across hubs
that is alot of stuff
?paste
it definitely needs a recipe to put bark back on stripped logs.
overlay a block display entity displaying a regular log on stripped logs and scale it so that some of the faces are visible while others are not - for a partially stripped log, so you can strip logs one face at a time
very good for decoration i'm sure
we do it with custom blocks at work
it also lets us do things like corner blocks and whatever
Example
aye, i've thought about using this for facades and such, but the entity tracker/client renderer performance is prohibitive for making much use of it
We're not using entities here
With a mod then?
Its a baby stripped spruce log xd
Resource pack
it's just nexo
How can i update a entity metadata for one player only without modifing the actual entity using NMS?
like right now i have a method called update take takes in a Consumer<Entity> and the player who is supposed to receive the update packet, but when i edit the entity from the consume, like i set the Entity#setNameVisible(true) the next time i show and hide that entity to some other player who is not supposed to se it, he still sees it. I tried to search some way to clone the entity but wasn't able to find anything.
Need packets
Use ProtocolLib or PacketEvents
I mean one option is as you said keeping a bunch of clones walking around
but that'd just be more annoying to make
Im using NMS i know what packet to send just don't know this thing about how to edit the entity without actually editing it
I don't want to hide the entity, i need to show the custom name to some and show it glowing but only to the entity owner
entity visibility api ❤️
Multiple entites with different states
Do you have any reference written in protocollib?
only show what you want to each player
but then it's going to be a paint to maintain other thing always updated between every entity, isn't there a different way?
It's slightly old now but should be good enough
?protocol
Take a look at this as well ^^
packetevents be like
how do you override commands again? like /msg ?
i created a new command "message" with alias msg... does that count as overriding?
after using msg.. it acts as if its not even alias of the message command
and outputs default minecraft vanilla stuff
i guess i could make the main command msg with alias message? but message command is cleaner
where would you guys take inspiration for magic systems?
World building stack exchange is useful for ideas as well
is there a minecraft-adjacent version of those?
that aside, is there a guide somewhere on how to interface Lua with Java?
i want to have an api interface for lua since it's much faster to edit and test with
There are a couple of implementations for Lua
Haven't tried them though so can't say how easy it is
would you recommend any of them over othesrs?
a lot comes from mods
yea im doing my coding with plugins so that it doesnt require anything from the user
no resource packs either
just 'join the server and u good'
Some good inspiration could be Botania, Thaumcraft, Ars Nouveau, Astral Sorcery and maybe also Forbidden and Arcanus
They really have some nice magic systems, especially Thaumcraft in my opinion
well i was more thinking ritual magic
#help-development message see here for visual idea
i see
and since modern minecraft has the amethyst crystals...
there's also lots of mods doing that
most of them are hard to find, occultism has a few rituals but there it's like putting some symbols on the ground and then something happens
yea, i know how to stop items from combining into stacks
so i figured why not have the items, ontop the right structure, be the 'magic'
I do that irl so ask me for questions
yeaaaa i need ideas kek
i figured i could use the central block (lodestone) to declare the general 'type' of magic. like, an amethyst shard for creating better catalysts for higher-tier magic
tryina find a good item implying material transformation/transmutation
how can I enable debug logging?
netty uses whatever logger provider is given, but refuses to print errors unless debug is enabled
how tf do I turn on debug in general?
didn't server.properties have something
server.properties and spigot.yml have a debug setting
beyond that, change your log4j2 config if you need the debug level
do they both do the same thing?
since when is that a thing?
aight makes sense
Changing the setting will change the log4j level
oh does it o.O
Ah, the spigot one yea, would have been surprised if the server.properties one hacked around in the root logger
There is a long-standing magic plugin in the Bukkit ecosystem just simply called Magic if you were interested in some inspiration there
It's basically the de facto standard for magic plugins
Choco made it didnt he
Plus it's made by Nathan, and we like Nathan :) https://www.spigotmc.org/resources/magic.1056/
NO
ill take a look ty
There’s a lot of mods you can take inspiration from
I'm actually surprised to still see Nathan working on that. Thought he would have abandoned it a while ago. It's so old lol
I made a magic system similar to ars nouveau
Nathan who?
NathanWolf
hm. it doesnt really fit what i am envisioning so i cant just make it a configuration for that plugin lol
i dont want players running around spamming spells everywhere tbh lol
it feels 'too easy' for lack of a better explanation
Hey guys, I am running into a sort of a weird issue, with map cursors.
So I am making a custom Factions plugin for my server, and I want it to use a literal map for the faction map, but for some reason the map cursor position is far from where it should be.
Image: https://postimg.cc/tnksr94r
Code:
@Override
public void render(@NotNull MapView mapView, @NotNull MapCanvas canvas, @NotNull Player player) {
if (!player.getInventory().getItemInMainHand().getType().equals(Material.FILLED_MAP) &&
!player.getInventory().getItemInOffHand().getType().equals(Material.FILLED_MAP)) {
return;
}
MapCursorCollection cursors = canvas.getCursors();
while (cursors.size() > 0) {
cursors.removeCursor(cursors.getCursor(0));
}
Location loc = player.getLocation();
World world = player.getWorld();
mapView.setCenterX(loc.getBlockX());
mapView.setCenterZ(loc.getBlockZ());
renderTerrain(loc, canvas, mapView);
int mapCenterX = loc.getBlockX();
int mapCenterZ = loc.getBlockZ();
boolean test = false;
for (int pixelX = 0; pixelX < 128; pixelX++) {
for (int pixelY = 0; pixelY < 128; pixelY++) {
int worldX = mapCenterX - 64 + pixelX;
int worldZ = mapCenterZ - 64 + pixelY;
int chunkX = worldX >> 4;
int chunkZ = worldZ >> 4;
Chunk chunk = world.getChunkAt(chunkX, chunkZ);
Faction faction = factionManager.getFactionAt(world, chunk);
if (faction != null) {
Color factionColor = getFactionColor(faction);
if (!test) {
canvas.setPixelColor(pixelX, pixelY, Color.BLACK);
if (pixelX >= 0 && pixelX < 128 && pixelY >= 0 && pixelY < 128) {
cursors.addCursor(new MapCursor((byte) pixelX, (byte) pixelY, (byte) 0, getFactionMarkerType(chunk, player), true, faction.getName()));
}
test = true;
} else {
canvas.setPixelColor(pixelX, pixelY, factionColor);
}
}
}
}
cursors.addCursor(new MapCursor((byte) 0, (byte) 0, getDirection(player), MapCursor.Type.PLAYER, true));
}
I don't see any reason it's offset like that. The black pixel in the image is supposedly the cursor position.
I also saw someone else that had this issue in 2020 or so, but got ignored
aren't map cursors absolute positions based on map center?
although maybe thats what your code is correcting idk
I don't think it's said anywhere, is it like that?
I am not sure, but I think they might be since they track players off the map
Alright, I will try to correct it someway - I'll update you whether it works or not
ok theyre not, but
Parameters:
x - The x coordinate, from -128 to 127.
y - The y coordinate, from -128 to 127.
It's impossible for the cursor positions to be outside those ranges
if that's right then I think there's negatives you're missing since yours starts at 0
I tried a few times, but can't get it just right.
https://postimg.cc/HrgprqWn
@Override
public void render(@NotNull MapView mapView, @NotNull MapCanvas canvas, @NotNull Player player) {
if (!player.getInventory().getItemInMainHand().getType().equals(Material.FILLED_MAP) &&
!player.getInventory().getItemInOffHand().getType().equals(Material.FILLED_MAP)) {
return;
}
MapCursorCollection cursors = canvas.getCursors();
while (cursors.size() > 0) {
cursors.removeCursor(cursors.getCursor(0));
}
Location loc = player.getLocation();
World world = player.getWorld();
mapView.setCenterX(loc.getBlockX());
mapView.setCenterZ(loc.getBlockZ());
renderTerrain(loc, canvas, mapView);
int mapCenterX = loc.getBlockX();
int mapCenterZ = loc.getBlockZ();
boolean test = false;
for (int pixelX = 0; pixelX < 128; pixelX++) {
for (int pixelY = 0; pixelY < 128; pixelY++) {
int worldX = mapCenterX - 64 + pixelX;
int worldZ = mapCenterZ - 64 + pixelY;
int chunkX = worldX >> 4;
int chunkZ = worldZ >> 4;
Chunk chunk = world.getChunkAt(chunkX, chunkZ);
Faction faction = factionManager.getFactionAt(world, chunk);
if (faction != null) {
Color factionColor = getFactionColor(faction);
if (!test) {
canvas.setPixelColor(pixelX, pixelY, Color.BLACK);
byte cursorX = (byte) Math.max(-128, Math.min(127, worldX - mapCenterX));
byte cursorY = (byte) Math.max(-128, Math.min(127, worldZ - mapCenterZ));
cursors.addCursor(new MapCursor(cursorX, cursorY, (byte) 0, getFactionMarkerType(chunk, player), true, faction.getName()));
test = true;
} else {
canvas.setPixelColor(pixelX, pixelY, factionColor);
}
}
}
}
cursors.addCursor(new MapCursor((byte) 0, (byte) 0, getDirection(player), MapCursor.Type.PLAYER, true));
}
It's way closer now - however it's still off, but if I am at the exact position it's accurate. Higher distance = higher inaccuracy it seems like
md can we have sweeping edge events please :)
even paper doesn't have them
making a feature at work where sweeping edge works off a percentage but eh
is Event Priority still applies to async events. a higher priority will still be triggered before one with a lower priority ?
lower priority runs first
Wouldn't taking damaged entities, getting the damager player, and checking their hand item's enchants do the job?
yes
no
Because it'd only apply to half the entities and not the others
while still rendering the particle and sound
meanwhile I want it so it never renders or it always renders depending on a condition
and for that I either need to check swing events, run the chance and cache it
or I need to redo all the combat logic
aha, I see
even cancelling the regular sweep damage event doesn't work.. tf?
nevermind ignorecancelled might have something to do with it
isn't that like, pretty simple to implement?
eh
can't you just check the damage cause
The DamageSource of the event will have the ENTITY_SWEEP_ATTACK bit
and you know the attacker
mhm fair enough
I just want to be able to make any attack sweep vs not sweep
and ideally crit vs not crit
Crit vs not crit paper has an open PR for, the sweeping part will be a lot harder yea
it's all part of the attack method
it is
you could maybe perhaps make it work with paper's pre-attack event but it fires too early for the sweep effect to be detected
yeah there's no "great" solution
what we're going with is just "let us bother about this later" and I cancel the sweep damage and make the rest invisible with rsp trickery
But, the idea of maybe flagging that is a good call
That might help me with the paper PR for crit
There's like 2 classes that start with "sweep" it's truly an underdeveloped concept
the sweeping edge enchant just affects an attribute too it's so lame
(and that attribute is just a damage multiplier, range is hardcoded)
it's a pretty easy effect to replicate tbf
I still need to disable the default shit
and I can either do that with packet manipulation
or a lot of event.setCancelled and emulation
emulating the effects on the server won't be as nice as the client can't make its usual predictions and latency will make it look off
but it is what it is
Who can explain how to work with player levels and experience 1.20.4 now? Previously, experience was measured by float and now int, I need to implement a simple system of increasing levels by the amount of experience from the config, for example, initially in a player lvl 1, to increase it to the second you need 100 experience (this is taken from the config) and so on, here is my example but it does not work. ```java
@EventHandler(priority = EventPriority.HIGHEST)
public void LevelUp(PlayerExpChangeEvent event) {
Player player = event.getPlayer();
int totalPlayerExp = player.getTotalExperience();
int totalPlayerLevel = player.getLevel();
String path = plugin.LevelUpConfig.getString("Levels.") + totalPlayerLevel;
if(plugin.LevelUpConfig.contains(path)) {
int nextLvlExp = plugin.LevelUpConfig.getInt(path + ".Exp");
if(totalPlayerExp >= nextLvlExp) {
player.setLevel(totalPlayerLevel + 1);
player.sendMessage("Ви підвищили рівень!");
}
}
}```
More precisely, it works, but not quite as it should, for example, to increase the level from 7 to 8 you need 100,000 experience, but by killing a couple of mobs it increases, although it should not
i don't see you preventing the player from leveling up naturally
so the player will still accumulate xp as in vanilla, and level up when the vanilla xp threshold (which is far less than 100,000 for level 8) is reached
I thought about this too, how can I disable vanilla player leveling and follow my rules?
try cancelling that event if it's cancellable
or iirc there's a setLevel or setXp method that takes an int (level) and a float (progress to next level, 0..1), and use that
divide the current xp with the target xp to get the float
This experience gain event can't be cancelled, do you mean make a second level up event and check it there?
are there maybe methods on the event itself that could be used to set the level and level progression?
i don't have javadocs in front of me right now
Maybe I misunderstood you, but there is no level control in the event, in theory you can get the current experience and sort of check it? event.getAmount
how do i get the original item in a protocollib SET_SLOT packet before any plugin was able to modify it
e.g.
if plugin A modifies the item in SET_SLOT to have some extra lore and plugin B tries reading the item in SET_SLOT, it would have the added lore
Working with creative mode?
Just make a packet listener
Don't over think it
i got 2 plugins that need client side lore, one is enchants and one items. i make it compatible with creative by storing the original lore in a pdc and then restoring the lore from the pdc in InventoryCreativeEvent
the issue is when you try custom enchanting a custom item then removing that enchant, one of the plugins stores an instance of the lore when it had client side stuff in it into the pdc
tldr: enchanting and disenchanting a custom item when in creative that has client side lore makes the client side lore into server side
Creative is all sorts of ew, does the plugin need creative?
You should be able to strip the lore in the creative event
not really but it would confuse people if the lore doesn't exist if they're creative
But yes the client will send client side lore to the server in creative
how do i get lukcperms working for bungeecord?
(I host my server on my own pc)
U download Luckperms for Bungeecord and start the server?
No need for ping
And yeah it does... Also RTFM
ok its working but are there any plugins that can make the ranks show up in tab and chat? (TAB, and EssentialsXChat werent working)
They should work just like they would with the normal LP version
Also for tablist I'd use VelociTab bc that syncs the tablist across all servers
does it overlap with deluxehubs tablist?
ok so i tried using /lpb editor and when i save it doesnt do anything across any servers
ok so how do i create a mysql server?
locally on my pc
I am using Laragon, but XAMPP is probably better... Just couldnt get it to run on my machine
Both of these allow you to host mysql and pma on your machine
nevermind i got it working from kasaisora mysql tutorial
Anyone write java code in notepad?
huh
in-game game tests?
can't wait to misuse that for something it was never meant for
Entity Data
Custom data (previously present only on Marker) is now available on all entities
It's exposed as a minecraft:custom_data component, so it can be set by spawning items and matched by predicates
The component is currently stored in a field called data, which will be changed in the future when more proper storage for entity components is introduced
It's stored only if it's non-empty
well
I can tell we're about to have some api fun
Laragon is more modern than XAMPP, but they both do the job just fine
Yeah... Getting an annoying popup everytime I press a button (buy premium)... Thats why Id prefer XAMPP
Is there a way to include a different BungeeCord in BuildTools? When building Spigot 1.21.5 it seems to still be bundling BungeeCord 1.20-R0.2 when I believe the latest is 1.21-R0.1
Open a bug report please, a release of 1.21 is probably due
Will do, thank you as always
I can set the time out for typing in chat with the conversation module of Spigot but how can I do that with the block selection like how this plugin does with its linking system?
https://songoda.com/product/epichoppers-8
ViaVersion? You can use 1.20 or even 1.19 for the bridge I think. But your servers can use the latest, don't know how that works. May be wrong on that one
Anyone here?
You're asking about a timeout?
I'm sure you can figure that out with System.currentTimeMillis() and/or scheduler
ChatGPT said something about that but I don't want alot of timers. I got enough already. I don't have to use timers for the chat conversation module
So there's a nail and a hammer but you'd prefer to use your shoe?
...
start = currentTimeMillis. If (currentTimeMillis - start > timeout) // timed out
I will see if that can work. But one issue, I had this issue with my SA-MP server in the past and I did something to make it operate again. The issue was I had my computer online for a week or more, stuff like anticheat broke. I don't know if this is the same for Java but if it is, I need a different way for linking chests. I not going to ask about the filters because people don't get what I trying to do
Hey md_5, you told me my code was not thread safe in a Jira issue. I have been working on a BlockPopulator that loads chunks based on how they were generated in another world. Is it possible to make such a solution thread safe?
I have no idea what you're saying
32-Bit versions are annoying as f***, that should give you a clue. I would have to show you what I talking about but I don't have that server anymore, ran out of money
md were u able to replicate that login event issue?
ChunkPopulateEvent instead of populator could be an easy workaround. Otherwise you need to make the bit where you get the other world chunks sync
Haven't had a chance to look at your video yet, but I couldn't replicate on my system
yeah , i think i explained the steps properly in the video.
Alright. Could I make the other bit synchronous using a scheduler?
Yes
i was able to replicate it both locally and in a vps
reliably with my method in the video
Are the BlockPopulators ran asynchronously? Im guessing Ill have to schedule retrieval of information from the other world and then when it's received, continue with populattion?
Yeah they are. Not sure if there's a way to make them sync like they used to be
I don't recommend synchronization methods but for what I trying to do, I need to know how you did it. Synchronization stops the thread
I think the deprecated method (without limited region) is sync
Are VirtualThreads as cheap or pretty much as cheap as just scheduling a future?
If you a nodejs programmer, you know what I talking about
I saying this because I seen refs to this on the bukkit code
I see, but if I run a scheduler in there, how can I have it wait for that to run? Should I run the rest of the code that is waiting for it in the run()?
I don't think it is necessarily accurate to say it stops the thread.
there is also an issue of entity teleport event firing twice
You could use the callSync method and get the future
but i gotta test more
ah okay
Ill try that
Thank you
I don't know, this shows what I talking about here
https://medium.com/linkit-intecs/what-is-synchronous-vs-asynchronous-in-node-js-4b45ee668e6f
It is much different in java lmao
It might be but I just telling you so if some things freeze on the server. I never ran into this issue but if I using sync methods, I just try to find async methods
yeah 💀 but not everything can be done async
Sync methods will stop the server if it is doing something that is intended to be asynchronous
imagine async plugin loading
That would not go well xD
I don't know who said something about it but I just telling you and who might be thinking why their server is frozen
yea dependencies would break prolly