#help-development
1 messages ยท Page 488 of 1
I have no clue how id do it on 1.19.4
use an actual variable name and not just repeating the class name..
C# dev
im new to coding java
rename "WeatherChangeEvent" (the second one in the first line) to just "event"
then you're fine to go
C# devs don't obscure their types like that unless they're equally amateur at C#, lol
Yeah they wrote broken code earlier and said they were a C# dev
rip
The code wouldn't have worked in C# either
im bad in C# too breh
๐
No
The class name might be different without mappings
If you are using mapped its CompoundTag iirc
^^
Alright
Yeah but no mapped for 1.8
it was never called NBTTagCompound?
It was
1st one
1st is moj maps
Wait
You're doing this in 1.19.4?
You can just use the API to apply attributes
No need for NMS anymore
are you talking about atributes or PDC tags?
They wanted to change damage with attributes
oh ok
yeah no need for slughorn
attrributes are part of API since like 1.13 or so
or even earlier?
Yeah
idk
It's old
btw olivo, I realized uxor actually got oraxen working on jitpack
but a few months ago, this was not the case
anyway, it works now, and that's great
i think the issue was that they used the "all" classifier to publish it
I wanna set the attack damage although
Not add to it
(shadowJar)
The API does the same thing as NMS
can't you just change the baseValue of that atrribute then?
Since the API runs NMS for you
This was my prior code:
modifier = new AttributeModifier(UUID.randomUUID(), "generic.attackDamage", 9, AttributeModifier.Operation.ADD_NUMBER, EquipmentSlot.HAND);
meta.addAttributeModifier(Attribute.GENERIC_ATTACK_DAMAGE, modifier);
But I want it to set instead of just add
Not possible
You just need to do very basic math
Get the base damage and see how much you need to add or remove
will this work ?
?tas
This should set the damage to 9
Once you add a custom attribute the defaults ones are gone
hm you sure?
Yes
Nah it adds to it
Eh?
I tested it
At least in new versions it shouldn't
I do believe you're wrong Coll
I use a wooden sword which has base damage of 4 and adding 9 to it made it able to kill the warden faster than netherite
but I would have to double check since it's been a while
I can test that real quick
When I make a shapedrecipe outside of my main class can I just used NamespacedKey.minecraft instead of a new NamespacedKey?
Normal stone sword deals 5 damage, kills villagers in 4 hits
you can, you shouldnt
Stone sword with a +5 damage modifier kills villagers in 4 hits as well
use NamespacedKey.fromString("myplugin:smth")
Actually I guess it is technically additive to your base damage of 1
So a modifier with a value of 9 would be 10 damage total
why this is not working ?
k
does anyone know if there is anyway to obfuscate the seed sent to players by mods like seed cracker x? They can use it to download to world then xray to bypass antixray. Wondering if anyone knows anything ?
You'd do like Paper. Have a bunch of different seeds for each feature
just add a limit to how much diamond you can mine per hour
Not perfect but harder
?paste
will this work ?https://paste.md-5.net/ibakosolav.cs
oh
seed-village: 10387312
seed-desert: 14357617
seed-igloo: 14357618
seed-jungle: 14357619
seed-swamp: 14357620
seed-monument: 10387313
seed-shipwreck: 165745295
seed-ocean: 14357621
seed-outpost: 165745296
seed-endcity: 10387313
seed-slime: 987234911
seed-bastion: 30084232
seed-fortress: 30084232
seed-mansion: 10387319
seed-fossil: 14357921
seed-portal: 34222645
Change those
They are in world-settings in spigot.yml
Or you can do it per world
nvm looks like im fine seedcracker cant even rip the seed xdd nice cheats dev
if nothing should eat yes
seed cracked can get the seed instantly by going to the end
this is not working
do you register the event
no how
oh yeah ive register it
Bukkit.getPluginManager().registerEvents(new Event(), (Plugin)this);
on enable add Bukkit.getPluginManager().registerEvents(new YourClassName() /* or this if its in your main class */, this);
where are you running this
?eventapi
bc im bad coder
oh in the onEnable()
dont cast your plugin then
cast ?
(Plugin)
you would understand what that meant if you learnt java
but idk where i can learn java
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
hi I now that it's not the exact right place to ask that but can you help me with itellij ? I tried to create a new gradle project on itellij but i got this error on project creation ```Could not open settings generic class cache for settings file 'C:\Users\antod\Documents\dev 1.19.4\pluginMarcher\settings.gradle' (C:\Users\antod.gradle\caches\8.0\scripts\4l8qbco0tm5b9u05f0x3bh7qw).
BUG! exception in phase 'semantic analysis' in source unit 'BuildScript' Unsupported class file major version 64
Don't use Java 20
yep
nice i fixed it
agreed
I usually use 11
but in minecraft, you should use the version depending on the on version you are targeting
hey, how can i convert a string with color codes (eg: &4amongus) with something usable in the plugin to send to a player and have the color code work (im pretty sure this needs ChatColors but idk how to convert it with the whole string)
thanks

