#help-development
1 messages · Page 435 of 1
Packs is probably referring to the experimental 1.20 datapack
Okay so how do I get other versions if 1.19 won't work
Wiki page for buildtools tells you how
I cant find it in the functions list for an entity
I figured it out
It’s not in all entities
Iirc it’s on LivingEntity but it might be in Mob
it's on LivingEntity yes
Why i have this error
bukkit.configuration.ConfigurationSection cannot be converted to java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Integer>>
https://paste.md-5.net/inasoyasas.java
what line
33
Because a configuration section is not a map
getConfigurationSection returns a ConfigurationSection
What should i do ?
Store it as a ConfigurationSection
so its only the config.yml ?
What
wdym by store it as configuration section ?
A variable with type ConfigurationSection
Mhm
This isnt a map
Add dashes just before factions or the coords depending which one you want to be mapped
Otherwise those are both lists or factions ones can be considered sections
In this updated code, we first create a new HashMap object for the Map we want to populate. We then extract the ConfigurationSection object from the main configuration object and loop through its keys. For each key, we extract the ConfigurationSection object for that key and loop through its keys to extract the values and add them to a new HashMap. Finally, we add the sub-Map to the main Map with its key !
example :
public void exampleMethod(ConfigurationSection config) {
// Assume that config contains a section named "mySection"
Map<String, Map<String, Integer>> myMap = new HashMap<>();
ConfigurationSection mySection = config.getConfigurationSection("mySection");
if (mySection != null) {
for (String key : mySection.getKeys(false)) {
ConfigurationSection subSection = mySection.getConfigurationSection(key);
if (subSection != null) {
Map<String, Integer> subMap = new HashMap<>();
for (String subKey : subSection.getKeys(false)) {
int value = subSection.getInt(subKey);
subMap.put(subKey, value);
}
myMap.put(key, subMap);
}
}
}
}```
Here is an updated version of the code that should avoid the error
Okay so I did the things but spigot is having issues with Java for some reason it keeps saying there was an exception
i casted an entity to a living entity and it worked, tysm!
does setLazer not exist or am I just dumb
is it Laser instead of Lazer
getPlayer(s) and compare address
i guess you could get all offline players, aka everyone who ever played on the server
nvm OfflinePlayer does not have an address field
Not trying to be rude, but pretty sure it's not issue with spigot and java compability, it would be best if you send error
btw for ipv6 you shouldnt just compare the single IP but rather the whole /64 subnet
basically every provider assigns /64 subnets for ipv6 sooo every user has about 18 quintillion IPv6 addresses
it's not harder nor easier than using a database in any other application
I'd check out baeldung's tutorial about hikariCP https://www.baeldung.com/hikaricp
just Bungee I'd use a simple in memory Map to yaml
wdym?
saving IP's would subject you to GDPR compliance
it doesn't matter though whether you save it to a file or to a mysql db
yep ^
well it's no difference. if you save personal related data of EU citizens, you gotta do it accordingly to GDPR. but whether you save it to a file or into a mysql db, or whether you write them down by hand, is no difference
yes
Not necessarily true
Since ip addresses are not always unique to a given user and it doesnt personally identify them then it isnt subject to gdpr
idk but i see your pfp in spigot website again 
It doesn;t have to be personally identifiable. It just has ot be attached to a person, so IP is qualifying
If it was combined with additional data to identify them then yes
BlackBeltBarister on YT covered it a few times.
Definitely should read gdpr then. Otherwise webservers would be required to never log ip addresses
Or any server for that matter
in recital 30, the GDPR explicitly mentions ip addresses
GDPR doesn;t mean you can;t log them. it just means you have to comply with the legislation if you do.
IE data requests
IP address, it can be difficult to distinguish between different users
In cases like this, it may be necessary to use additional methods to authenticate and verify the identity of users, such as requiring users to log in with unique usernames and passwords, or using two-factor authentication (2FA) methods such as SMS codes or app-based authenticators !
I dont have to remove them if someone requests it
no
Nor do i have to provide what was logged either
but you have to provide any data you hold if they request it
Read article 6. Which overrides such requests if they meet the guidelines
lol you still on this? I'm only repeating what a Barrister told me. I'd rather trust the Barrister.
So lets say you record ip addresses for security related reasons. Which is the most common reason for logging ips i do not have to give the data held on that and only have to inform that any data in regards to the ip is for security related reasons.
I trust what i read for myself, not what people say.
Should what i posted on #general be here?
I'm not sure where it should've been posted
When it comes to Law I'd rather trust the person qualified to decipher it.
Dont care if they are a lawyer. Lawyer doesnt mean ability to interpret any more then common person at least in the US because the only entities legally allowed to interpret officially are judges. Everyone else has to take what it means at face value
you can't just read a law and then expect that you know how it works lol
Thats different here, a Barrister is different from a Lawyer.
Well guess i dont have that problem or worry
can someone help me figure out this json error? i'm trying to serialize a class into a json file, but i'm getting an error that doesn't seem to be happening because of me: https://paste.md-5.net/uvadovobep.cs
serialization code: https://paste.md-5.net/muzalelize.m
KingdomsPlugin.kt:48 is just me calling gson.toJson:
val kingdomsFile = dataFolder.resolve("kingdoms.json")
FileUtils.writeStringToFile(kingdomsFile, gson.toJson(kingdomManager), StandardCharsets.UTF_8) // commons-io
i've looked it up and none of the results were exactly relevant, i tried doing this in my maven-compiler plugin and it did not help:
<compilerArgs>
<arg>--add-opens java.base/java.lang=ALL-UNNAMED</arg>
<arg>--add-opens java.base/java.nio=ALL-UNNAMED</arg>
<arg>--add-opens java.base/sun.nio.ch=ALL-UNNAMED</arg>
<arg>--add-opens java.base/java.util=ALL-UNNAMED</arg>
</compilerArgs>
Why are you serializing your kingdom mamager?
good point. well, KingdomManager looks like this:
package com.roughlyunderscore.kingdoms.manager
// imports
class KingdomManager {
val kingdoms = mutableListOf<Kingdom>()
// util methods omitted
}
so it's just convenient for me to have a wrapper class instead of just having a list. however you bring up a good point, do you think i should just serialize the list?
Ah yk what's happening i think
Gson doesn't know to use your serializer @icy beacon
why not?
How did you tell gson that that class serializes kingdom manager?
i've registered it btw
one sec
private fun initJSON() {
gson = GsonBuilder()
.setPrettyPrinting()
.registerTypeAdapter(Values::class.java, ConfigurationDeserializer())
.registerTypeAdapter(KingdomManager::class.java, KingdomDeserializer())
.registerTypeAdapter(KingdomManager::class.java, KingdomDeserializer())
.create()
}
oh fuck
did i really do this
:wheeze:
Write a class that serializes Kingdom
Gson will handle the list itself
i register KingdomDeserializer twice
instead of registering KingdomDeserializer and KingdomSerializer
Lmfaoo
yeah...
i'll try it now and see if the hotfix works
yeah it works now
lmfao
thanks minion
i probably wouldn't have gone to the initializer to double-check without you
can i have a menu gui, like a enderchest gui example, and open it on block place?
basically i want to call an already made menu, in another class
can i do that?
when do you want to call it'
so whenever i want, i want to call the class to open the menu
Player.openInventory(player.getEnderchest);
enderchest is just a 3 row chest with a fancy name
then why you need an ender
so then u can just open a normal chest menu
it was an example
okok
i have a command that opens my menu
and i can call the command and it opens the menu
but i wanted it to open without forcing the player to execute the command
then I would recommend making a method or class with the inventory
that opens the inventory for the player
and call it when the command is executed or the block is placed
Yea
Pass the instance to another class
To use it
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
what would be the optimal way?
i thought about using it as a component
then i just call it and it's the menu basically
The optimal way requires a bit more java knowledge.
Just a heads up: You should not check for custom names on anything.
Not on custom inventories, not on custom items and not on custom mobs etc.
lets say i have 2 commands to open different menus
would they not mess each other?
if you dont check the name
6 months ago
Ofc you still need to check for identity.
If the inventories never change and every player has the same inventory, then
you can simply create the Inventory once and check with .equals() on it.
If you have several inventories then you would create a Set<Inventory>, add the
inventories when you open them, remove them when they are being closed and
check with .contains(inventory) if you need to check the identity.
Then the dev lacks expertise
i think i'll only use one menu
so no need to check any identity?
i mean, check custom name
You always need to check the identity or else you will mess up every chest, dropper, villager etc
on the server.
in my case, instead of custom name, how would i check its identity?
You create the Inventory once and then check with .equals() if the clicked inventory is the one you have instantiated
can you show me an example?
Sure
Create the gui in your main class
Create a getter
And then when the inventory is clicked, you can do plugin.getGUI.equals(event.getClickedInventory)
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
Use dependency injection to pass instances of your plugin to your listener
You'll have to initialize the gui(add the items to it) in the onEnable method
public class MenuManager {
private final Inventory someCustomInventory;
public MenuManager() {
this.someCustomInventory = Bukkit.createInventory(null, 3 * 9, "Coll Inventory");
}
public boolean isCustomInventory(Inventory inventory) {
return this.someCustomInventory.equals(inventory);
}
public void openFor(Player player) {
player.openInventory(someCustomInventory);
}
}
public final class SpigotSandbox extends JavaPlugin {
private MenuManager menuManager;
@Override
public void onEnable() {
this.menuManager = new MenuManager();
// Inject the manager into your listener
MenuListener menuListener = new MenuListener(menuManager);
Bukkit.getPluginManager().registerEvents(menuListener, this);
// Inject the manager into your command
MenuCommand menuCommand = new MenuCommand(menuManager);
Bukkit.getPluginCommand("menu").register(menuCommand);
}
}
Its always advisable to create manager classes.
Those classes are singletons, which means they are only instantiated once
and then this instance is passed around.
Everything can be called whenever you want
You can only use a class if you have an instance of that class.
A class is just a blueprint. It doesnt actually exist until you create an instance of that class.
And every instance has its own values which are independent from the other instances of that class.
A manager isn't special
You don't need a manager for a single inventory
However, with multiple inventories, amanager becomes useful as it removes clutter from your main class
ok
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
Have a read of this page^^
Honestly even for a single inventory i would create a manager. Having a dangling inventory
somewhere just isnt clean. Doesnt matter where you put it, it would violate SOLID
SOLID?
SOLID principles
In a more complex plugin, sure. For something simple, who cares if it's in the main class
i do
Most Yt tutorials suck for plugon development
its good to get started and do simple plugins
but then you get lost in the amount of knowledge you need
i dont use that
use it
i like to struggle and learn the hard way
Most of it is just java. The rest of spigot follows the same pattern mostly.
All you need are events, commands and IO. The rest you have to imagine.
then close youtube and look up the docs
i dont use yt anymore, i used it to get started
Docs only become really useful when you know java
I feel like you know beginner java
i really doubt that
I'd say I'm intermediate
i'm a noob
yeah
i am using java to make mobile apps, so idk
and if java itself isnt enough anymore you come to frameworks or other languages
am i that bad yet?
Yeah you think you know java
its not just about the programming language itself but about programming concepts in general
which go far beyond just learning java syntax
Then you decide to use a poorly documented framework and you feel like a beginner all over again
blame the framework then
ima stick to my js discord bots
challenge yourself and make a JDA bot
what is JDA?
thought you're an intermediate
my best bot, gave me roles 💀
i also did xD, i removed it
soon as i realized it was not so simple to know java
i'll come back one day
dont miss me
au revoir
the more I program on this keyboard the more I feel like I am a generic hacker in a cyberpunk story
weird fantasies but ok
But are you as glitchy as a cyberpunk 2077 character
he's the one implementing the glitch
teleports behind you
nothing personnel kid
Do you feel like you might pass through a wall at any second
I don't even see walls, I just see scrolling lines of green text written in japanese
I'm writing a plugin to add custom armors to my server and I was wondering how plugins like ItemsAdder go about setting a custom armor textures?
I believe those are done using core shaders
Ive tried tinkering with those but GLSL has a pretty steep learning curve and i havent had enough time for that yet
Use mojang mappings
I am
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>${spigotVersion}-R0.1-SNAPSHOT</version>
<scope>provided</scope>
<classifier>remapped-mojang</classifier>
</dependency>
Do you know of any resources on this topic
Then you have:
ClientboundPlayerChatPacket
ClientboundSystemChatPacket
Spigot
Did you look it up somewhere or you just knew that?
https://minecraft.fandom.com/wiki/Shaders
This explains where to place your .gl files.
Other than that you need to learn GLSL to write shaders
Actually that's a dumb questions cause mojand always has ClientBound at the start
lol
Can't seem to find ClientboundPlayerChatPacket
ClientboundChatPacket
Is the right one
Close tho, impressive hehehe
https://nms.screamingsandals.org/
You can look up the packets here
And always prefer mojang mappings over spigot?
1.17.1 has not separation because the messages are not signed in this version
There arent really spigot mappings anymore
Well but for old versions
If you have moj-mappings then always prefer them
I am getting this error while installing BuildTools. (Spigot 1.8.8 and my java version is 1.8.0_361)
I am using the latest version of buildtools
Patching Block.java
Exception in thread "main" java.lang.RuntimeException: Error patching Block.java
at org.spigotmc.builder.Builder.lambda$main$2(Builder.java:669)
at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
at java.util.Iterator.forEachRemaining(Iterator.java:116)
at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)
at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418)
at org.spigotmc.builder.Builder.main(Builder.java:620)
at org.spigotmc.builder.Bootstrap.main(Bootstrap.java:27)
Caused by: difflib.PatchFailedException: Incorrect Chunk: the chunk content doesn't match the target
at difflib.Chunk.verify(Chunk.java:86)
at difflib.ChangeDelta.verify(ChangeDelta.java:78)
at difflib.ChangeDelta.applyTo(ChangeDelta.java:44)
at difflib.Patch.applyTo(Patch.java:43)
at difflib.DiffUtils.patch(DiffUtils.java:70)
at org.spigotmc.builder.Builder.lambda$main$2(Builder.java:657)
... 13 more
clear your buildtools folder.
Also
?1.8
Too old! (Click the link to get the exact time)
I know this but I want to use this version
I tried this but it didn't work .d
Clean folder
Download new BuildTools
run java -jar BuildTools.jar --rev 1.8.8
for example i close my smp server people were playing they were teleport to hub not disconnect the server how i can do this
https://cdn.discordapp.com/attachments/741875863271899136/1090247833338265700/image.png
Why can I not find the import using moj mappings
It just goes to md_5.bungee
bungeecord fallback server
i did this many times but still got the same error
this is plugin name ?
pls tell u know
Be very careful with this information.
What format is this? This doesnt look like json
it's pseudo-json
Missing some colons for my taste
pretty sure you can't enumerate like that in json
tmi
Get the keys as a set and iterate them.
How are those values saved?
// Some map
Map<String, InetAddress> addressMap = new HashMap<>();
// Serialize to json
String json = gson.toJson(addressMap);
// For generics you need a type token
Type token = new TypeToken<Map<String, InetAddress>>() {}.getType();
// Deserialize from json to object again
Map<String, InetAddress> deserialisedMap = gson.fromJson(json, token);
That sentence makes no sense. I dont know what "a data with player name" is.
What do you mean by "this"
Hello. I’m looking for a plugin for my smp server that has teams but also has the value of that team in the land that they have claimed please help me! thanks!
This doesnt take anything. Its an example on how to use Gson properly.
here is another example for non-generic classes:
// Some map
SomeCoolObject someObj = new SomeCoolObject();
// Serialize to json
String json = gson.toJson(someObj);
// Deserialize from json to object again
SomeCoolObject deserialisedObj = gson.fromJson(json, SomeCoolObject.class);
Also:
Map<String, String> data = playerStrData.get(player.getName());
if (data == null){
data = new HashMap<>();
playerStrData.put(player.getName(), data);
}
data.put(propertyName, value);
saveDataFile();
Can be shortened to
Map<String, String> propertyMap = playerStrData.computeIfAbsent(player.getName(), key -> new HashMap<>());
protperyMap.put(propertyName, value);
saveDataFile();
computeIfAbsent gets a value if present. If absent then a new value is put in the map and returned.
Its a lambda expression.
You can think of it like a function that you can pass around.
In this case its a function which creates a Map. This function is
used to create a Map if its not present.
Your approach is fine. If lambdas are a bit much right now then stay away from them.
Smile were you able to look at my message above?
That i look like simon cowell?
bungee has nothing to do with minecraft really.
What are you searching for.
I want to convert ChatSerializer
Which is spigot mapping
To Mojang mapping
Ignore ignore
I can't even appear to read
Inner class
.
Why are you not asking in #help-server
Is the BlockExplodeEvent when the block itself explodes or when blocks are exploded via an explosion?
Aka. Is the event triggered for TNT exploding or blocks exploding cause of TNT?
Neither
tnt is an entity
BlockExplode is for Beds
beds?
Really, that event is just for "intentional game design"
?jd-s
Was looking at this comment here
Yes a block
Are you positive that you downloaded the latest buildtools?
Also show your cli which you use to run buildtools.
Could be anything. My guess is that you are overwriting the file.
It’s called before, mostly.
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/entity/EntityExplodeEvent.html is what u want for tnt
declaration: package: org.bukkit.event.entity, class: EntityExplodeEvent
kk, thx
its basically an anonymous function where you dont need to create another "public void methodName..."
Anonymous class to be precise
yes i directly downloaded the latest version and running it as written in the docs
some files are loading in the installation, it gives an error here.
Are you using a virtual directory. Cloud for example?
No
Can you post the log file if you want?
Meh
I am wondering is there any way to cancel a feeding animal event?
PlayerInteractAtEntityEvent -> check if interacted Entity is instanceof Animal
Then cancel
Use the normal PlayerInteractEntityEvent
Yeah makes sense
InteractAtEntity is exclusive for armorstands iirc
Is there any difference between PlayerInteractAtEntityEvent and PlayerInteractEntityEvent?
pain in the ass but mojang sends separate packets for some reason
I see. thx
AtEntity includes the vector which the entity was clicked at
how would i go about disallowing beds & anchors from changing a player's spawn location? google hasn't been exactly helpful
Hello I need help for create plugin 1.19 please in eclipse!
what's your question
Hello, I want create plugin in 1.19 but IDK How do!
?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.
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
smile, do you have any ideas on this?
Thanks!
I would just redirect the PlayerSpawnLocationEvent
perhaps that's an option
shame spigot does not have a PlayerSetSpawnEvent
not in the mood for coding in paper lmao
wouldnt that just be any time a player right clicks a bed?
and an anchor
and a command/other plugins setting it
yeah
for the right click ways its pretty easy to simulate that event tho
i don't wanna make an event
too lazy for that as well
will just redirect the spawning
I want to create a custom mob with its own texture.
But I came across a problem when I was trying to modify its animation.
I don't know how to control its body parts(eg:head, left hand, right hand, left leg) separately.
I'm now using a normal mob(like a pig) and have an armorstand be its passenger, but armorstand only have six parts tha I can control.
So is there any way to fix the problem?
How can i rotate the corpse entity as same as the cow, the cow rotates using the player Yaw?
//corpse.setPositionRotation(new BlockPosition((int) player.getLocation().getX(), (int) player.getLocation().getY(), (int) player.getLocation().getZ()), player.getLocation().getYaw(), 0);
Location bed = player.getLocation().add(0, 0, 0);
bed.setYaw(player.getLocation().getYaw());
corpse.e(new BlockPosition((int) bed.getX(), (int) bed.getY(), (int) bed.getZ()));```
This is a really complicated task.
You can create animated item models and place them on the head
of creatures. You can also just use already written solutions like ModelEngine
I know there are some plugins but I want to write my own one.
Do you mean the texture model itself can be animated?
Yes you can animate item models
Oh I didn't know that before. I will try it out later. Thank you so much.
The most modern approach would be to translate BlockBench models
to display entities and translate those.
So I've got two modules in my pom project, called api and plugin. In the api module is an interface called IPluginAPI. In the plugin module is a class called PluginAPI that implements IPluginAPI.
The PluginAPI class is defined in the Main class. You can get it with this.getAPI().
The api module is available on maven and can be added as dependency for other plugins.
Other plugins are able to cast the PluginAPI to IPluginAPI and use its methods.
My question is, how would other developers be able to use the getAPI() method if they cannot cast the Plugin to my Main class? I specifically don't want to upload my entire plugin to maven central, but just the api interface.
And if it is impossible to call the getAPI() method, is there another way other plugins can use the api?
I wonder how complicated writing my own modelengine would be
like
Is blockbench data easily formatted 
You would create a registry within your api module with a simple
IPluginAPI getAPI() {
...
}
method. This method either resolves your implementation
by getting it from the plugin, or you add a setter for your API implementation in your
registry. Btw no casting should be needed here as the other
dev will only see the interface.
@tranquil dome
You can have an interface in the API module, APIProvider which declares a method getAPI and returns IPluginAPi
or you can also use the bukkit service registry like smile said
Then your plug-in would implement this interface and define getAPI
Each cube has a UUID 
I wonder how different modelengine would be with display entities 
Much more smooth and much better performance
Because display entities have interpolation
yea
that's what I'm thinking
now
I did fail trigonometry and I don't know how quaternions work
but I can probably make this work
So I'd use getServer().getServiceManager().register(IPluginAPI.class) and then other developers can get it?
anyone got a sample bbmodel for an entity with animations
I'm still kind of confused tho, because would that run the methods through my plugin?
You will need to fully understand quaternions.
This is the most complicated math i have seen so far while programming.
Display entities rotations are defined by two quaternions.
why two
One moment
I did try understanding quaternions once
but I spent 10 hours and felt dumber at the end
because its a better mathematical representation of whats actually going on and avoids some impossible rotation scenarios
but its complicated and weird to wrap your head around
it's some 4d shit that avoids gymbal lock, yes
with 3d you have some weird scenarios where you get limited
yeah
I tried it for version 1.16.5 and it worked. but it gives error in 1.8.8
Then 1.8.8 finally broke it seems like
1.8 broke like a month ago
minecraft servers removed the download iirc
like mojang's aws container is gone
from my understanding

