#help-development
1 messages · Page 1147 of 1
but kat
if your users cannot load mods that won't be possible
How did we go from running spigot on the client
dont u already get that with finite double/float precision?
You can make an installer for them
To making a new game
That installs the mods
i will
or ru looking for even more deviation?
Just wrap PrismLauncher and their CLI or smth
this will be more painful than it sounds btw
you need to account for like every launcher
I don't want them to enter the server without logging in with my client.
I was literally just typing this out lol
Just account for the vanilla one
In this way, I can prevent cheats a little bit.
If they know about 3rd party ones they know how to install mods
i don't have it installed so am i fucked? probably
if the mods aren't publicly downloadable
and then you can just put a pack on CurseForge or Modrinth
I'm going for a realistic feel when it comes to the disc throwing, lotta factors play into this though
u got like a streamable or sth to showcase what u've finished thus far?
Then you make them
I can grab a clip hold on
There's 0 reason for them not to be
can i work spigot server with mods?
sure
no
yes but what you want to do is on the client
so Spigot doesn't matter there
i did want to make my own launcher for mc events like mcc but never got around to it
I can use items etc. in menus etc.
Custom items would need to be on both client and server
Likewise, I can use a creature I added in my plugins.
There are Hybrid implementations available, I don't recommend using them though
You're better off not using plugins
So should I do things with mods that plugins can do?
yes
mods are generally harder / more complicated than plugins
mods are generally harder / more complicated than plugins
good bye
I was wondering about this
*
good hi
okey i will use plugins
that's what i just said
but i need add some blocks like furniture
ik?
it sounds like what you want is a modded client and server
i will add blocks such as furniture, i have to use them in my plugins so that they do not break in the lobby, etc.
add custom blocks
use them in my plugins
that will not be working
worldguard only works with spigot and you most likely wanna do a modded server and client
i wrote the id i wrote somewhere in the config file.
and the modded block not breaking
wha
i launch my server with mods
and i was using anotherfurniture mod
and worldguard was preventing them from breaking
worldguard is spigot only.
so y r saying it can't be?
i've created the recipes and registered it, but i doesn't work with no error
event-handling:
block-entity-spawns-with-untraceable-cause: false
interaction-whitelist: []
emit-block-use-at-feet: []
ignore-hopper-item-move-events: false
break-hoppers-on-denied-move: true```
this is worldguard config
and this is anotherfurniture mod
can i send links like this?
nvm i used them
both
Yes, relevant links are fine
Link to where you got worldguard?
btw i add another furniture block to intreaction-whitelist (i mean add block id)
and worked
Did you register the recipe?
like this
what is the IS ingredient
block-entity-spawns-with-untraceable-cause: false
interaction-whitelist:
- anotherfurniture:oak_table```
You add it to something named recipes
But that loop uses something named itemsShapedRecipes
What you put there depends entierly on the hybrid you use
it's a list
You should ask them
Why not use the Oraxen recipe API
because I need also SmithingRecipe and Oraxen recipe API doesn't have that
ah ok
can i force players to enter my server only with my client by coding any plugin?
are you owner?
you can make a mod that does that
Modloaders will already take care of that for you
well, didn't you say that i can't run my server with mods?
your server has no say over what server the client connects to lmao
I've never said that
If you want to add modded items and such you should run a modded server
and also @quaint mantle crossposting in paper does not make it better
Just don't run a hybrid
You’ll never be able to stop someone determined from joining with whatever hacks they want
You can do that, but it's much harder
do mods work more effectively than plugins?
When you make mods you have easier control of server internals
Hello! I made custom enchant and I want to do compatible with other enchants. So pickaxe can have my enchant and efficiency 5. I have made a event that works but I have a problem that my custom enchant removes after adding another enchant. So if I add first efficiency 5 then my enchant all works, and if I add miner 2 and then efficiency 5 it don't work. What could be the problem?
My code: https://paste.md-5.net/amijirarub.java
https://imgur.com/XIAesBwDo you think this will happen on the client side?
i mean item things look like this
example hands
That link doesn't work
You can do that if you want
on clientside?
yeah
aight ty
anyone know why this pom.xml isnt working?
I get core successfully, but the other artifacts dont get added to my external libraries
as far as i understand, im using the right artifact ids too
it also shows up in my maven dependencies, its just unusable
nevermind, i fixed it by invalidating my caches and restarting
that's called the "squidward solution" and it works in almost 70% of cases
Can someone help please. Why my enchant keeps removing even if I copy first and second enchants?
Hello! I'm trying to cancel when the Warden targets a player, but I don't know which event to use. I tried EntityTargetLivingEntityEvent and EntityTargetEvent, but neither seems to be called. Does anyone know which one I should use? Thanks!
ItemMeta overrides all info on the ItemStack, so just move your enchantment actions after you set what you want on the item meta.
Moved everyting after resultItem.setItemMeta but still the same problem
Show code
https://paste.md-5.net/vofahipiri.cs for some way it says that efficiency 5 book don't have any enchants. Without this check it also don't work.
So
Item (with effi 5) + miner 2 (books?) Works
Item (with miner 2) + effi 5 (book?) = only effi 5?
Yep, so If I add first efficiency 5 and then miner 2 all works. But if I add first miner 2 and then efficiency 5 it don't work
So it removes on adding new enchant
Sout 9 was printed? So you enchantment got recognized?
Yeah
In both ways 9 is printing
But enchant don't saves
Just tried again now only miner 2 saves and new added encants removes
Maybe edited something before but the problem is the same
Wanna try meta.addEnchantment? Would be interesting idk
Only thing I can think to try too. lol
nope
All my input now is stupid because of too less brain power at 2am👀
So as I see it removes the last which I am adding after I added miner enchant
Don't understand why
Did you specify something in your custom enchantment?
you mean this: https://paste.md-5.net/ruferizixi.java?
If this is an ordering issue, then you either need to force the item order, or make extra checks for the different ways items can be ordered.
This happens only to the last added enchant
So the other enchants work great
Is there any way to have all players experience the same FOV, no matter their fov setting?
I don’t think so
Even if you apply effects that change the fov those can be disabled in accessibility settings
My main issue is that I don't have the client-side fov
So I can't even calculate how much I should zoom in
Or out
(cuz the client doesn't send it)
Yeah that’s another issue
That's the only issue
.
Wait, what about spectating an entity?
I don’t think that overrides fov settings
I think then the fov doesn't matter
Could be wrong
Decently sure it's just "normal" here
When was entity spectating added?
Idk whenever spectator mode was added
… launch 1.8 and click an entity in spectator mode?
Was added in 14w05 which is just after 1.8. Was in official release of 1.8.2 pre1
And then there was 1.9 right after that
I haven't developed in awhile, whats the deal with new particles, potioneffect, and sound? Is there a breakdown of the changes made?
eventPriority, etc
bump
You didn't forget to register events? try adding some loggers.
I have several events in that class, and they all work fine. Even with zombies or other mobs, the event works perfectly, but not with the warden. I tested it on both Spigot and Paper, and the same thing happens
can you show the code
It doesn't make sense to show it. It's simply an EntityTargetLivingEntityEvent, and that's it. With a zombie or any other mob, the event is called, but with the warden, it isn't
It makes sense, but you do you. try
@EventHandler
public void onAttacked(EntityDamageByEntityEvent event) {
this.plugin.getLogger().info("[EntityDamageByEntityEvent] has fired");
if(event.getEntity() instanceof Player
&& event.getDamager().getType() == EntityType.WARDEN) {
this.plugin.getLogger().info("A player was attacked by a 'Warden' setting the damage to 0.");
event.setDamage(0);
}
}``` did that in a spigot project, so might have to adapt idk.
You're confusing the event. The damage event works, it's just the EntityTargetEvent / EntityTargetLivingEntityEvent
Ok, but it does fix your issue though ~ but if you want to know why the event won't fire you need to debug your own project... cause the event works fine for me.
mm can message me but need more details
https://www.spigotmc.org/forums/hiring-developers.55/ too @winged compass
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
hiii
Ah, thanks
Does someone have utility to apply default attributes to ItemStacks?
Nice, thx
Does anyone know of a way to have players experience the same FOV?
FOV is a client side setting. The server can not dictate it as players have different setups and monitors. The same setting may look different for different players
Is there a way to trigger a soundwave signal for skulk sensors using the bukkit api?
you can use a core shader
cuz the difference of Quake Pro
and Normal FOV is just way too big
is that a clientside modification?
it's in a resourcepack
oh, can I do it with a resourcepack?
don't adjust the FOV, adjust the distance/placing of your particles/displays
keep in mind that you'll have to make a lot of variants of the shader if you wanna support multiple versions
that's what i just said
^^ tho
I have a problem with api that I can't talk about fully for some reasons, but I will try to give you the gist of it.
The problem concerns general processes that affect the whole plugin build. When using an api, a developer can create a process which, for example, by his negligence will return null and then an exception will be thrown and absolutely all plugins using this api will fail. I thought about using error messages instead of exceptions, but I would like to know what else can be done.
Exceptions should not be used for flow control. Detect null when needed
i'm creating a smithing recipe but I have a problem.
Item ItemStack: https://paste.md-5.net/jexawumavu.cs
result PDC(s): []
Can anyone help me to understand why the result item it's different?
Can I make the tab completer make the command field red like with vanilla commands?
no
?nocode
It’s hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.
Pretty sure a crafting recipe will not transfer a PDC when crafted
in the event apply the PDC
yeah but it's not only PDC. there are no attributes, no texture, no name, no lore
sounds like you are matching the default recipe
Could it be it only copies the material and enchantments?
likely
so I need to call PrepareSmithingEvent and set the result?
There is one more problem how to make to listen to the event when all plugins are loaded and the most recent plugin that is loaded realized it and started a certain process
and, how am I supposed to know how much I should adjust?
You adjust so it visible correctly with a default FOV
pretty much no one is going to have a smaller FOV than default
then it looks terrible with quake pro
barely visible
who the heck uses quake pro
Me
who the hell uses normal fov?
me
This
🤝
so is that something I can do in a normal texture pack - that is - make it a server resource pack?
what
I don't think you don't know what a server resource pack is
?
fuckin keyboard
"that is - make it a server resource pack" what does that mean 😭
there's api for that
I do 99% of stuff with packets
you are aware that you need an http server hosting it somewhere
really convenient
just a download link
many places for that
"really convenient" "packets" 💀
thinking of either mediafire or github
typical non-packet user when he hears about packets
have the mc server host it
???
?
packets are NOT convenient
That requires two ports tho
yeah...
you can make em convenient
That is quite problematic in a ton of enviroments
solve things not possible in the api
by... building an api over the packet?
don't think anyones ever done that before 
You can not get the Players FOV so the best you can achieve is a middle of the road implementation
I'm really not willing to say more since you aren't willing to budge
lol
worse than talking to a stone wall
how nice of you
you should at the very least be able to accept critique
so texture pack it is
just so you know, you are mostly on your own with shaders
there is like zero documentation
by shaders
you mean optifine shaders?
there's also probably only like 4 people in here who actually know what they're doing with shaders
You can displace the particles / entities / blocks using those shaders
this is what happens when you ask chatgpt about modern stuff
shader mastermind spotted
Nope
how modern is that?
1.17
nice
but I can install a core shader in a client from a server with a packet, right?
resource pack
so core shaders are a part of those?
yes
you are diving into a whole lot of hurt messing with shaders
can i check if player click advancements menu?
yup
it's possible, but definitely not fun nor easy
shaders. fragment and vertex
lots of math
you need minecraft specific shaders
the fields passed to the shaders are minecraft specific
glsl
and using chatgpt for shaders is a recipe for disaster
can i check open minecraft advancement menu with any event?
Hello guys someone knows how to handle OnPacketSending event in NMS?
Use PacketEvents or ProtocolLib
guys, help
i trying make npc for my own minecraft server for world selection, but i have some problems in my code:
how i can make npc look at nearest player and disable head shaking animation?
Location location = new Location(Bukkit.getWorld("hub"), x, y, z);
Villager villager = (Villager) Bukkit.getWorld("hub").spawnEntity(location, EntityType.VILLAGER);
villager.setCustomName(ChatColor.GREEN + customName);
villager.setCustomNameVisible(true);
villager.setAI(false);
villager.setInvulnerable(true);
villager.setSilent(true);
villager.getPersistentDataContainer().set(new NamespacedKey(this, "menuType"), PersistentDataType.STRING, type);
}```
When spawning and modifying an entity you should use the spawn method that accepts a consumer
The villager should already look at the player from time to time
If that isn't enough you might need to tweak the AI Goals with NMS
i got smth like this, but now i need disable head shaking animation
Canceling the interact event should work
GLSL
Hi
the language typically used in writing shaders, essentially programming on the graphics card
Im trying to sent a sound effect to play for every player everytime someone dies
But theres a small issue:
If the sound plays and i face in an opposite direction, it fades away horribly
Is there a way to go around this?
are you using world.playsound or player?
Depends
Play.playSound only plays to the player
World broadcasts it to everyone near that location
slight confusing part, volume is not the actual volume of the sound to play. Its the distance the sound will fall off at
It's capped between 0.0 and 1.0
Yeah that won't do anything
But it still fades away
The actual volume is client side for obvious reasons
I need to fix this so bad
Its like the only issue in the whole thing
WAIT
What about MinVolume?
Volume is clamped between 0.0 and 1.0
All other controls are client side for obvious safety reasons
How much is 1.0
Furthest range
Idk I'd have to look at internals
Probably client code
Im good with 100 block radius
what sound are you trying to play?
does it really matter if it is quieter when the player turns around?
Yes
I want it to be loud everywhere you look
your only real choice then is to play it to each player individually
with a full volume it should play correctly and follow the player if they move
My current parameters for volume are
Volume: 100
Pitch: 0
But i havent tried minvolume
In these settings the issue still persists
if Player#playSound is used it should follow the player, World#playSound plays at a specific location.
a player playSound should not go quiet if they turn around
You mean player.playsound?
unless the sound is played from a resource pack and is not a mono audio file
?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
!verify
Usage: !verify <forums username>
so this is a resource pack sound?
Theres 2 sounds
The vanilla blaze death goes first
Then rada final
But both fade away after i look away
odd
Im gonna try to add MinVolume
https://paste.helpch.at/pakepawani.kotlin
'sh' is not recognized as an internal or external command,
operable program or batch file.
trying to compile 1.12.2 on a windows machine for maven repo
well that's odd
Try running it again in an empty folder
works now, i had an old version of portable git when i first used the buildtools
Is there a way to naturally change the killer in an EntityDeathEvent? Trying to make a particle gun without a projectile. I don't want to just change the death message and fake a killed by player x, I want minecraft to think he got killed by it, but is that possible? (Reason is, I want my plugin to be compatible with others, and if I'd make a custom death message such as (xy got killed b xz), it wouldn't be..)
can i make per world datapack?
i have multiworld plugin
when i add my datapack to multiworld's world
doesnt working
only working default bukkit world
I mean you could just make your messages configurable in some config file or something, otherwise I think you'd have to invoke your own event given the deathEvent would have already been given it's killer, cause, etc
can i set player oxygen when moving land?
what
yep?
i wanna decrease player oxygen
when walking land
not only for water
is this possible?
https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/attribute/Attribute.html#GENERIC_OXYGEN_BONUS
Maybe you can mess with the attribute, not sure if the player has this one but I would assume so
declaration: package: org.bukkit.attribute, enum: Attribute
this not work for me
Why
You could make a running timer that could lower the remaining air a certain amount every tick?
outdated I assume
#setRemainingAir
what u think for this method?
@EventHandler
public void onPlayerAdvancementDone(PlayerMoveEvent e) {
e.getPlayer().setRemainingAir(1);
}```
declaration: package: org.bukkit.entity, interface: LivingEntity
this is terrible btw
Every time a player moves their oxygen will be set to 1 tick not what I think you want lol
yeah thats why I was saying a timer, lol! I just started doing this again though so I need to figure this crap out again lmao
or I guess it would be a Runnable
havent really dabbled in Java since like 2014 lol
Use j21 now kek
It's pretty fun
spigot benchmarked j21 uh
1.20.4 iirc
one of the 1.20.x
I don't know your experience level, but if you want to critique or give me some advice, feel free. I'm working on a command (doing everything from scratch so not perfect)
Not gonna read it cuz I bet you're not using a command framework
nah
Don't reinvent the wheel kek, couple good libs for command framework
Not sure what you mean by that xD I'm really just using the built-in parts and running the arguments lol
I cannot for the life of me find the link
Well another thing you could do is just use the command map for direct registration of commands
removes the need to put them in your plugin.yml
Well here's a question then, I can get over the command part but I want to avoid using Static as much as I possibly can but cant remember for the life of me
I have all these "managers", which I want accessible from everywhere
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
So essentially they're just utility classes, but they just contain Map/HashMap for available data.
Util classes should never hold what you'd call state
If it's a manager class, just use di
Otherwise for stateless operations such as like math calcs or wtv, those are fine as static methods
This was my impression from what I remembered, I just couldnt remember how I pass over the information to avoid using statics for stored data essentially.
Yeah I just wanted to get it all settled before I really get deeper into the development of this project, lol.
Yeah no worries, I know that cafebabe has some good links
(the bot)
#bot-commands and check the commands
aight
yeah I'm just working on Property claims right now basically (not trying to use WG or other associated plugins)
I hope that's just for practice lol no reason not to use wg
I have it this way just because of the end goal
Territory / TerritoryManager -> Property / PropertyManager lol
Territory = ChunkData basically / Property is just like more specific data
but then falls into Town / Nation
sort of developing it my own way because of all the different aspects
not specifically just for protection alone
if that makes sense to you lol
Sure but I mean you could use wg for the region stuff and then just do whatever you want with those regions whether it be permission aspects for protection or whatever, wg just makes it easier
seeing as wg already comes with certain flags and what not though I would say it's easier anyway to just use wg, that's not to say you can't manipulate it in a way that suits your use case better
I'll probably look into it, I just don't want to really rely on dependencies so much lol
Just because I want this to function as a standalone basically.
end-goal is to make this kind of work similar to that game Eco (but with more of a PVP Aspect)
You could always just add the lib to the project so it compiles with it rather than shading/normal dependency stuff
i'm not doing anything with this, I did it just to test it?
LOL
No shame in "relying" on depends tho, why reinvent the wheel simply because "I don't want to have so many depends"
ok?
tbh part of it is also because I dont want to learn APIs for other stuff lol
Still kinda terrible for testing imo but sure
More knowledge is more knowledge mane
fair enough anyway I gotta head outa here gl with the project man
It's just what you gave at face value, lol.
wdym?
It's just the information you gave, lol. If you're gonna test it differently then thats fine, lol.
who knows how to make a mob move in the direction the player is going? It doesn’t matter what kind of mob it is, absolutely any
need protocol lib?
It's been awhile but I think NMS changing its AI basically.
So if you can use ProtocolLib to work with the pathfinding then thats one option.
private PacketPlayOutChat packet;
public ActionBar(String text) {
PacketPlayOutChat packet = new PacketPlayOutChat(ChatSerializer.a("{\"text\":\"" + text + "\"}"), (byte) 2);
this.packet = packet;
}
public void sendToPlayer(Player p) {
((CraftPlayer)p).getHandle().playerConnection.sendPacket(packet);
}
public void sendToAll() {
for (Player p : Bukkit.getServer().getOnlinePlayers()) {
((CraftPlayer)p).getHandle().playerConnection.sendPacket(packet);;
}
}
@EventHandler
public void onPlayerJoin(PlayerJoinEvent e) {
Player p = e.getPlayer();
ActionBar actionBar = new ActionBar(CC.translate(ConfigFile.getConfig().getString("ACTIONBAR")));
actionBar.sendToPlayer(p);
}
}```
how do i make this message to stay and not to go away
Friends who do not need discount telegram bots or perhaps plugins or sites can be made for a reasonable price, I will be honest, I am collecting for a new video card that I dream of, I am not enough, so I am looking for buyers 
I'm going to start going REEE with this one
would this work?
that image definitely should not happen
and I can't even think of a good way of debugging this
That doesn't do anything
All you did was create a variable
ye nvm
is that eclipse?
i was read and i gess protocolLib not give me create new entity with classic logic
I don't really have a great answer because I havent done it for years, but I remember before when I did it, I used NMS.
and I don't usually recommend using NMS unless you know what you're doing and want your plugin to break on every update.
keep in mind that even eclipse will warn about unused vars. Judging by the syntax highlighting that is firmly IJ though.
well heheh i need create something hard
its intellij
i haven't seen this color style in intellij
its a theme that im using
u can get them here:
https://plugins.jetbrains.com/search?excludeTags=internal&tags=Theme
theres plenty of them
i see
I have a mob from a mod and I need to somehow change its logic and take the horse functionality and put it there
i try create custom horse usage custom mob
do you have an api to this mod?
what's the name of this mod
this mob has its own letter identifier and pig logic
sec
this castom mod💀
bruh
all entity has move logic right?
so i can somehow change
?
or i need use ai
idk
change path logic
it is not exposed, you either need a library that gives it to you or you need to use nms
so i can succeed with mobs flying or controlling them?
i think so
tho the dragon is a bit more complicated as far as i know
if you mean to make mobs fly, you can achieve this pretty much from bukkit
just send a direction vector to a mob and they'll fly however you want them to
hm
i can just change entity path ?
i mean say him "move"
and he will move?
with bukkit
wdym by class analog?
in nms it's either EntitySentiant(i think md5 mapping) or Mob(i think is mojang name)
that has the look controller move controller
and the jump controller
i mean in bukkit if i will get by id this will be Mob class
not Entity
wouldn't it be more like public class EliteZombie extends EntityZombie
just an example, like you're extending the actual base entity you're trying to extend and go off of
hm
Player#sendTitle()
No need for NMS when you can control all the timings with the API.
declaration: package: org.bukkit.entity, interface: Player
That's titles, not actionbars
But @lethal onyx You can player.spigot().sendMessage(ChatType.ACTION_BAR, ...) or something similar
Oh, woops
But yea, player.spigot().sendMessage() should get the job done.
Will still have to have a runnable to keep it active though.
Cause we don't have control over actionbar timings sadly.
Actionbars are just system messages with overlay set to true
is there a way, with protocol lib, to disable the sound of footsteps?
Yes
pls help me in setup of essential chat
i have installed it on server but its not working
PacketType.Play.Server.NAMED_SOUND_EFFECT is the protocol?
yeah, its like 10 or so entities put together to make one
Hey guys, I'm coding a guild plugin and I encountered a problem, there is a suffix tag in the plugin, and this tab makes the tag visible, but I also use a plugin called TAB These two plugins conflict and my tag is not visible, what do you suggest about this?
TIL that PlayerStatisticIncrementEvent doesn't fire for certain statistics
nothing a little NMS couldn't fix >:)
muahahahaha
🔫
I'm specifically interested in the playtime one
If a spigot plugin specifies API version 1.20.4 in the build.gradle, but doesn't use any of the newer API, will it work on older versions?
It'll throw errors
Just set it to 1.13 and move on
https://paste.md-5.net/xijeluvuha.cs
i'm using this, but the step sound is null, why?
[22:21:58 INFO]: null
[22:21:58 INFO]: null
[22:21:58 INFO]: null
[22:21:59 INFO]: null
[22:21:59 INFO]: null
[22:21:59 INFO]: null
[22:22:00 INFO]: null
[22:22:00 INFO]: null
[22:22:00 INFO]: null
[22:22:00 INFO]: null
damn does 1.13 not have PDC?
This is the code. It gets called with any other mob, but the only one that doesn't call it is the Warden for some reason
ok 1.14 does
Anyone have a good library suggestion for MySQL?
doesn't java have a default one? with java.sql classes like DriverManager and Connection
it's ass
Well yeah, I just figured I'd ask if anyone has a preference besides that one.
About to start database integration in my plugin and wanted peoples opinions on all that, lol.
Ah no I'm not using kotlin
I'm not sure what's wrong with jdbc
can i make per world datapack?
https://paste.md-5.net/oyovajekew.java
How can I make sure that this command can be executed one or more times according to what is defined in the config.yml?
I don't understand why but all sound made by a player is null
Hello. I'm trying to create spoofed players, which is basically replicating player behaviour. But I don't listen to incoming packets except a few ones for sure so the spoofed players don't receive unnecessary information and put a high load on the server. In the network side, I'm replicating NioSocketChannel class with the name FakeChannel. However, I have to filter ClientboundCustomPayloadPacket so some plugins which use messaging system to sync player data can function properly. But the issue starts here: I override writeAndFlush(Object msg) method. Here, I only accept ByteBuf, String, PacketPlayOutSetSlot and ClientboundCustomPayloadPacket. But when a ClientboundCustomPayloadPacket passes through, I get this error: https://pastes.dev/Uz1UTkQS5J
What seems to be wrong with this? If you could help it'd be awesome, thank you.
you want to add a limit to the amount of times you can execute the command, or what?
well just keep track of how many times the command was executed (maybe with PDC of the player)
yes yes yes, I already did it, the bad thing is that when I restart the server, the command is enabled again
yeah use PDC, it persists between reboots https://docs.papermc.io/paper/dev/pdc
you need to store that value
so that it persists
it lets you store data on the player (or any item/entity)
eee no era spigot
because even reboots/reloads it will reset unless you store it/load it back
mmm ok
the article documentation works for spigot too
I understand
just think of it like, if you have player /homes, these are saved in files and loaded
same concept, thats the only way you can retain it between reloads/reboots
?pdc
I understand, thanks, I'll try to do it, another thing, do you know of a command called /redeem, I'm creating that, I just want to implement a check-in system, that is, if I use /redeemckeck <user> tells me who I vote for and so on!
package org.eredeem.commands;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.eredeem.ERedeem;
import org.eredeem.utils.MessageUtils;
public class RedeemCheckCommand implements CommandExecutor {
private ERedeem plugin;
public RedeemCheckCommand(ERedeem plugin){
this.plugin = plugin;
}
@Override
public boolean onCommand(CommandSender sender, Command command, String alias, String[] args) {
if(!(sender instanceof Player)){
if (args.length == 0){
sender.sendMessage(MessageUtils.getColoredMessage("&cSi vale"));
return true;
}
}
Player player = (Player) sender;
if(args.length == 0){
sender.sendMessage(MessageUtils.getColoredMessage("&cSi vale"));
}
return true;
}
}
this test command
unsafe!/
Your checking if it's not instance of player
no FFM!?
Infact I can't see where the braces end
Store who they voted for
move the first return true; outside the next }
spoofing is bad!
mm saveConfig?
I'm not trying to hide it?
Store it wherever you want
I literally said "spoofed players" in the text
ok ok
tragic
I'm having a hard time with chunk snapshots 😭 When trying to getBlockType(), the code passes the validateChunkCoordinates() check, but then throws an index out of bounds exception when trying to access the corresponding section: Index 24 out of bounds for length 24. Since the coordinate check succeeds I assume that the call I am doing is valid, but some math inside the snapshot class is misbehaving.
can you share your code with us please?
Yup, hang on. I'm working on producing some logs that show the values I pass
Hm. Looks like I'm accessing y=320. That's probably not supposed to pass validateChunkCoordinates()?
319 is height limit so 320 is too high
declaration: package: org.bukkit, interface: ChunkSnapshot
there you have the bounds
Supposedly
y=320 passes
static void validateChunkCoordinates(int minY, int maxY, int x, int y, int z) {
Preconditions.checkArgument(0 <= x && x <= 15, "x out of range (expected 0-15, got %s)", x);
Preconditions.checkArgument(minY <= y && y <= maxY, "y out of range (expected %s-%s, got %s)", minY, maxY, y);
Preconditions.checkArgument(0 <= z && z <= 15, "z out of range (expected 0-15, got %s)", z);
}
Yup, the code does a <=
I'll fix my own code though, and see where that gets me. I'm not supposed to be checking 320
Math is hard
Yeah that solves it
Does anyone know a list where I can see the particles for net.minecraft.core.particles.Particles;? called Particles.a,b,c...
nvm found it
Bump
guys guys
I have 2 plugins. How can I integrate them with each other? I want to get data from one plugin data.db from another plugin
make a public method and then use it from the other plugin
there's a particle api...
Uff.. just did it so i could use the increased distance boolean and just saw that there was one in spawnParticle 🫠
EndlessMode:
1to5:
zombie:
6to10:
zombie:
cow:```
how would i double loop this
i want to get every section in EndlessMode, then loop through that section
this is all in config.yml
is there any way to check if an item in the left hand would be 'usable' or 'consumable' if the player right clicks?
for example, a shield in their left hand would start blocking, bread in the off-hand would trigger eating only if their hunger is below 20
but a grass block in their left-hand would not be usable
compare the material?
for each : config.getConfigurationSection("MobDrops.EndlessMode").getKeys(false)
```Then you are able to get the values in every section of EndlessMode.
I think you can maybe use Material#isEdible or Material#isInteractable
for context, im trying to detect whether an item in the offhand will actually be consumed by the player or if it will not.
for example, holding carrots in the off-hand, with full hunger, when clicking the off-hand will not make the player eat.
however, holding a golden apple in the off-hand, regardless of the hunger, will allow the player to eat
im trying to differenciate between successful off-hand actions and right-clicks that don't actually do anything
Little NMS could help 🤔
Food components -> can always eat
what about a more generic approach though
for example, if a shield is in the off-hand, that's always usable
what im trying to do is to cancel main-hand behaviour if the off-hand has available function.
any specific approaches?
use org.bukkit.event.player.PlayerItemConsumeEvent
and compare the hands
and materials
Item#use returns a result holder
is this regarding NMS?
Yeah
If you use the PlayerItemConsumeEvent, you can get the hand they used and the item they used
Thing is it causes side effects
without using NMS
that will not work, blocking a shield doesn't call that event
Things like shields might trigger consume event
i tried, it doesn't
odd
let me double check again
yeah that doesn't work
that event will only fire after something is physically consumed by the client
Might be wonky given the client sends packets saying what hand it's using
what about PlayerAnimationEvent?
You could mess with hands at a packet level
intercept packet, change the hand if it matches your conditions
this'll prob mess up
i doubt that will work either. seems really minimal
unless you set the item, set the hand and at the end of the tick set the item back
i have custom items in the game that has functionality when interacted with. Im trying to stop that functionality if the off-hand has available function. so in other word, off-hand gets priority if needbe
but i dont wanna do that! 😭
ill have to keep updating it everytime an interactable item is made
surely there's an abstract way to do this
PlayerInteractEvent seems like as abstract as you can get it lol
and you can still getHand()
but this event doesn't tell me if the item was actually interacted with
might as well be called PlayerClickedMouseEvent
regardless of whether i can eat the carrot or not, the event will fire. regardless of whether the shield is on cooldown or not, the event will fire
i guess this might be the way to go
but i want to make sure that this specifically doesnt already exist somewhere in the API
How do you avoid causing redstone to drop if you use .update to update a block with redstone dust on it back into a regular air block?
Add false for no physics
Is it still the case that there's no proper way to read datapack biomes from blocks?
Ie. we expect all blocks in custom biomes to only report "minecraft:custom", and that's that?
BedWars1058 plugin help:
There's a really long wait after finishing a game and then redirecting you to the set lobby
Any way to shorten this to like 5 seconds or something?
don't crosspost, and plugin questions like those are really specific so you're better off asking the developer themselves in the discussions tab of the resource
what is crossposting
posting the same message in more than one channel
questions like that go to #help-server, but as I said, it's kind of specific so you're better off asking the developer. This channel is for plugin development questions
nobody in the bedwars1058 server is helpful or actually answering my question 💀
well, if they can't answer it there, I can't imagine anyone here could either
just use a plugin with better support ¯_(ツ)_/¯
with the API, yes
I assume you still could get the backing registry to get the proper key if anything
its not that they cant answer its that the server is dead ;-;
The key is all I need
you're not being made fun off, you're just being told to follow the rules. Support for specific plugins is rarely given around these servers anyway, unless the plugin is really well-known like say, WorldEdit or LuckPerms
just read the rules over again and it never said no crossposting
Awh man we really need to convert biome
Thank you, but I've already seen this. Using OBC/NMS is impractical bordering on impossible
why so? It is just a little bit of reflection
Sure, not as convenient as the API, but there's no alternative to that. It's either doing it yourself or finding a library that does it for you
My plugin has to support Minecraft versions 1.16.5, 1.17.1, 1.18.2, 1.19.2, 1.19.4, 1.20.1, 1.20.2, 1.20.4, 1.20.6, and 1.21.1. I am already using Manifold to do some hackery, but having to maintain working NMS code for all of those would drive me insane. Not to mention that I'd have to run Build Tools in my CI/CD?
that's why you'd do it with reflection/method handles, so that you only have to make changes if there is actually a difference in a newer version, otherwise you just use the default implementation (excluding the fact that the package changes every time)
people do choose to avoid reflection and do multiple modules instead because it is more clear what the intent is and it doesn't silently break like a reflective implementation would (this is preventable by forcefully disabling the functionality in unsupported versions unless some kind of configuration option is given to ignore it), in which case you'd have to run build tools in your CI/CD, yeah
nowadays it is easier than ever, if anything, with official mappings and remapper tools to aid in the understand of internals
all of that being said, the choice to maintain multiple versions is really on the developer. I do not believe it is necessary to keep support for that many versions behind when there's literally no reason for people to not upgrade besides maybe some plugin that went unsupported, at most I'd maintain the last 2 versions behind but that's it
Honestly multiple modules is the way to go. Also cutting fat of versions that are less than optimal to keep supporting you could cut every version up to 1.20.4 with minimal impact
tbf if your plugin is old, there's no harm in keeping support for the old versions since the implementation won't change, the issue is when adding new features or reworking things, that's when you just have to inevitably drop support for some versions
I would gladly, but the list of versions comes from the parent project, which is not mine
I mean you can always cut support on your fork
There no need to maintain 1 to 1 compat
So long as it's explicit your fork doesn't support those versions I see no issue
Mine is more of a companion, but you're still correct. I'd of course prefer to maintain compatibility if possible though
The current issue with not getting the correct biome key simply manifests in incorrect colors for the player
yeah, getting biome keys is a weird hill to die on
what you can do is instead just not support this specific feature for older versions
True. I can leave it the way it is right now for the ones that want to run stone age Minecraft
or maybe incrementally add support for the older versions as you find time to implement and test it there, as long as it is requested
this is also a good way to promote people to upgrade
The plugin still has a quite small install base (100 - 150 servers), so stats aren't necessarily representative of the potential
but I guess this is a good place to start
Ideally Spigot would just provide the API but we can't just sit around and wait for it, can we 😛
I will make my own API, with blackjack and booze
I'd imagine it wouldn't even be hard to implement, just nobody interested enough to PR
@river oracle wink wink
I'll make a donation to whoever implements it for 1.21.1, and an additional donation for every version it is backported to x)
are backports of API even possible, as in, does Spigot even merge those I wonder
Probably not
if they do and those branches aren't just kept frozen, I'd be interested in backporting a few APIs tbh
if not, I'm surprised there's no one making a fork to provide new API to older versions, where applicable
time to make Cursed Spigot
very rare occassions where a issue is fixed and backported
but 99% of the time no
Marvin has all the diff
it just needs a PR I could throw it together, but it seems like nothing is getting merged atm
md is probably working with the snapshots to even bother
yeah what I figure
I will do it once 1.21.2 drops whenever that may be
they already added the derp- creaking, so that'll probably be soon
I am rather dissapointed at how derp it is, but ig since updates are drops now, it is what it is
yeah it seems kinda purposeless
I hope it gets tweaked
otherwise it'll be just another one of those things that is just kinda there and you can just avoid and never have to deal with
not to mention that the mob itself isn't even really a threat
I want it to be more violent and able to teleport, also maybe for it to get angry whenever you try to remove their heart
meh idc if they don't even touch the mob as long as they give the biome a purpose cuz like you can do legit everything in the biome without being under threat during the day
like give me a reason to go at night
also for the biome to be much larger so that you have no choice but to go through it
I kinda don't like that its just a dark forest
but that's lowest on my list of complains vs the need for actual purpose
I'm fine with it being an alternative dark forest, I just don't find much purpose about it since you can just go around it with no issue
if they implement some purpose the fact its a dark forsest reskin is fine
then again, if it were to be bigger then people would ask for more things to be in the biome, so it is a lose-lose situation
the fact that the mob drops nothing is also rather disappointing
I couldn't care less about the advancements, they don't reward you for them in the game anyway
I feel like the downside with drops is that they have this cool idea, but they gotta add it by December and once it gets added going back and improving it becomes more annoying
if this was a yearly update I'd feel way more confident with their ability to actually morph this into something neat
they just began experimenting with this new version format so I assume we're getting the worst of it right now and it'll get better as they adapt to the new release cycle
probably yeah, this is a really cool concept I just hope they pull it off and it doesn't end up being pointless
like honestly Trial Chambers are dope as hell 1.21 was a super great update
I do not like how comfortable they've gotten with experiments either, like bundles went through 4 major versions before it is finally going to be out of experimental phase lol
They are scared to change stuff experiments get them feedback before snapshots
my thoughts on that
e.g. if they added that redstone or minecart stuff to a snapshot people would have probably freaked out
I am fine with experiments as a concept, they're good to gather overall reaction and feedback
the issue is with how long they take to actually implement that feedback if at all
if that's how it is going to be, then there's little reason for it to be a experiment at all, and it isn't like they're scrambling for developers to work on these features either
yeah, I mean the thing is idk how big their java team is, but they also gotta develop the updates, fix bugs etc etc
I wouldn't be surprised if they implemented experiments of ideas for updates they wanted to do 2 or 3 major updates down the line
I think most of the time is lost in having to coordinate which features get implemented across all versions considering they have to sync with bedrock as well
so probably a lot of bureaucracy to get things going on
it is funny to think about seeing how these have diverged vastly already but eh
I've always seen bedrock as the problem child xD, but its clear that's microsoft's pride and joy
Is there amy way to detect a structure or a biome and spawn a custom mob?
can any1 help me with chat core plugin?
whats event for natural regen
only for some things, not everything is synced with bedrock
there is still plenty of stuff that java edition has that bedrock doesn't and there is stuff that bedrock has that java edition does not
I am aware, that's why I followed it up with the comment below the one you replied. That still doesn't mean it has to go through some kind of internal process which for sure it does
in the context of the player?
declaration: package: org.bukkit.event.entity, class: EntityRegainHealthEvent, enum: RegainReason
you can check for some of those enum fields
in entityregainhealthevent
ty
which one do you guys prefer?
ignore the highlighting if you can
i think the one on the right is cleaner, tho removeIf feels used abusively here
depends on the call frequency
For methods that are rarely called, the right one is fine
Because the right one has more overhead behind the scene with removeIf?
yeah
I mean "overhead" is kinda crazy
although the overhead is comparatively miniscule
Im bad in english, i didnt know how to describe it. Wanna explain more how you would call it?
that being said these margins can add up, so I'm usually less negligent on that front outside of code I know will only be run at startup
The right looks objectively better. Unless it's a hotspot no reason to make it not look good
Tbh the amount of calls needed even if it is a hotspot would be insane
Muh CPU CYCLES
it should be fine
in hotspot code JIT would kick in, so it's actually pretty much the same in a hotspot code
i don't expect 100 parties
Because of your ?, "I mean "overhead" is kinda crazy", i mean why is the call with "Overhead" kinda crazy, how you would describe whats the issue on the right when its get frequently called
there is effectively 0 issue with either of the code being called very frequently
The overhead from removeIf is so tiny calling it overhead is wild
So it need to run just often enough for the margin to be small enough to be noticed (when added up with other margins), but not often enough for the C2 compiler to kick in
In the end it's just a question of writing whatever you like most
Idk what you've been told but the functional methods while technically slower are so much little slower that optimizing for it is probably the last thing on the chain of optimizations
You'll save like a marginal amount of nano seconds
They are the same once compiled actually
Really? I mean I haven't looked at java bytecode but does it really compile down to jmp statements
I thought for sure it'd be a method call
removeIf on fastutil collections is OP af
But only when bulk-removing, if you rarely remove stuff or only remove few things, it'll be slower because of the overhead associated with the removeIf method
Fastutil my beloved
not me removing every second element hehehe
b-but i'm running on an arduino nano!
imagine if like, the server would be doing that
on like, a large af list
that would be very funny
Im not going crazy right? this should work...
ConfigurationSection acceptSettings = this.core.getConfig().getConfigurationSection("Applications.Settings.Accept");
Applications:
Settings:
Accept:
Announce: true
Annoucement: "&a[player] &7Has just been accepted into the server!"
Commands:
- 'setrank [player] Player'
Chats:
- "&7Welcome to the server! &a[player]!"```
saying the section is null btw
Yml lint is saying its good
did you load the config?
Yes, its the default config.yml
did you save it into the plugin folder?
Yes, everything else works fine
bruh
guy gave me a task to write a program which returns all words in the text file and how many times this word appeared
and then this happened
String correctedLine = line.replaceAll("[^a-zа-яα-ωΑ-Ωŋё-֊־‒–—―⸗⸚⸺〰゠︱︲﹘﹣-' \\-]", " ").trim();```
look at this regex
i didn't even know this characters existed
i had to decompile the shit to get them
😮 you are back
hello, any recomendations for a unified permission system for proxies and servers
heyy, does anyone know if it's possible to create custom advancements without using NMS?
LuckPerms
just use nms frfr
Can I spawn npcs (for corpses) without nms in 1.21.1? trying with and there is no gameprofile anymore and neither CraftPlayerProfile nor PlayerProfile is working.
i thought you could make them with resource packs or whatever
arent they data driven?
data packs
they really aren't but sure
i mean a resourcepack is just a datapack but for clients
that's not even true either lol
Hm.. okay, and what happened to GameProfile? I still need it for the EntityPlayer..
It still exists
Can't send screenshots.. but can't import it. Using api1.21.1 R0.1 and server1.21.1-R0.1 dependencies
right, but does it support multiples proxy sync? I seen that for server you use a context and works. But not sure if works for many proxies.
Also i seen that they api is a mess. You have to do thosens of things just to get the user rank name
sure it works for multiple proxies
anyone?
oh right, i wil try it. Thanks man
i don't want to sound rude. But we must wait for answers patiently. Also if ur message get lost best option is to open a thread on this channel
I only bumped the message because it was lost
Hey,
Any handy public/popular micro libraries for protecting specified blocks from all forms of damage (player/explosion/mob grief/form/decay etc etc)?
bonus points if it persists the specified protections.
Or am I best just handling all of the possible cases myself?
Hello, good afternoon, sorry, I don't speak English, I speak Spanish, I really have very little knowledge about programming a plugin, I know the basics of how to configure it, view files, etc. But I am in the middle of creating a Minecraft series which increases in difficulty but I want to add features such as pressing a button to make you instakill or things like that. Is there a plugin that makes it possible or some way to add difficulties?
@river oracle If you're around, could help me with something in vc?
I'm at the library doing an essay atm I'll lyk when i get back
Bet
it prob won't be soon tho
It's all good
You can do that with command blocks.
hello
i want someone who is unregistered on the server to be spawned in a place different from the spawn one and after they registered they ll be teleported to the spawn
is this available only on bungee?
Hey, Im looking for a way to essentially glide users in a specific way within a world. Essentially what I want to do is create a "cutseen" which takes users from a starting position and ending position, with it dipping to black to cut to different places.
But would it add some kind of lag
Or every time I restart the server do I need to activate them again or do they only work for a specific area?
can someone help me there?
how can I integrate two plugins with each other?
how do i make subcommands
Using few command blocks shouldn't be a problem.
I'm not entirely sure about it because I haven't played with command blocks before, only plugins. However, as far as I'm aware, you don't need to activate them again. I suggest watching videos about the technical aspects of command blocks.
I mean if you do it as a plugin, every time you restart the server you would have to "activate" the way the plugin handles it again if you have a required state that needs to be saved between reloads/restarts. That might be more of a hassle to deal with if you don't have any programming knowledge versus using command blocks if command blocks can achieve the same goal you're trying to do.
There is a pvp plugin, it manages parts like kills death kdr and saves it in the data.db section. Additionally, I created a plugin called rank and in it, I will create a rank jumping system according to the player's kill amount, but I couldn't understand how to get the kill amount in pvp in the rank plugin
check if the pvp plugin has an api
Both belong to me
then write an api
Ok here is my problem, I will use a roulette datapack that I must use a command in a command block to activate it or activate it from the chat that makes the roulette appear for all users on the server and 2 command blocks that one is to play a decorative sound and the next to place a message something like, Red roulette
An electric crepper will appear at the location of all players
I could do everything through chat, it would be to agree with the person I will hire to put the message roulette wheels, etc.
The problem here is that I can't find anything similar in any YouTube video haha :C
A while ago I bought a plugin that makes the drops of mobs change. You can choose what you want and that is useful for me to make the difficulty more difficult, do you understand? But I would like to see if there is a plugin that can modify things in Minecraft. How hungry a food makes you, how much harm does such a thing do?
then
use it
considering you're in #help-development, you are going to get better plugin dev advice
the things you describe are possible for sure
They're possible, but whether such a plugin for such a niche purpose alone exists? Not too sure.
You would really have to either commit looking deep into plugins compatible with your version of Minecraft or see if anyone is willing to develop a plugin to do that for you for free, or commission it out.
or make it yourself.
Like, alone a plugin to change how food affects you alone isn't hard to make. But it really depends on the full extent of how much you need this plugin to do for you.
wowww, I didn't think it would be this simple... I know these things too, but I don't have enough information on how to do them, so I wrote it here
It's something very specific, that's what makes it more difficult.
If it is the problem for someone who cannot afford to pay someone, besides it is hard work, I respect the work and knowledge of any person and I have obtained knowledge based on trial and error, but I have not yet ventured into really basic things. create a plugin from 0. that's why series with streamers are very expensive because of all the development, plugins, datapacks, texture packs and mods that are made for the series
Bukkit.getPlugin("YourPVPPlugin")... access the API you wrote to fetch the data you need.
It's actually not hard to make basic plugins with simple goals that you are describing and its likely more worth learning because the skill threshold required isn't very high honestly.
I understand, I will see if I hire someone to make me a plugin that adds the difficulty changes like what I mentioned, for example the captus now do a thousand damage or something like that
So is there anything I need to write in pom.xml or anywhere for this?
The spigot website has basic tutorials that can get the point across very easily if you follow step by step.
I have this month to learn everything I will use and how things will work in the series, it is not a paid commission, it is my own series, a project for people who are not famous like me and can enjoy a series with a little quality
I'll see if I can find them in Spanish, maybe I can make my own plugin haha, wish me luck, I appreciate your time and your interest in answering me.
https://www.spigotmc.org/wiki/spigot-plugin-development/
You can try to get a translated version of this page.
and there's also this but I don't think it covers translations for plugin development: https://www.spigotmc.org/wiki/spigot-espanol/