dumpyAmongUs
I went to multiple dungeons and the end and still no seed generated by seed cracker x. Has anyone been able to make it work for 1.19.4?
i think it is based on radius and length from 0 , 0
regardless of what it is I don't think its a big enough problem to dev a solution for it. The only thing I am getting from it is spawners past my anti xray
I mean that's just reality
i already stated how I was planning to
control world confilcs
?paste
hey guys, I want to have a map flower pot -> flower. I've actually achieved that, but the way I've made it looks a little bit messy. Does anybody have any idea on how I could make it in a better way? https://paste.md-5.net/ururiruref.java
in bungee, when doing commandSender.hasPermission(x), if the commandsender is actually the console, will it always return true or always return false (or null)
don't touch it
oh, okay XD
yes
flattening
?
does anyone know the character limit for action bar messages, I am assuming it is 256 but I hope its higher
it's automaticly created in the jar file when using the package command
I wouldn't like everyone to look at the username of my computer
i have a diffrent name set as my username that i wouldn't like to share
just censor it
how?
i use lightshot to take picature of an area on my screen
huh, what are you talking about
Hello, I want to create custom blocks with custom textures, but how can I use the differents states of the mushroom block in my plugin ?
me ?
Yes
the latest, 1.19.4
this will not work in my texture pack
Make it work.
why not
@rotund ravine
I would use noteblocks instead
how can you not customize the textures
But yeah same idea
I want to add more than 100 ores
Heโs just using something @tender shard said
hmm
Noteblocks give you
if you use custommodeldata you should be able to add a brickton of new blocks
700 ish
Custom model data doesn't work on blocks
๐ค
Oh
I wish life were that easy
sadge
so, with noteblocks, how can I change the properties in my plugin ?
@young knoll ?
Change the data of the NoteBlock
declaration: package: org.bukkit.block.data.type, interface: NoteBlock
thankkks
perfect ๐
can I customize the tablist without nms?
you can set a header and footer
How can I cast Block to NoteBlock please ?
Block#getData
okay thanks
CompletableFuture<List<Kit>> future = CompletableFuture.supplyAsync(() -> {
try (PreparedStatement preparedStatement = connection.prepareStatement("SELECT name, displayItem, inventoryPosition, items FROM kits;")) {
ResultSet rs = preparedStatement.getResultSet();
List<Kit> kitList = new ArrayList<>();
while (rs.next()) {
Kit kit = new Kit(rs.getString(1), Material.valueOf(rs.getString(2)), rs.getInt(3), rs.getString(4));
kitList.add(kit);
}
return kitList;
} catch (SQLException exception) {
exception.printStackTrace();
return null;
}
});
future.exceptionally(exception -> {
exception.printStackTrace();
return null;
});
return future;
}``` ResultSet is null
i wanted to send the whole class, but i couldnt put it in md5 paste
How long is your class?
97
that should fit into md5 paste
i tried to only put the method and it didnt work
what didn't work?
cannot cast
Something went wrong!
weird
getData return byte who cannot be converted to NoteBlock
Sorry
so I used getBlockData and it's the same
getBlockData
not working x)
?notworking
"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.
cannot be converted
.
I think it's this #help-development message
I assume you are importing the correct NoteBlock?
Well, is the block a noteblock
yes Material.NOTE_BLOCK
I think
org.bukkit.block.data.type
?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.
block.setType(Material.NOTE_BLOCK);
NoteBlock nblock = (NoteBlock) block.getState();
nblock.setInstrument(instrument);
nblock.setNote(Note.flat(octave, tone));```
.
Again you haven't shown us the code
I assure you as long as the block is a noteblock then its blockdata will be able to be cast to NoteBlock
Cannot be convertedjava block.setType(Material.NOTE_BLOCK); NoteBlock nblock = (NoteBlock) block.getBlockData(); nblock.setInstrument(instrument); nblock.setNote(Note.flat(octave, tone));
If I set his type to Material.NOTE_BLOCK, it's a noteblock ?
private static final String[] SERVER_ORDER = {"lobby1","lobby2","lobby3","lobby4","lobby5"};
for (String serverId : SERVER_ORDER) {
ServerInfo serverInfo = ProxyServer.getInstance().getServerInfo(serverId);
if (serverInfo.getPlayers().size() < 20) {
p.connect(serverInfo);
break;
}
}```
Lobby full checker, made by CHOCO (Edited by me)
Should be
Here is my code :```java
private void GenOre(ChunkPopulateEvent event, double rarity, int miny, int maxy, Instrument instrument, int octave, Note.Tone tone){
Chunk chunk = event.getChunk();
World world = chunk.getWorld();
getLogger().info("Nouveau chunk " + chunk.getX());
rarity = rarity / 100;
for (int x = 0; x < 16; x++){
for (int y = miny; y < maxy; y++) {
for (int z = 0; z < 16; z++) {
Block block = chunk.getBlock(x, y, z);
if (OVERWORLD_MATERIALS.contains(block.getType())) {
Random rand = new Random();
double randomNum = rand.nextDouble();
if (randomNum <= rarity) {
getLogger().info("x " + block.getX() + " y " + block.getY() + " z " + block.getZ());
block.setType(Material.NOTE_BLOCK);
NoteBlock nblock = (NoteBlock) block.getState();
nblock.setInstrument(instrument);
nblock.setNote(Note.flat(octave, tone));
}
}
}
}
}
}```
declaration: package: org.bukkit.block.data.type, interface: NoteBlock
part of blockdata
block.getBlockData()
cannot be converted...
show error
you can find error in log tho
exact x)
also if the error is on the server and not in IDE, then something must be wrong with the block variable
you can try to run your blockdata manipulations in a task 1 tick later and check the result
humm
now it's working
really strange
thanks
might be cuz of the chunkpopulate, so USE TASKS for your manipulations @cinder abyss
Also
Use a blockpopulator instead
Note: Do not use this to generated blocks in a newly generated chunk. Use a BlockPopulator instead.
I just realized that has a typo
0/10 worst API
true
hi iam having very very weird problem anyone would like to join vc to see it? iam gonna screenshare it ..
i dont really know how to explain it ..
I am having an issue with my plguin but I assume the answer will be related to something of java itself. I have this gameSession object that keeps track of a Game instance but my issue that it doesnt get removed when it should
?
like the events are still firing from the game object
idk how to explain it in a few words
maybe you are making new instance of the GameSession?
yes
means you still have reference to the game object
essentially I just do game = new Game()
somewhere
how do I know where it is
in a map or list
display.setBlock(data);
display.setRotation(240, 240);
display.setDisplayWidth(10);
display.setDisplayHeight(10);
display.setTicksLived(Integer.MAX_VALUE);```
pitch isnt working and displayheight and width arnt doing anything
I have created a bukkit timer, which messages the player after some time passes, which is the main way I can see that the object still exists
does that mean that the timer is keeping the object alive too?
Width and height only impact the culling box of the display entity
pitch also does not work for them, you need to set the transformation
feel like im doing this wrong
public lobby(BetterBungee ignore) {
super("lobby","permissions.lobby");
}
ProxyServer.getInstance().getPluginManager().registerCommand(this,new lobby(this));
thats not the issue
ik
anyways
dont use lowercase for class names
you need to implement CommandExecutor, not Command
im using bungeecoord
and there are no probloms in intellij
but teh command just isnt getting recognised or what?
name: BetterBungee
version: '${project.version}'
main: betterbungee.betterbungee.BetterBungee
commands:
lobby:
permission: permissions.lobby
aliases: [ "l", "zoo" ]
this is my bungee.yml
public lobby(BetterBungee ignore) {
super("lobby","permissions.lobby");
}
this has to be the reason
well you still havent told me your problem
the command aint registering
if I use game = new Game(), whatever was in game before will get deleted right?
assuming game is a variable of the class I am using this code
It will no longer be referenced by that object
If nothing else is referencing it then GC will handle it
what about DI
like if I have something in the game object that references game
does it get deleted then?
and furthermore, how do I know if the instance has been deleted
and not spooking around in the backrooms of my server
Why would it matter if it is still chilling somewhere
How big is your dang game object
You won't leak memory if you don't keep hard references to an object around
bruh i hate math rn
how do I make...
1 cylinder with 2 angels rotation
- thickness, fillout options