umm my english is not very good and i didn't understand much..
mood
mojang nuked 1.8
I understand that 1.8.8 is broken and I was trying to no avail?
Can't I create custom server jar for 1.8?
@lost matrix
I mean sure you can, you just gotta figure it out yourself or smth
[18:48:17 ERROR]: [ModernPluginLoadingStrategy] Could not load plugin 'RDCakeLib.jar' in folder 'plugins'
org.bukkit.plugin.InvalidPluginException: Cannot find main class `me.placek.rdcakelib.RDCakeLib'
at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:78) ~[paper-api-1.19.3-R0.1-SNAPSHOT.jar:?]
at io.papermc.paper.plugin.provider.type.spigot.SpigotPluginProvider.createInstance(SpigotPluginProvider.java:123) ~[paper-1.19.3.jar:git-Paper-448]
at io.papermc.paper.plugin.provider.type.spigot.SpigotPluginProvider.createInstance(SpigotPluginProvider.java:35) ~[paper-1.19.3.jar:git-Paper-448]
at io.papermc.paper.plugin.entrypoint.strategy.ModernPluginLoadingStrategy.loadProviders(ModernPluginLoadingStrategy.java:150) ~[paper-1.19.3.jar:git-Paper-448]
at io.papermc.paper.plugin.storage.SimpleProviderStorage.enter(SimpleProviderStorage.java:35) ~[paper-1.19.3.jar:git-Paper-448]
at io.papermc.paper.plugin.entrypoint.LaunchEntryPointHandler.enter(LaunchEntryPointHandler.java:36) ~[paper-1.19.3.jar:git-Paper-448]
at org.bukkit.craftbukkit.v1_19_R2.CraftServer.loadPlugins(CraftServer.java:428) ~[paper-1.19.3.jar:git-Paper-448]
at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:273) ~[paper-1.19.3.jar:git-Paper-448]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1101) ~[paper-1.19.3.jar:git-Paper-448]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:316) ~[paper-1.19.3.jar:git-Paper-448]
at java.lang.Thread.run(Thread.java:833) ~[?:?]
did anyone knows that is wrong with my plugin?
at org.bukkit.plugin.java.PluginClassLoader.loadClass0(PluginClassLoader.java:183) ~[paper-api-1.19.3-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.java.PluginClassLoader.loadClass(PluginClassLoader.java:150) ~[paper-api-1.19.3-R0.1-SNAPSHOT.jar:?]
at java.lang.ClassLoader.loadClass(ClassLoader.java:520) ~[?:?]
at java.lang.Class.forName0(Native Method) ~[?:?]
at java.lang.Class.forName(Class.java:467) ~[?:?]
at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:76) ~[paper-api-1.19.3-R0.1-SNAPSHOT.jar:?]
... 10 more```
Looks like your main class is set wrong in plugin.yml
Hi, i'am trying to get the item that i just placed in an inventory, but i cant get any way to get it properly without having to mess around with the clickType of the event and the amount of my itemstack, isn't there a way to get the exact ItemStack that was placed in an inventory ?
for exemple, if i have a stack of let's saw wood, and i right click in my inventory, i effectively place ONE wood, but the getCursor event obviously return 64, which is normal, i wanna get that one wood
Hello, I'm using the raytrace method of player to get the BlockFace the player is aiming on BlockBreakEvent. Is it normal when I destroy blocks fast in creative mode sometimes the Block found in the raytrace is null?
How can i get a item in NMS?
i am getting an error and i couldn't find the solution for it
I get error on 1.8.8 but install successfully without error on 1.16.5
what is the best way to store HashMap<Location, Inventory> in yaml?
is anyone aware how would i approach making a MOTD system that works even if server is off?
to you know display fallback message
why would it work if the server isnt running 💀
a proxy that runs 24/7 :D
i was thinking more about i dont know standalone java program
but it would override the port 🤔
ah
If you look at bungeecord/velocity's source code, I think you could easily figure this out, it could add extra latency on top though, as there's another pipe/server it has to travel through to get to the client
ye im gonna do that
yea
it could honestly just be a bungeecord host
^
java.lang.IllegalArgumentException: Plugin cannot be null
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:145) ~[guava-31.1-jre.jar:?]
at org.bukkit.NamespacedKey.<init>(NamespacedKey.java:108) ~[paper-api-1.19.3-R0.1-SNAPSHOT.jar:?]
at dawid.ratajczak.justbackpacks.backpack.BackpackManager.<init>(BackpackManager.java:21) ~[justBackpacks.jar:?]
at dawid.ratajczak.justbackpacks.JustBackpacks.onEnable(JustBackpacks.java:19) ~[justBackpacks.jar:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:279) ~[paper-api-1.19.3-R0.1-SNAPSHOT.jar:?]
at io.papermc.paper.plugin.manager.PaperPluginInstanceManager.enablePlugin(PaperPluginInstanceManager.java:192) ~[paper-1.19.3.jar:git-Paper-448]
at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.enablePlugin(PaperPluginManagerImpl.java:104) ~[paper-1.19.3.jar:git-Paper-448]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:507) ~[paper-api-1.19.3-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_19_R2.CraftServer.enablePlugin(CraftServer.java:560) ~[paper-1.19.3.jar:git-Paper-448]```
why my plugin is null?
@Override
public void onEnable() {
register(this, true);
backpackManager = new BackpackManager(this);
new Recipes(this).registerRecipes();
}```
BackpackManager line 21
Constructor of BackPackManager
*send
public BackpackManager(JustBackpacks plugin) {
this.plugin = plugin;
}``` this?
but why?
tf lol
private NamespacedKey backpackContentKey = new NamespacedKey(plugin, "backpackContent");```
line 21
wait
Ah this is called before the constructor
yes
Since the field "plugin" isn't defined yet when the class is created, you can't use it.
*amogus remix plays*

is there a reason why the override on "getPotionMeta().addCustomEffect(getPotionEffect(), true)" isnt actually overriding? it stacts the effect onto the #setBasePotionData().
Why do you apply base potion data in the first place?
Also: Naming conventions. "SECTION" should be "section"
i assumed i had to, probably checked some wrong forum info then :p
You can change the color without setting the base effect
So only PotionEffect and PotionEffectType should matter? eh don't really need to create custom potions. only to have a custom Duration and Amplifier.
hence i setted the base ig.
How can i change an EntityPlayer Bed position rotation in NMS?
cant do it with spigot?
Hi how can i check if a day is passed and update the gui?
run a Task that runs every 24 hrs 
I don't think so
i don't think if the server crash, or get stopped
is there a way I can make it harder or impossible to remove my licensing system from my plugin?
I mean just save a unix timestamp in a yml then and check it every so often to see if the time has passed.
Or just check it on gui open
Hello i wanna ask about layer 0 in texture/resource packs. I want to make 3d model but 2d icon, I know it's possible but what I need to do and where i need to make this 2d icon on texture? example Spyglass
Yeah hey
So spyglass is a special case, and mojang kinda broke it
Hi how can i get the last number in the getConfigurationSection and then add like 3 and continue
like:
1:
value: "2"
2:
value: "3"
Which means that the only left option to have a 2d icon for a 3d model, is using shaders.
ah ok thanks for help 😉
Wdym
i want make another in automatic with 1 + the last number, if the last number in the section is 2, when created will be 3
You want to get the value at 1.value and add 1 to that?
no i mean if i have
1:
2:
then i add an item it will be 3 the new section
Oh
so how can i do that?
var config = ...;
int limit = 10;
for (int i = 1; i <= limit; i++) {
int value = i + 1;
String path = i + ".value";
config.set(path, value);
}
Like this
Hard to know without context what you specifically want
so
its for adding item, inside a gui
how can i disable putting items into inventory. I know that i can use#setCancelled() but this sometimes doesn't work
What's your exact use case?
disalbe putting backpack into backpack
Which event(s) are you using currently to cancel it?
inventoryClickEvent
Cancel InventoryDragEvent too
i tried but idon't really know how to use that
It has a cursor
If you're trying to prevent a specific item being placed into another
Check if the cursor is another backpack
and then cancel it if the top inventory is a backpack inventory
InventoryClickEvent should cover all other cases
@EventHandler
private void onEvent(InventoryDragEvent event) {
Logger.log("mam");
}``` this doesn't log anything
It's when you hold left or right click and move the item across the inventory
sometimes this is evet is not called
This event is called when the player drags an item in their cursor across the inventory.
https://cdn.discordapp.com/attachments/883255367289692211/1090342543570505748/image.png i drageditem betwen inventories and nothing happened
@EventHandler
private void onEvent(InventoryDragEvent event) {
Logger.log("Dadadadad");
}```
System.out.println("something");
why tihs?
it prints a line to console, no idea if Logger.log would do the same
public static void log(Object... messages) {
for(Object message : messages) {
if(message == null) {
continue;
}
Bukkit.getConsoleSender().sendMessage(color("&2[LOG] &a" + message));
}
}``` what's wrong with this?
yes
becouse sometimes it's called
wait
does spigot creates separated class for every event or only calls method from the class and class is the same for every event?
how do i make an ItemStack unable to be placed?
u mean block?
you can have multiple listeners in one class, but most people split them up
add a pdc tag to it so you know its custom and cancel it on block place event
so lets say i make a tripwire hook thats intended use is a right click action and i dont want it to be able to be placed
ah yes good idea ty
i mean, if i create variable in listener class is this will be diferent for every event(class) or the same?
if you create a class variable and only create one instance of that class all events in that class can access the variable
Quick question, cause I am quite stumped at why this isn't working:
final World world = pl.getServer().getWorld((String) dataMap.get("world"));
It reads in "world_nether" instead of dataMap.get("world")
https://cdn.discordapp.com/attachments/1070814092178227200/1090093737083949145/image.png
https://cdn.discordapp.com/attachments/1070814092178227200/1090093768524431472/image.png
had these errors in intelij, im fairly new to developing, would appreciate some help for solutions please
do you hae the mavenLocal() in ur deps and have you ran buildtools
opened a repo
i used a repo for a server im developer for, that's all i know really
would appreciate some guidance
also you should be using remapped-mojang
org.spigotmc:spigot:1.18.2-R0.1-SNAPSHOT:remapped-mojang
without the other stuff to remap i wouldnt do that
but remapped is better if you can remap
yeah ofc one also needs the remap plugin
?
I resolved it, one should always load the world first, before trying to access the data XD
im trying to learn to code but everything i try doesnt work
so what did you try
i wanted to make a /fly command
and what's your code and what exactly didn't work?
i saw this somewhere
package me.sw11per.flight;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import
public class Commandkit implements CommandExecutor {
@Override
public void onEnable() {
// Register our command "fly" (set an instance of your command class as executor)
this.onCommand("fly").setExecutor(new Command() {
@Override
public boolean execute(@NotNull CommandSender commandSender, @NotNull String s, @NotNull String[] strings) {
return false;
}
});
private void getCommand("fly") {
}
commands:
fly:
description:
usage: /<fly>
?paste it please
oh
?codeblock
You can use the discord code block format to display code or just text in a more pleasing way:
```java
public class MyPlugin extends JavaPlugin {
@Override
public void onEnable() {
}
}```
Becomes:
public class MyPlugin extends JavaPlugin {
@Override
public void onEnable() {
}
}```
oh lord
first 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.
wtf is this
yeah well learn basic java first
this ^
I need to use two version of worldguard to add legacy and not legacy support, but when i add the 2 worldedit dependencies i get this error cannot access com.sk89q.worldedit.Vector. How can i fix it?
Use maven modules. One for WG6, one for WG7
I don'y know how to use them, can you give me an example or explain it to me?
are you already using maven?
Yep
I don't have time to explain it, but you can check out JeffLib - it has one core module, and different NMS modules that implement the AbstractNMSHandler interface from the core module. Then there's a "dist" module that packages all the modules in one .jar
https://github.com/JEFF-Media-GbR/JeffLib
Thank you 🙂
so you'd have e.g. a core module that declares a WorldGuardHandler interface, then a WG6 and WG7 module
note however, that either your core module depends on the WG6 and WG7 module, OR your wg modules depend on core. but you cant have both
so you either need a dist module too, or get the correct WG handler using reflection
I already created the interface i just need the maven thing
here's an in-depth tutorial about maven modules, but I guess it's a bit over-the-top lol https://www.spigotmc.org/threads/maven-nms-tutorial.347254/
(it's for NMS but ofc you can just adapt it for worldguard instead)
One question, i should replace the auto created pom file with the parent one?
And move the main one somewhere else?
not sure what you mean
your parent pom will have <packaging> set to pom, then a list of your modules. that's basically it
Schedule a task and broadcast a message...
i can't understand where i have to put the parent pom and where the core one
The parent pom is in the root of the project directory. All other poms are located in the root of their respective modules.
YourProject/pom.xml (parent pom.xml)
YourProject/core/pom.xml (core pom.xml)
YourProject/worldguard6/pom.xml (WG6 pom.xml) etc
I should put the spigot api dependenci in the parent pom or on the core one?
If you're planning on supporting multiple versions, put it in the core, otherwise you can put it in the parent.
Why is this null? java RayTraceResult rEntity = p.rayTraceBlocks(3);
I have an if check below it, java if (rEntity == null) { System.out.println("Here"); return ""; }
and that is printing out "here"
I see, what if I'm looking to raytrace an entity
that method is for blocks
and what If im trying to look for raytracing to an entity?
use a normal raytrace
\
What does this mean?
Like their hitbox?
if I just want to leave it as 0 will that affect anything
its the width of the ray
if you are just looking for a specific entity type https://hub.spigotmc.org/javadocs/spigot/org/bukkit/World.html#rayTraceEntities(org.bukkit.Location,org.bukkit.util.Vector,double,java.util.function.Predicate)
Yeah you can leave it as 0
or use the one without a predicate for any
fuck irregular participles
is it possible to set a range aswell?
read teh javadoc I linked
got it
Hi, is there a way to get the placed item in a inventory through the InventoryClickEvent ?
The only way i've found is to run a runnable 1 tick later and get the ClickedSlot to find out what item was placed, but i feel like it's prone to bug in the long run
How would i make armorstands not lag when tps is low? is this impossible or just a "Something you have to live with"?
async with packets instead of spawned entities
Already doing packets
then do it async not sync
why would armor stands cause ANY tps drop if you only send packets?
It's not the armorstands
Its the amount of players :p
And some other stuff on the server.
oh now I understand what you meant
Haha np
lol
i better dont use copilot to write a vm
JNN is a jump instruction
jump if and what then
Jump instructions JMP, JC, JNC, JN, JNN, JO, JNO, JZ, JNZ, and JSRcan use absolute addressing.
smth negative
// idk
💀
lmao
imma probably not make it that complicated
the best things always come because of me being bored
is it possible to make ray trace entities not pick up the player that sent the request?
in the predicate
is there a way to get these properties of a block in a world (not necessarily redstone but also fences, panes, doors, etc.)?
what would be the event to get the arrow shot from an EntityShootBowEvent cause I wanna check them itemMeta of the arrow fired
not a thing on 1.12.2 apparently
ty!
what about the event to get the item placed in a brewing stand?
InventoryClickEvent
aight ty again lol
1.12 is all legacy shite, the datavalue of the block determines those values
0-15
What's that?
I can't make a list of every entity besides players..
i thought there was a more direct way than just having to parse the data byte into whatever property it is, but thanks
heh
Im not sure if this is correct, I am unfamiliar with Predicate
what do i do with this event? I want to check if the item being placed in the brewing stand has a certain ItemMeta, and if it does, it cancels the event
Check if the clicked inventory is a brewing stand, the clicked slot is the input, and the current item has your meta
Or the cursor item
Do people know how to check if its not a specific player?
entity -> entity != player
Guys, what do you think of me doing a server software in python
I always wanted to have a server that can only handle 3 players at a time. Go for it.
lol
just write it in js 🤡
it's obviously a fun project and not a functional one
If your language of choice is capable of networking, it's possible
If I'm not mistaken there is already a Python implementation of a vanilla server
So you can use it as reference if you'd like
Do it in php
the good thing of python is that if it can be done in C it can be done on Python
You also have access to this as a protocol library to save you some time, https://github.com/py-mine/mcproto
Everything can be done in any turing complete language
html would be mad
Thats not a turing complete language
ik
that doesn't work,
nvm, that library is so much more underdeveloped than I thought it was
Just returns null now
Why do you invert this?
broooo was about server in rust
can someone tell me if this would work
p.sendMessage(ChatColor.GREEN + "[V] You promoted" + args[3] + "to" + args[2]);
?tas
just use
entity -> entity != p
well theres like 3 thins i tas rn in the code and i dont really know whats causing the issue
Isn’t minecraft redstone Turing complete
El Risitas describes his experiences with the Rust programming language.
Someone make a server in redstone
isn't everything turing complete if it has NANDs?
there's a button to make the touchpad stop working?
🔨
mine doesn't have any button :<
loled
What does the daddymd5 class do
It daddies md5
You new to java?
nothing that's even remotely useful
I wanted to see how good recaf's string decryption thing is
turns out, it's not very good at all
and this is how it's used. very useful, as you can see
https://gyazo.com/f30db79f55afca9de6b0698458ca1db3 when users fuck up the config
Lol
does mc do garbage dumps. I'm too lazy to make a plugin to check
i dont see why it wouldn't
garbage dumps?
System.gc()
if you mean garbage collection, thats upto the jre
I assure you minecraft does do garbage collection
yeah
Calling System.gc() is kinda not recommended
unless you do it in a scheduler that runs every tick /s
while(true) {
System.gc();
}
inspending?!?!?
no way
I mean
Calling GC is just a suggestion for the jvm
Also you can disable explicit GC with a flag
Fr!
Ello
Well I'm wondering for a WeakHashMap
I was too lazy to try
You still shouldn't need to
Dont you need garbage collection to remove everything in a WhekHashMap that doesn't have an instance?
Or whatever
Was it not recommended not to do gc?
I mean, it can interfere in some plugins isn't it?
don't force gc. The jre will do it when it needs
Garbage collection is needed for everything that takes memory
Oki
WeakHashMap just won’t prevent garbage collection even though an entry is present in the map, unlike other Map implementations
System.gc() is also likely to be disabled by most servers due to a jvm flag, but it’s more of a request to the jvm than what it is of a commandment.
How I can change blockstate of Sculk Sensor?
I want it to update them in radius so they will make vibration
int radius = 10;
Location loc = block.getLocation();
World world = loc.getWorld();
for (int x = -radius; x < radius; x++) {
for (int y = -radius; y < radius; y++) {
for (int z = -radius; z < radius; z++) {
Block block1 = world.getBlockAt(loc.getBlockX() + x, loc.getBlockY() + y, loc.getBlockZ() + z);
if (block1.getType() != Material.SCULK_SENSOR) {
SculkSensor sensor = (SculkSensor) block1.getBlockData();
sensor.getPhase();
sensor.getPower();
sensor.setPhase(SculkSensor.Phase.ACTIVE);
sensor.setPower(15);
block1.setBlockData(sensor);
wrong evaluationif (block1.getType() != Material.SCULK_SENSOR) {
== then?
yes
okay thank you it's change it but it's not make vibration and send it to shrieker🤔
any idea?
neither of these lines do anything sensor.getPhase(); sensor.getPower();
they are just getters which you are doing nothing with
oh okay Ill delete them
Vibrations are handled outside just changing the block data
other than that, I've never used one so can't advise
When they detect a sound they will send a signal to nearby shriekers
I don’t know if there is any api to send those signals
hmm maybe some sort of get around? Like make a fake steps or smth🤔
you can set the last frequency on the TileState. I'd assume that to be the detected sound
should i make a thread or just ask here
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
just ask, its not busy
can i listen for requests to other ports?
how can i get all entities between 2 points and set their AI to false?
where are you expecting these requests to come from?
a discord bot
lookup rayTraceEntities
that runs on the same server
wouldnt it be better to recode the bot in jda
there is a discord plugin/api but I've not used it
jda i would say is the better ish java discord api
i'm trying to make it so that when a scheduled event is created on the discord server, the minecraft server would do certain things at the date of the event for users that are interested
then do as Epic suggests and look up jda
you should be able to connect your Spigot and Discord
listening to http requests would be way more painful
.03 00:34:10 [Server] ERROR Could not pass event PlayerInteractEvent to Oraxen v1.153.0
29.03 00:34:10 [Server] INFO java.lang.ClassCastException: class org.bukkit.craftbukkit.v1_19_R1.block.impl.CraftSculkSensor cannot be cast to class org.bukkit.block.SculkSensor (org.bukkit.craftbukkit.v1_19_R1.block.impl.CraftSculkSensor and org.bukkit.block.SculkSensor are in unnamed module of loader java.net.URLClassLoader @7aec35a)
29.03 00:34:10 [Server] INFO at me.bially.cobaltmccore.urn.UrnListener.onBlockClick(UrnListener.java:52) ~[cobaltmccore-1.0.0.jar:?]
29.03 00:34:10 [Server] INFO at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor258.execute(Unknown Source) ~[?:?]
29.03 00:34:10 [Server] INFO at org.bukkit.plugin.EventExecutor$2.execute(EventExecutor.java:77) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:?]
29.03 00:34:10 [Server] INFO at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:80) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:git-Paper-307]
29.03 00:34:10 [Server] INFO at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:?]
29.03 00:34:10 [Server] INFO at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:670) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:?]
29.03 00:34:10 [Server] INFO at org.bukkit.craftbukkit.v1_19_R1.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:545) ~[paper-1.19.2.jar:git-Paper-307]
29.03 00:34:10 [Server] INFO at net.minecraft.server.level.ServerPlayerGameMode.useItemOn(ServerPlayerGameMode.java:526) ~[?:?]
29.03 00:34:10 [Server] INFO at net.minecraft.server.network.ServerGamePacketListenerImpl.handleUseItemOn(ServerGamePacketListenerImpl.java:1969) ~[?:?]
29.03 00:34:10 [Server] INFO at net.minecraft.network.protocol.game.ServerboundUseItemOnPacket.handle(ServerboundUseItemOnPacket.java:37) ~[?:?]
29.03 00:34:10 [Server] INFO at net.minecraft.network.protocol.game.ServerboundUseItemOnPacket.a(ServerboundUseItemOnPacket.java:9) ~[?:?]
29.03 00:34:10 [Server] INFO at net.minecraft.network.protocol.PacketUtils.lambda$ensureRunningOnSameThread$1(PacketUtils.java:51) ~[?:?]
29.03 00:34:10 [Server] INFO at net.minecraft.server.TickTask.run(TickTask.java:18) ~[paper-1.19.2.jar:git-Paper-307]
29.03 00:34:10 [Server] INFO at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:153) ~[?:?]
29.03 00:34:10 [Server] INFO at net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:24) ~[?:?]
29.03 00:34:10 [Server] INFO at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:1341) ~[paper-1.19.2.jar:git-Paper-307]
29.03 00:34:10 [Server] INFO at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:185) ~[paper-1.19.2.jar:git-Paper-307]
29.03 00:34:10 [Server] INFO at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:126) ~[?:?]
29.03 00:34:10 [Server] INFO at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:1318) ~[paper-1.19.2.jar:git-Paper-307]
29.03 00:34:10 [Server] INFO at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:1311) ~[paper-1.19.2.jar:git-Paper-307]
29.03 00:34:10 [Server] INFO at net.minecraft.util.thread.BlockableEventLoop.runAllTasks(BlockableEventLoop.java:114) ~[?:?]
29.03 00:34:10 [Server] INFO at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1445) ~[paper-1.19.2.jar:git-Paper-307]
29.03 00:34:10 [Server] INFO at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1173) ~[paper-1.19.2.jar:git-Paper-307]
29.03 00:34:10 [Server] INFO at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:305) ~[paper-1.19.2.jar:git-Paper-307]
29.03 00:34:10 [Server] INFO at java.lang.Thread.run(Thread.java:833) ~[?:?]
int radius = 10;
Location loc = block.getLocation();
World world = loc.getWorld();
for (int x = -radius; x < radius; x++) {
for (int y = -radius; y < radius; y++) {
for (int z = -radius; z < radius; z++) {
Block block1 = world.getBlockAt(loc.getBlockX() + x, loc.getBlockY() + y, loc.getBlockZ() + z);
if (block1.getType() == Material.SCULK_SENSOR) {
SculkSensor sensor = (SculkSensor) block1.getBlockData();
sensor.setLastVibrationFrequency(15);
sensor.update();
wall
of death💀
oh okay let me try
okay so now there's no errors but as well do nothing
int radius = 10;
Location loc = block.getLocation();
World world = loc.getWorld();
for (int x = -radius; x < radius; x++) {
for (int y = -radius; y < radius; y++) {
for (int z = -radius; z < radius; z++) {
Block block1 = world.getBlockAt(loc.getBlockX() + x, loc.getBlockY() + y, loc.getBlockZ() + z);
if (block1.getType() == Material.SCULK_SENSOR) {
SculkSensor sensor = (SculkSensor) block1.getState();
sensor.setLastVibrationFrequency(15);
sensor.update();
RIP(*) I think it's no doable;/
what import are you using?
import org.bukkit.block.SculkSensor;
oh okay will try in that range each of them
if not then maybe I will try to replace them with the one that had this frequency in?
hmm seems like any frequency not make anything, stupid sculk thingy💀
Like I said the sensors data has nothing to do with sending out the signal
I don’t know if we have any api to do so
Im running the onCommand function with a switch statement inside it to for the commands, but whenever I run one command, all of them run. Anyone know why?
no breaks
you can
?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.
im not able to upload the entire switch statment cuz too many characters
and im not able to uplaod it as a .txt file either
?paste
you are not using break nor return in any of your switch elements
yes
ok tysm
Switch statements exhibit something called fall through
Which means if it doesn’t encounter some kind of interruption, it will just continue through the cases in order
that worked, thanks!
I am trying to make a plugin that makes it so that the glow effect is applied to your team mates(other people can not see the glow effect), I know I need packets but I do not know where to start.(If there is a plugin that dose this already that would be great to know)
I am trying to make a plugin for something, and I used chatgpt to make the code, how would I turn the visual studio code thing into a plugin
Hello, trying to add NuVotifier as a dependency using gradle (I am a new gradle user) I've followed the instructions on their github and I get this error:
Searched in the following locations:
- https://repo.maven.apache.org/maven2/com/vexsoftware/nuvotifier-universal/2.7.3/nuvotifier-universal-2.7.3.pom
- https://repo.papermc.io/repository/maven-public/com/vexsoftware/nuvotifier-universal/2.7.3/nuvotifier-universal-2.7.3.pom
- https://jitpack.io/com/vexsoftware/nuvotifier-universal/2.7.3/nuvotifier-universal-2.7.3.pom
- https://oss.sonatype.org/content/groups/public/com/vexsoftware/nuvotifier-universal/2.7.3/nuvotifier-universal-2.7.3.pom```
Here is my build.gradle
```gradle
plugins {
id 'java'
}
group = 'cc.creedcraft'
version = '1.0-SNAPSHOT'
repositories {
mavenCentral()
maven {
name = "papermc-repo"
url = "https://repo.papermc.io/repository/maven-public/"
}
maven {
url 'https://jitpack.io'
}
maven {
name = "sonatype"
url = "https://oss.sonatype.org/content/groups/public/"
}
}
dependencies {
compileOnly "io.papermc.paper:paper-api:1.19.4-R0.1-SNAPSHOT"
compileOnly "com.vexsoftware:nuvotifier-universal:2.7.3"
}
... extra lines omitted...
}
Anyone know what the solution could be?
For reference, here is what is on their github page
hi how can i make it so my custom enchant that i made works with anvils?
How did you make it
Is it done via PDC or have you done the janky thing and injected it into the Enchantment class
public static void registerEnchantment(Enchantment enchantment) {
That doesn’t really answer the question
But I’ll assume it’s the later
You’ll need to use the PrepareItemAnvilEvent and handle it manually
so its better to use pdc to make custom enchantments with plugins?
I mean either way you’ll need to handle it manually for anvils
But PDC is less of a hack
is there any place i can go to learn how to use pdc
i was wondering if it was possible to have somewhat of a event waiter? is there a github somewhere for it or something. i basically want to wait for a event to happen then ignore it after that
?pdc
You can just have a Boolean for that
Set the Boolean to true, when the event eventually fires it will set it back to false
If it’s already false, your code will ignore the event
yeah i understand that part but how can i make it unique
basically a event waiter but for different tasks
Wdym unique
Hello trying to add NuVotifier as a
You aren’t saving the config
whats the best way to get the 8 blocks around a face of a block
Such as say, the 8 blocks above?
like the face that im breaking i want to get the block to the left, right up and down
Well you can use Block#getRelative(face) to get the block connected to any face
Why there are events like BlockBreakEvent where there is a method getPlayer but the class doesn't extends any player interface or the class PlayerEvent? Why does spigot doesn't make an interface for each events like this ?
What would be the use case? You listen to specific events, not to interfaces
break a block as if it was being broken by a pickaxe?
hey, i'm making a freeze command and I'm wondering what the best way to freeze someone would be? thanks
i'd create a map of UUID, Integer somewhere
when freezing, put the player's uuid with ticks to freeze as a value
and constantly have a per-tick scheduler running
that decreases the values in the map by 1
probably there's a better way
surely it would just be a freeze/unfreeze
😛
so a Set
oh yeah it's a set if it's untimed
does that stop movement?
then in PlayerMoveEvent cancel if the getFrom != getTo
well no that's just handling the freeze/unfreeze duration
ok cool beans
btw does anybody know if it's fine to have a custom ACF context be nullable?
i couldn't find any info on that
yo can i have a command and event in the same class
why
depends how closely tied they are
it's like eating bread above your keyboard
ugly and probably could be better organized
nah
i do that all the time
just separate them
ok cool beans
@lost matrix wake up super urgent extreme ACF assistance required
commandManager.commandContexts.registerContext(Kingdom::class.java) {
kingdomManager.getKingdomByName(it.popFirstArg())
}
getKingdomByName(..) is nullable, so how would I handle that? would null checking be enough or do I have to do smth else
is there any way to get a player’s movement speed and direction? I guess I could dump it in a hashmap on every playermoveevent after calculating it, but would that cause lag with many players? Is there a better way?
is player.getVelocity() what you're looking for?
i think i found something related in real world examples, you can go back to sleep
as far as I know, player.getVelocity() doesn’t count some movements such as walking around, Im not sure how it works
?xy
Asking about your attempted solution rather than your actual problem
…..the problem is that I need to grab the players speed and direction in a different event
I need to calculate how much of an effect to give to a player based on their speed and direction in relation to other players nearby to them.
how/why are other players going to affect their movement?
i still dont get it
are players magnetic or something?
knockback from attacks
well thats completely different to what you asked
wait are you trying to calculate knockback
no, I just need the players speed and direction
no
knockback would apply in the damage event
Two options:
- Null check in your command
- Register a completion and annotate your parameter with
@Values("@Kingdoms")which only allows those values
are you trying to implement your own knockback?
?xy ^2
Asking about your attempted solution rather than your actual problem
yep
what do you want me to tell you
what you are tryign to do
What you are trying to achieve
not what you have tried
i took a look at an example and handled it this way:
commandManager.commandContexts.registerContext(Kingdom::class.java) {
val name = it.popFirstArg()
val kingdom = kingdomManager.getKingdomByName(name)
?: throw InvalidCommandArgument(Messages.replace(messages.kingdomNotFound, "%name%", name).content())
kingdom
}
because i do not need to have null kingdoms passed into my commands. is this fine as well?
Yes this looks good
alr tyty
will that also affect the durability of the tool?
no
how should i go about making it affect the durability
apply your own damage to the itemstack
hey what do i use instead of playerchatevent cuz its deprecated
playerasyncchatevent
do i have to account for upbreaking myself?
try it and see
thanks