okay then I should be good
should i move the kit commands and listeners in the kit folder and the same with everything else?
I just have a reference to it in one class where t gets replaced by a new one for every game
the rest is just DI stuff
ok
can you edit/do anyhting with the tab list without nms?
can you add fake entries?
sad
cant regret if you neve did it
but I feel like nms is cheating
hmm, can you hide entries you think?
Only if you hide the player too
hmm
nvm then
oh well I guess I have to look for another solution
ig
those people dont know how to write good separations
?paste
my generatePancake method isn't filling out the shape
and i can't do math fr
what i'm doing wrong?
I cant seem to find a WORKING bungeecoord packet manipulation dep, could somenoe help me find one? (PROZOLIZER BAD SUPPORT)
should I use the uuid or name constructor for an attributemodifier
Wdym?
Use polar coordinates with X and y
Imagine a circle that has a rope around it, and this rope is a collection of dots which each has X and Y
And each dot could be identified with rcos(a) and rsin(a)
Since sin(a) = y/r and cos(a) = x/r
First get blocks in the square shape that has each sidelength tangent to the circle
Then loop in all of the square blocks, check in every circle region and compare the X and Y with trigonometry
i apricate your input greatly
just one issue is my math isn't advanced enough
it does help then you break down the step by step
Ok then sorry I'm not at pc, but I could show you how it's done (in my way), or atleast check other codes
i will take all this information and note it for sure!
maybe i should start out making a line with 2 angels
from center
using radius
What shape are you trying to create ?
so just, create pancake/circle and then rotate along x and z axis ?
interesting vector math?
not really
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/util/Vector.html#rotateAroundX(double)
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/util/Vector.html#rotateAroundZ(double)
declaration: package: org.bukkit.util, class: Vector
what goal are you running
I really like the idea but
my goal is to be better at math
thanks btw for giving me the right naming for axis
gonna speed run this
?paste
is there anything on how block display transofmrations work?
Scale and translation are fairly straightforward
Right and left rotation are quaternion magic
hi im making a trading plugin but i only have 1 account can i borrow somone's acocount
to test the plugin
yeah but i dont have any minecraft crack
.04 23:16:58 [Server] Server thread/[INFO] Soviet_Pj issued server command: /car spawn
25.04 23:16:59 [Server] Server thread/[ERROR] Could not pass event InventoryClickEvent to Vehicles v1.3
25.04 23:16:59 [Server] [INFO] org.bukkit.event.EventException: null
25.04 23:16:59 [Server] [INFO] at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:310) ~[spigot-api-1.19.2-R0.1-SNAPSHOT.jar:?]
25.04 23:16:59 [Server] [INFO] at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[spigot-api-1.19.2-R0.1-SNAPSHOT.jar:?]
25.04 23:16:59 [Server] [INFO] at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:589) ~[spigot-api-1.19.2-R0.1-SNAPSHOT.jar:?]
25.04 23:16:59 [Server] [INFO] at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:576) ~[spigot-api-1.19.2-R0.1-SNAPSHOT.jar:?]
25.04 23:16:59 [Server] [INFO] at net.minecraft.server.network.PlayerConnection.a(PlayerConnection.java:2876) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3610-Spigot-6198b5a-19df23a]
25.04 23:16:59 [Server] [INFO] at net.minecraft.network.protocol.game.PacketPlayInWindowClick.a(SourceFile:58) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3610-Spigot-6198b5a-19df23a]
That doesn't really tell us much, only that something is returning null
?paste the full error
is tlauncher good ?
idk how
I know MultiMC is
ive tried but it crashed
aswell as this for a different plugin
updated from 1.16.5 to 1.19.2
I believe it was working in 1.18
25.04 23:20:34 [Server] [INFO] Caused by: com.comphenix.protocol.reflect.FieldAccessException: Field index 0 is out of bounds for length 0
25.04 23:20:34 [Server] [INFO] at com.comphenix.protocol.reflect.FieldAccessException.fromFormat(FieldAccessException.java:49) ~[?:?]
25.04 23:20:34 [Server] [INFO] at com.comphenix.protocol.reflect.StructureModifier.write(StructureModifier.java:289) ~[?:?]
25.04 23:20:34 [Server] [INFO] at com.celerry.vehicles.util.data.vehicles.Car.<init>(Car.java:104) ~[?:?]
That's where the issue is. What's the code at 104 in the Car.java file
As for that other one, It's just a simple
25.04 23:21:24 [Server] [INFO] java.lang.NoClassDefFoundError: net/minecraft/server/v1_16_R3/PacketPlayOutPosition$EnumPlayerTeleportFlags
meaning you need to change how it's handing the packets
I am not the developer, my developer is no longer in touch with me
Nope, do i need to pay another developer to fix?
Either learn how to fix it yourself, or hire someone to fix it for you.
?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/
what's the difference
General java question:
Is there a way to initialize a map? Like I know you can just do this for an object:
var myobj = new Object() { int myValue = 0; };
Need this for crafting table logic
Making custom crafting stuff
You want a map with values in it already?
Yeah I searched it up and all I found was double brace logic
Should be able to do Map.of
Ah thank you
Would it be possible to convert the crafting matrix provided with event.getInventory().getMatrix() in the prepareCrafting event to a map where the key is the index the item was at and the value is the ItemStack?
no
you can most likely get the items from it somehow, it might be that just check javadocs to see what it says
most likely its pssible
CraftingInventory#getMatrix iirc
for more context: https://stackoverflow.com/questions/6802483/how-to-directly-initialize-a-hashmap-in-a-literal-way
Is there a better way than using every tick event to armor stand (or display entity) follow player smoothly?
I think teleporting armor stand every tick for all players can overload the server.
I'm trying to make cosmetics system
You could probably use the armorstands as passengers. Although you'd have to work with passenger logic at that point. You'd probably need a few of them to get the positioning just right.
String wandName = staffConfig.getString("items.wand.name");
My bro
Wtf do you want me to do :(
THERES THE PATH
What is meaning of using armor stand as passenger?
Does it mean that make display entity to ride armor stand and teleport armor stand?
if i need to track if a player threw a splash pot is it PotionSplashEvent or EntityPlaceEvent or ThrownPotion
I'm trying to display some info above the hotbar, When I use DisplaySlot.SIDEBAR it works, However when I use DisplaySlot.BELOW_NAME I don't see any info. Help would be appreciated.
Thrownpotion is the entity
You would probably need to listen to interact event if you want to do something at the time they throw it
Potionsplash event happens the moment it hits something
No all I needed to do was update a hash map if they threw a potion
Ah ok. Well there is still a difference in terms of time period you need
Whether you need before its thrown or after lol
Are there some kind of comments for the methods in Mojang mappings?
Their names
I'm looking for design advice. All of my code is functional, just curious as to what the standard practices are.
I have a Group object (represents the data associated with a group of players) and a GroupManager class. I think I heard somewhere that I should avoid adding methods to an object like the Group objects. If that's the case, why is that?
Which methods are okay to add to the Group class and which aren't?
whats that code upload site
o yea thx
I'd like it to be as efficient as possible and follow standard practices.
It's important for others to be able to read your code as well.
For me messy isn't acceptable
only if u plan for others to read it
I do.
thats semi easy to read
i think its good
why
getMember(Player player)
getMember(UUID uuid)
I can't recall, but I believe I heard from somewhere before that it's better to have methods which manipulate your object in the manager class.
Ah
tbh i feel bad if this project goes to anyone else
its a mess
(it works tho)
Yes and that's not a problem for you right now. However in a year or longer down the line if you're still working on the project or revisit it, messy code will take a lot of effort to figure out. That's why I'd like to follow standard programing conventions.
o 100%
lol
like i have player1 player2 playerUniqueId opponentUniqueId opponent Player
lol
player1 could be opponent or Player or playerUniqueId lol
sorta just works
TBH once its out of rush time ill probs go back and fix everything
bump
Ones that are universal, what you should do instead is either extend or implement as necessary. Your group manager objects typically are just there to hold stuff, maybe do some cleanup or loading. Anything outside of that it should have a method that refers to another class that does something. Ie abstraction. But it also depends which end we talking. Implementation or outward facing api
anyone wanna explain why bukkit dependency stays at 1.13.1 ๐ญ
presumably you are depending on a third party library/api that exposes bukkit
yea
im so lost
Are you using maven or gradle ?
dont u just have to put ur own dependency above vault in ur pom?
in order to prioritize your own
I mean, also works but you can just actively exclude it
so you don't depend on order
fair
yea that is what you are supposed to use ^
ah
alr so
id just add version { right under uhh compile?
not trynna ask for spoon feeding mb ๐ญ
you'd do ```kt
compileOnly("the-vault-dep-here") {
exclude("org.bukkit")
}

> Could not find method exclude() for arguments [org.bukkit] on DefaultExternalModuleDependency{group='com.github.MilkBowl', name='VaultAPI', version='1.7', configuration='default'} of type org.gradle.api.internal.artifacts.dependencies.DefaultExternalModuleDependency. straight facts
google time!!!!!!!!!!!
exclude module: "support-v4"
}
``` would it looks something more like this?
do you have a build.gradle or a build.gradle.kts
build.gradle
oh
so groovy then?
yea group and module
I prefer groovy gradle
implementation('commons-beanutils:commons-beanutils:1.9.4') {
exclude group: 'commons-collections', module: 'commons-collections'
}
per example
why xD
why group and module?
Kotlin ๐
ยฏ_(ใ)_/ยฏ
sure no kotlin but groovy ???
i heard it was a little easier
haha
I find gradle kotlin harder than groovy
ยฏ_(ใ)_/ยฏ
different perspectives ยฏ_(ใ)_/ยฏ
mm
ill do this tmmrw i cant be bothered at 2am
So what you're saying is that I should just use my GroupManager class for loading/saving Group objects and contain them? The Group objects contained within the Manager should handle all of it's own functionality; not the Manager?
is it still ProjectileLaunchEvent
to track if a player throws a snow ball
I don't use groovy, gravy, or kotlin
I wanted to calculate values for each factions, from block price, etc. But I need to find a way to calculate it one faction at a time, how can I do that? Let's say that I have an factions ArrayList, how can I calculate it one faction at a time, thank you.
Use a for loop?
For loop?
Wait, I might overcomplicate this.
Let's change the question, so I imagine there are gonna be a lot of chunks and blocks from faction claims and I assume the task of calculating the factions values is gonna be heavy, how can I make it efficient? Like it will not affect TPS at all.
Faction should have a region that can be referenced. Loop through the blocks in the region. You should be able to thread that operation.
If it's not on the main thread it won't interrupt it (though it might still lag your server if your hardware is lacking).
?workdistro
It's not safe to interact with the world off the main thread
This isn't interaction though; nothing in the world will be changed by the operation.
You will be loading chunks
Which is not safe to do
Spigot should prevent you from doing so as well
You get the data in the main thread, process it off-thread.
Loading them? Hmm... suppose so
Yeah that's what ChunkSnapshots are for
You get them sync and process them off-thread
Yeah make a bunch of snapshots and multithread it
Could calculate it every time a block is placed or broken instead
You got it. Sorry at work so can only respond every so often lol
Ehh not accurate
It's a micro-calculation that way
I don't mind. Thank you very much for your feedback I am implementing it as we speak!
Wdym not accurate?
You'll need to recalc across restarts, when creating a new faction
And account for everything
No need to recalc at restart; only problem is obtaining the value AFTER the factions are already built
And also loop through every faction on every single block event
So If I want to use this way, should I workload every blocks or every factions?
I'd workload chunk snapshots
^^
Why would you have to update every faction if one block is broken? Only update the faction containing the block
Best way is to calculate ahead of time and then every so often verify numbers
To figure out what faction the block belongs to?
Basic math should get you that.
Math is a non-issue
You could do a bounding box without need to load a chunk
I'm using factionsuuid, and I'm sure they have a method to get list of claimed chunks on factions.
Always O(n) unless you do some funky hashing
Right, thank you
If you know the faction borders already no chunks need to be messed with
Any CPU can do billions of operations per frame, it's loops that are slow because you're referencing memory slots
Just use a shaped bounding box
That's not what I'm talking about
You have one bounding box per faction
You have hundreds of factions
And you'd need to loop through each faction, get its bounding box and do a check
Every time any block gets manipulated
Not necessarily true, if you know how to leverage math you could easily estimate the most likely factions
Beat me to it
So instead of checking 100 it would just be a handful
Unless you're breaking random blocks outside
Which is what would be crucial in terms of efficiency
Another way is to just track the player. If it's near or in a faction, check only the one faction.
Cheap.
Like what if some idiot empties out an entire desert
to get glass or whatever
depending on the faction / player your math can start to get heavy
Not hard to add checks to skip
What if you could make some sort of hash
Well its estimation and the best way would be to take the vector and see which vectors are closest
This is why i said it does depend on how the data is organized
Good programming choices fix 90% of perceived issues
I say they should get something working first and then optimize the problem areas
sounds accurate
Without something made cant really determine the ideal data structure lol
Well its more difficult anyways
Always more fun to make it up as you go anyways. Planning is boring and never works out exactly as planned anyways.
Maybe it's just me, idk
I used to plan more but I've been using Spigot for 11 years now so I just wing it and then clean it up
Nothing wrong with planning. Just its easy to over plan and easy to start optimizing things you think might be a problem when really they are not and its some other thing that really is
Pretty much my reasoning exactly, actually
But it's almost 4:00 AM so I'm no good for communicating rn
Like we can sit here all night arguing what the best way is lol. But if they have nothing made we wont really know. Every system is different you know.
Indeed
Best we can do is give them ideas. 
I recommend making something that works, and then work off that to improve if you havent followed the conversation. You have a few different ways to do what you are wanting but at this point it isnt easy to tell which of the ways is going to be best for you.
Its one of those, take one of the ideas run with it and then see if its good enough if not work on changing it or improving it lol
Hello, if I a plugin message of PlayerCount request for a disconnected server. What will it response to me back?
Right, thank you guys for the help.
Can you please rephrase your question. It isnt very coherent in what you are trying to ask
First I send a plugin message in BungeeCord channel to request PlayerCount from a server - but the server is disconnected. What will the proxy response to me?
It will be empty or null or nothing comes back
But
How to read that? Because it does not returns 0 so make the reading process (i.e. in.readUTF()) throw an exception
Server is disconnected and the only thing bungee retains is just its name as that is in the config. When you ask bungee for info on a server bungee then asks the server if its online. I dont have documentation up to precisely tell you.
But you either get no response or an empty response because bungee isnt able to tell you other then server is disconnected. Which is why you should first check the server is online first before just assuming the info is available
OK thank you
in.readUTF() <-- subchannel of 'PlayerCount'
in.readUTF() <-- I expected 'server' but exception is thrown here
in.readInt() <-- unreached
Yes, but it doesn't
Meaning that bungee doesn't know that server?
Hi , why else is not worked ?
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
to both of you
because you call esm[0] BEFORE checking the length
Why is this not working? I still can modify the armorstand. Yes the event is registered
@EventHandler
public void onArmorStandManipulate(PlayerArmorStandManipulateEvent event) {
event.setCancelled(true);
}
because it's not registered
Hello, is there an event for when a chunk finished his loading ?
ChunkLoadEvent and a tick after
ho, that's why my plugin make my server crash x)
how can I wait 1 tick ?
thanks
Trololo. It is.. all other events in this class work fine
if the code you posted is exactly as show the only reason it will not work is not being registered
?jd-s
What are you using it for?
you obviously didn't read the documentation
Called when a player interacts with an armor stand and will either swap, retrieve or place an item.
Cancel modifying armor pieces of the armorstand
I see
either it isn't registered or something is uncancelling the event then
or you have an error somewhere that is preventing the event from being passed to your plugin
I suspect you were correct
No. Just Intellj doing weird things.. Needed to Invalidate Caches and it worked. Thanks anyway
you'r
why does my plugin not work when i kill somebody
there were no errors and 5 warnings
?notworking
"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.
check console for errors
death event looks fine
ok
Starting Minecraft server on 0.0.0.0:10008
[11:37:10 INFO]: Using epoll channel type
[11:37:10 INFO]: Paper: Using libdeflate (Linux x86_64) compression from Velocity.
[11:37:10 INFO]: Paper: Using OpenSSL 3.0.x (Linux x86_64) cipher from Velocity.
[11:37:11 INFO]: [DrainPlugin] Loading DrainPlugin v1.0-SNAPSHOT
[11:37:11 INFO]: Server permissions file permissions.yml is empty, ignoring it
[11:37:11 INFO]: Preparing level "world"
[11:37:13 INFO]: Preparing start region for dimension minecraft:overworld
[11:37:13 INFO]: Time elapsed: 298 ms
[11:37:13 INFO]: Preparing start region for dimension minecraft:the_nether
[11:37:13 INFO]: Time elapsed: 89 ms
[11:37:13 INFO]: Preparing start region for dimension minecraft:the_end
[11:37:13 INFO]: Time elapsed: 96 ms
[11:37:13 INFO]: [DrainPlugin] Enabling DrainPlugin v1.0-SNAPSHOT
[11:37:13 INFO]: Running delayed init tasks
[11:37:13 INFO]: Done (4.228s)! For help, type "help"
[11:37:13 INFO]: Timings Reset
so what's the issue
when i kill a player
it dosent drop the essence i made
drop? you are adding to the inventory
?notworking
"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.
so the event is on playerdeathevent so when a player gets killed the essence gets random from 1-4 and needs to be added to the inventory and the essence dosent get added
you are looking in the killers inventory? not the one who was killed?
print out a message when the event gets called
also, test it on Spigot
yes no
i looked out on it
on killers inventors
Does Bukkit.getofflineplayer(UUID).getname() return an updated username or will it return the name that the UUID had on it's last session on your server?
last session
in world/playerdata
but alternatively you can use minecraftools, ashcon and other api(s) to get their new username by uuid
Okay ty :)
Hey trying to display so health and mana info, Using the scoreboard for this. When I set the display to SIDEBAR I see my info, However when I try to use BELOW_NAME I don't see anything. Is there something else I need to be doing?
not show to others?
Can Spigot require updating even though the version number doesn't change? Getting a version isn't update on 1.19.4 but it's the same release that is available.
Spigot? no
hmmm k
java -jar spigot-1.19.4.jar nogui
Unbundling libraries to C:\Users\user\Inworld-Minecraft\server\bundler
Starting server
*** Error, this build is outdated ***
*** Please download a new build as per instructions from https://www.spigotmc.org/go/outdated-spigot ***
*** Server will start in 20 seconds ***
That's the latest version though?
kk
This server is running CraftBukkit version 3638-Spigot-d90018e-7dcb59b (MC: 1.19.3) (Implementing API version 1.19.3-R0.1-SNAPSHOT
just an example from an old log
if you just want to stick with what you have add teh IknowwhatI'mdoing switch
Just doesn't show up on the HUD at all unfortunately, Trying to keep all this info specific per player
all players who are to see this need to see the same scoreboard
Cheers, I'll update it.
player.InworldPlayerData.CharacterSessionIDs[npcName]:Destory()
740 Destory is not a valid member of ObjectValue
I'm getting this trying to Destroy a ObjectValue.
how do i make a circle where you can chance the length of ( x, y , z)
i'm kinda bad math
I can change the name above a player's head only using scoreboard?
Do I need to iterate through the children and not call destroy directly on a table like that?
Omg I'm an idiot thank you
Ya it's Lua / RB
Huh interesting, I figured I could add everyone to their own tea or something. How does skyblock handle showing health and mana values above the hotbar then?
Different plugin?
CharacterSessionIds is a ObjectValue too
Thanks again for your help that would have kept me up
?paste
why?
what?
public java.util.Map<java.util.UUID,net.brcdev.gangs.gang.GangMemberData>
.keySet() returns a Set
then store it as a Set
I'm not seeing a reson to not use the Set it returns
ty zacken
not good to create objects you don't need to
api calls
an api call requires you provide a List?
A API returns a Set when I don't need a set
you can do everything with a Set you can do with a List
back to the beginning, why do you need a List?
It's not that complicated....
List<UUID> members = gang == null ? getMembers()) : new ArrayList<>(gang.getMembers().keySet());
You have still to show WHY you need a List
Because I'm making a iterator
Over all the UUIDS
And it's just the UUIDS I need
Nothing else
.keySet().forEach
Note how there's a condition
litterally that will iterate teh Set ONLY if there are entries
Yes I understand I can. I know what a set is and how it works. Was just getting errors cause my iterator was trying to cast but it was a set not a list
Thanks for the help
ok
I love strongly typed programming languages
I need help regarding plugin development
Is there ever a time where weakly typed ones are โโbetterโโ?
?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!
Can someone tell me a scoreboard plugin which shows up in all my servers
They are linked up to a bungeecord one
Does anyone know why the name changes in the tab, above the head, but doesn't change in the chat?
ProtocolLibrary.getProtocolManager().addPacketListener(new PacketAdapter(this, PacketType.Play.Server.PLAYER_INFO) {
@Override
public void onPacketSending(PacketEvent event) {
Set<EnumWrappers.PlayerInfoAction> actions = event.getPacket().getPlayerInfoActions().read(0);
if (!actions.contains(EnumWrappers.PlayerInfoAction.ADD_PLAYER)) return;
List<PlayerInfoData> playerInfoDataList = event.getPacket().getPlayerInfoDataLists().read(1);
List<PlayerInfoData> newPlayerInfoDataList = new ArrayList<>();
for (PlayerInfoData playerInfoData : playerInfoDataList) {
Player player = event.getPlayer().getServer().getPlayer(playerInfoData.getProfile().getUUID());
if (playerInfoData.getProfile() == null || player == null) {
newPlayerInfoDataList.add(playerInfoData);
continue;
}
String newName = NAMES.get(player.getName());
WrappedGameProfile newProfile = playerInfoData.getProfile().withName(newName);
newProfile.getProperties().putAll(playerInfoData.getProfile().getProperties());
newPlayerInfoDataList.add(new PlayerInfoData(newProfile,
playerInfoData.getLatency(),
playerInfoData.getGameMode(),
WrappedChatComponent.fromLegacyText(newName)));
}
event.getPacket().getPlayerInfoDataLists().write(1, newPlayerInfoDataList);
}
});
yes I use it for some prototyping but its pretty rare and not for minecraft development atleast
because chat is different, each message on server comes with a chatpacket, and whenever you send a message to server, it gets your msg, then broadcast it using the chat packet with the following text: "<kirowara> asd" to all players
yea, thats a thing
oh, I see. Thank you!
But it won't make any difference if I will modify the "chat packet" or Player#setDisplayName, will it? Or is there any difference, except that Player#setDisplayName is easier ๐ ?
setDisplayName should change the name in chat
since chat uses the displayname i think
It does
hi what the equivalent of net.minecraft.client.gui.GuiScreen in 1.19.4 ?
Doesn't cover client
I believe it should just be Screen
ha you some documentation about it ?
When modding you need to be able to read code and figure things out
You can look at the existing screens or at other mods
i'm not modding, i just to add some screen with a plugin
i already did this in previous version of mc
You can't add screens with a plugin
They don't exist on the server
Which is why they're in the client package
Yeah screens are client only not sure how you plan to achieve this. Best you can do is heavy resource packs with already existing guis
Like chest guis
You can't listen for button clicks either keep that in mind
ok, i'l try to add the game version jar and i'll see if can do something
Outside of the vanilla interactions ofc
You're still going to need a mod
Adding client classes to the server isn't going to help
hi
why i recive this error?
i'm tring to fork a plugin (libsdisguise)
cannot access com.mojang.brigadier.Message
this is the compitation error
theres no way to get the spigot plugin id before uploading it right? I need to implement an update checker but i cant do it without the id
so will i have to release another version for the update checker?
i thinks you have to do another version
Yeah do another release
ef
How do I teleport the player to a new location, in a different dimension?
//List<World> worlds = Bukkit.getWorlds(); //maybe something like this?
Location location = new Location(world, 0,0,0);
player.teleport(location);
As an example: how do I get the_nether world?
world would be the other world/dimension
the nether
world_nether*
There can be more than one nether world or none at all
okay. How do I get the world itself to make a Location within it
it can be the overworld, end, nether, or custom; anything
I just need to know how to get any given dimension.
Bukkit.getworld("world_nether");
Ah okay; thank you! I'll test it out
Don't rely on that. It can change name
otherwise you could take the world from the player
obviously then he has to change the name there with the name of his nether world
player.getlocation.getworld
its better like this
Yes, vault packaged teh api when it shouldn't
I have to use the flag --compile craftbukkit?
no
You don't need that exclude
i do tho dont i?
it puts my bukkit version from 1.17.1 to 1.13.1 which doesnt give me half the stuff i need
you don't so long as your dependency order is correct
If you follow their instructions you don't
Spigot first
mm alr ill try to take a look
just started java so may take a minute
anything i should look for?
Depency ConfigUpdater
would i do something more like this?
priority
sourceSets.main.compileClasspath = configurations.priority + sourceSets.main.compileClasspath
}
dependencies {
priority 'org.blah:JarB:2.3'
compile 'org.blah:JarA:2.4'
...
}```
it is
mavenCentral()
maven {
name = "spigotmc-repo"
url = "https://hub.spigotmc.org/nexus/content/repositories/snapshots/"
}
maven {
name = "sonatype"
url = "https://oss.sonatype.org/content/groups/public/"
}
maven {
name = "vault-api"
url = 'https://jitpack.io'
}
}
dependencies {
compileOnly "org.spigotmc:spigot-api:1.17.1-R0.1-SNAPSHOT"
compileOnly("com.github.MilkBowl:VaultAPI:1.7")
}```
Looks fine
Did you reload gradle
is there a enderpearl impact event or a alternative for it
ProjectileHitEvent
thx
Try
compileOnly("com.github.MilkBowl:VaultAPI:1.7") {
exclude group: "org.bukkit"
}
It gives errors (I know I have to paste it to paste.md-5.net, but there are too many lines and it can't upload it)
does p.getlocation have the yaw and pitch too?
yes
Rerun BuildTools in a clean folder
k thx
it did the same error
What command did you use?
java -Xmx4G -jar BuildTools.jar --rev 1.19.3 --remapped
and was the folder completely empty (excluding BuildTools jar)
Someone?
yes
with 1.19.4 I had no problems
it is
thats the entire line
thats line 65
looks like it worked ill test it out rn
literally
just
downloaded
and reinstalled
Is it possible to make npcs without nms
yes, use Citizens
npc.create

