#help-development
1 messages · Page 111 of 1
Along side the loud artificial click sound
both bandicam and unregistered hypercam 4
Turn the gain to 300%
make sure it's clipping
Use both external and OEM software
netbeans with a weird theme
This would be the best coding tutorial. Also make the title in english and then only write in a weird language only 10 ppl on this earth can read.
If I can't hear your heartbeat is it really a good tutorial?
title in english
No
and I'm speaking broken spanish during the video
Don't you dare
how can i change block type after it has been broken? i tried Block#setType but no luck, it only worked after i cancelled the event
No
mike you underestimate my power
Because you're only modifying what's being broken I imagine
Delay it by 1tick
delay by 1 tick if you want the easy way
Set it one tick later. Setting it during the event makes the player break the block you just placed.
yeah i figured
We need a ?1tick command
Seriously, the amount of questions that are asked where the answer is 1 tick of delay
kills the server lol
I know
Honestly its a bit shameful how often i fix something by simply delaying it by one tick...
let's actually modernize it
Thread.exit()
i didnt want to do that but it seems to be no other choice
CompletableFuture.runAsync(() -> {
Thread.sleep(50);
});
its not shameful own it
no I didn't copy lines of code
its proof you are a real developer
imho you aren't a real dev till you've coppied atleast one algorithm from stack overflow being like wtf does this do and just paste it in and it works so you just ignore it
with clicking
I mean copilot is basically copy pasting other developers code with extra steps
it doesn't understand my concepts
if(true) big();
while(true || false || true && true){
CompletableFuture.runAsync(() -> {
Thread.sleep(1);
});
}
async and hella optimized
Have been getting into modelling for my newest project recently. Its quite fun actually.
Geodude!
Async garbage collection;
CompletableFuture.runAsync(() -> {
while(true) {
System.gc(); // async, so lagless!
}
});
2000iq!
Looks like code that would be found in the "terrible plugin"
I made a PR
apparently atomic is thread safe
so we use atomic
to not cause issues
:)
Honestly that plugin is too readable
yeah we should make all variables named "iiiiii1i1i1L1l1l1l1l1l1i1l1i1l1i1l"
Exactly
Any numbers need a few extra ____ in the 1_0_0_0
-.-
what is the strictfp
strict floating point
ahh
basically makes floating point operations consistent across jvm's
Don't use it 
Super useful keyword in newer java versions.
I've never seen it used lol
Well Java 17+ it literally doesn't do anything anymore
You mainly saw it in embedded development
but what if someone's running the server on an android phone on java8
May it rest in peace 
Or on his toaster with java 7
You wouldnt believe how many devices run java 7
public class Falling implements Listener {
@EventHandler
public void onMove(PlayerMoveEvent e){
if (e.getPlayer().getVelocity().getY() < 0) {
Player player = e.getPlayer();
player.sendMessage("ciao");
}
}
}
I tried to do that when you fall it sends a message, but also when I move and I don't fall it sends the message, how can I solve it?
I'm taking a uni class for java next year and the book they gave us is for java 6 lmfao
After creating the world and closing the server, the world apparently doesn't start when I open the server. How do I solve?
pretty sure player velocity doesn't really output anything for moveevent
unless a plugin sets it
check if the to y and from y are different
Define what you mean by "the world doesn't start"
has he tried asking politely?
chunks not sending after reloading the world type deal
Check the y component of the players velocity
ok
poor geodude only has 1hp
modelengine 👀
Right 👍
Looks like you are in the ground.
Get into spectator and fly up
?
If you register a recipe then it will show up in the recipe book
but how do you group them
by giving the recipe a group
that exists?
declaration: package: org.bukkit.inventory, class: ShapedRecipe
World world = Bukkit.getWorld(strings[1]);
p.teleport(world.getSpawnLocation());
After restarting the server the code doesn't work
;-;
?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.
google translate
Can you give more context?
strings[1] = map name
Is an exception thrown when the code is executed? Most likely a NullPointerException
Bukkit.getWorld(strings[1]) - returns null
This just means that the world is not loaded or that the String input was wrong
This is what I was saying before, it seems like the world doesn't start after I restart the server
If its not the default world, you need to load the world yourself.
^
.
Only the default world is loaded on server startup
You need to manually load that desired world
The server does only load the default worlds. You need to load them again on every start if you want to keep using them
How do I do that?
The same way you created the worlds. Spigot loads a world if you try to create it but the world folder already exists
Hello, can anyone help me? I am trying to find the 1.19 spigot api shaded jar file
I am unable to find it
?bootstrap
Bootstrap Jar
The main spigot-1.18.jar is now a bootstrap jar which contains all libraries. You cannot directly depend on this jar. You should depend on Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar, or the entire contents of the bundler directory from your server, or use a dependency manager such as Maven or Gradle to handle this automatically.
Please read the release notes for further information: https://www.spigotmc.org/threads/9-years-of-spigotmc-spigot-bungeecord-1-18-1-18-1-release.534760/#post-4305163
Easiest solution: Use maven
They're saying that if you want to use the API shaded jar for your IDE you should use maven.
I mean you can also run BuildTools and depend on the
spigot-api-1.19.2-R0.1-SNAPSHOT-shaded.jar
It should be in one of the folders.
Idk im using maven so i dont have to deal with such nonsense.
most G response ever
let them dig their own hole
Another question
Would it be better to switch to Maven?
What are the advantages
I was told Gradle was faster
it is
Performance doesn't really matter with this though
the advantages are its better for spigot
the disadvantages are None
It is way way slower unless the caches are full
also its easier ihmo :P
For maven you have the special sources plugin for paper you have the userdev plugin.
So
Spigot => maven
Paper => gradle
or if your a crazy like me Paper => Maven
So you're saying that with gradle paper is faster and with maven spigot is faster?
Nope. You shouldnt care about compile performance anyways.
Its more about the available tools for both build tools.
If you want to start working on nms then for spigot you want
the special sources plugin (which is only available for maven) and for
paper you want the userdev plugin (which is only available for gradle)
nms meaning?
net.minecraft.server
Its basically mojangs server code. If you want to go beyond the api.
Usually discouraged but sometimes not avoidable for deeper modifications like changing the AI of entities.
For now it doesnt matter. Choose whatever fits you.
Ok
Could you or anyone here send me a link for documentation for spigot I can't really find anything
I would also use kotlin dsl for gradle. But thats optional.
You mean javadocs?
ye
?jd
k
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
k ty
Here is a list of important topics like how to setup an empty plugin and how to create your first commands etc
I highly recommend the mcdev plugin for IntelliJ
It lets you generate maven and gradle projects for spigot and paper
How do I get that? (This is my first time using IntelliJ)
hm the mcdev plugin is just archetypes no?
curious as I don't use intellij
Nope its more. It also has additional code inspections.
One example: You dont forget to implement Listener or
annotate using @EventHandler because Intellij warns you.
ahhh interesting
Might go through the effort of making this for vscode some day
Imagine writing java in vscode
i've been using vscode since i started coding
this is the first time im using something else\
I tried intellij not my thing 🤷♂️ all personal prefference
whats the equivalent of CraftItemStack.asNMSCopy for moj mappings?
cant find any method except for the compound tag constructor
what version
1.19
What do you mean? CraftItemStack.asNMSCopy exists in all versions...
uhm isn't that a craft bukkit thing
Thats CraftBukkit. It has nothing to do with nms.
Nope this does not work fine.
Exactly
@lost matrix Gradle is confusing I'm going to try seeing how Maven is how do I create a maven project
nvm figured it out
mcdev is nice
Use the mcdev plugin. It generates you a clean setup.
PS: Dont build artifacts. Thats not how you compile in gradle nor maven.
wait I thought thats how you got the craft equivalents i thought you just casted
damn did it change or something?
ItemStacks are a different breed.
Always has been
Usually you are right. CraftBukkit implements Spigot and wraps nms.
So
NmsThing nms = ((CraftThing) Thing).getHandle();
What do depend and soft depend mean? What do I put for both of them
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
Ok
depend = other plugins you depend on (should load before your plugin)
softdepend = other plugins you might depend on but only if they are loaded (should load before your plugin. Is optional)
Did you compile the empty plugin and tried starting a server with it?
I would start there.
ok
So you said something about not using build artifacts?
Then how do you compile the code?
gradle or maven?
maven
Intellij has buttons for that
ok
Then the jar should be in your "target" folder
I can't find the "Lifecycle" folder
Right side there should be a Maven tab
hey
ok
i got a question
what is it
how can i make tnt firework rockets
like when a firework rocket impacts on something it makes an explosion like tnt
nvm i see it i was looking on the left side thanks
with explosion power but not destroying the area too
use ProjectileHitEvent
check if its a firework, make explosion
what is that
an event
lol. Wrong channel then.
what channel then?
yeah i know
im searching for like
a imploding crossbow like the one from mc dungeons
but like that
try asking on ?services
?
its a pretty easy plugin, maybe someone generous enough would make it for oyu
?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/
letes move to #help-server
@lost matrix tysm for the help the plugin works!
Nice 👍
What kind of plugin are you going to write?
Idk
I have a mc server with some irl friends and I wanna make a plugin for that
Maybe like custom items and stuff
Start small:
- Create custom join and quit messages
- Add bleeding particles when someone hits an entity
Hmm
Okay
@lost matrix Im working on the first one
How do I make a function that runs whenever someone leaves and jonis
basically how do i make events
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
Hint: The event you want to use is the PlayerJoinEvent
And the event has a method called setJoinMessage(String)
@lost matrix i figured out the first one
When a player joins it that they joined in chat which includes their ign
Alright whats your next plan?
finish the player leave
I have no way to test if the player leave works because I only have one account lol
How do I make the blood effect when a player hits an entity
I know first I have to make an event for when an entity gets hit right?
EntityDamageByEntityEvent -> get the entity -> get the location -> get the world of the entity
-> spawn particles
BlockData redstoneBlockData = Bukkit.createBlockData(Material.REDSTONE_BLOCK);
int amount = 16;
double offset = 0.33;
entity.getWorld().spawnParticle(Particle.BLOCK_DUST, location, amount, offset, offset, offset, redstoneBlockData);
hmm
so i figured out how to make the entity damage event
but how do I check if the entity is a player?
ok
There are 2 ways.
@EventHandler
public void onDamage(EntityDamageByEntityEvent event) {
Entity attacker = event.getDamager();
if(attacker instanceof Player) {
Player attackerPlayer = (Player) attacker;
}
if(attacker.getType() == EntityType.PLAYER) {
Player attackerPlayer = (Player) attacker;
}
}
The former is preferred
Better yet, you can make the variable in the instanceof as a pattern if you're using modern Java
And for the newest versions
if(attacker instanceof Player attackerPlayer) {
}

by former which one do you mean
the former
former = first
does anyone know if your allowed to manually obfuscate code?
like just make ur code harder to read by hand lmao
You should never ever do that. Always strive to make your code easier to read.
no like its supposed to be hidden its a very small section of my plugin i dont want people to read
They will find it anyways. But its not specifically forbidden as long as the staff can still make out what your plugin does.
ight thanks
Create a furnace recipe that lets you smelt rotten flesh into leather
Write shit code? 😅
ok
https://www.spigotmc.org/wiki/recipe-example/
Here is an example on how to register a shaped recipe.
What you want instead is a FurnaceRecipe
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
time to get cross-player interaction workin
How do you determine authority?
One of the servers has to have authority over certain objects or you will end up with horrible duplication bugs and other desync issues.
ah it's only affecting the player entity, not modifying blocks or items etc
each server is basically acting as a proxy for player packets
And which endpoints do the server proxy?
And how can they be both proxies. Are they in parallel or series?
yeah parallel. All I'm doing is for example player movement
get player movement (server 1) -> send redis packet -> receive and interpret player packet (server 2) -> send entity packet to players (server 2)
so theres no master server, they all intermingle
Well then the packets are not proxied but merely broadcasted. This might lead to problems but youll get there.
Damaging dead players for example. And this gets only worse with more instances.
If 2 instances try to change an object at the same time.
ah im not going to do damage
this is merely for visuals
and cross-server trading which won't rely on this system anyway
Ah i see
the players just act as an interface to prompt the trade
close to no latency aswell. This is with an american redis server, and both minecraft servers are in australia
im just worried about how it will work with a lot of players
but the system is as simple as it can get tbh
@lost matrix im trying to make the furnace thing
I looked at the java docs, but it says I need a namespace key
What is that?
I don't fully understand the use of it
just think of it as a regular key, it just allows multiple plugins to have the same key name and not interfere with eachother
A NamespacedKey has two parts. A namespace and a key
namespace:key
You can create as many NamespacedKeys for your plugin as you want my simply
calling
NamespacedKey namespacedKey = new NamespacedKey(plugin, "key");
a descriptive name for your recipe like "rotten-leather-furnace-recipe" for example.
Everything in minecraft is keyed
An instance of your JavaPlugin
By using basic java?
"this"?
The most commonly used approach is a singleton style pattern.
In your JavaPlugin class
private static SpigotSandbox instance;
public static SpigotSandbox getInstance() {
return instance;
}
@Override
public void onEnable() {
instance = this;
}
Then in other classes
SpigotSandbox plugin = SpigotSandbox.getInstance();
Another common approach is dependency injection through the constructor of a class
Your Listener class:
public class YourListener implements Listener {
private final SpigotSandbox plugin;
public YourListener(SpigotSandbox plugin) {
this.plugin = plugin;
}
}
Then in your on enable
@Override
public void onEnable() {
YourListener listener = new YourListener(this);
Bukkit.getPluginManager().registerEvents(listener, this);
}
ctrl + shift + S
But you wont be able to post it here because you didnt verify your spigot account
figured it out
bungeecord: am trying to connect a player to my own constructed ServerInfo server when a player connects - but I don't know which event I can do this in, if this is even possible? If I do it in PostLoginEvent, it appears it first attempts to connect the player to the lobby/whatever server first before it runs my getPlayer#connect method, at least from what I recall in the log.
how would I go about setting the broken block to a different block?
this is what i've got so far
import org.bukkit.Material;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockBreakEvent;
public class EventListeners implements Listener {
@EventHandler
public void onBlockBreak(BlockBreakEvent event) {
Material type = event.getBlock().getType();
if (type == Material.STONE) {
}
}
}
One tick later
use a scheduler
?scheduler
i forgot the command
Bukkit#runTaskLater(final Plugin plugin, Runnable task, final int delayInTicks)
uhh so am I meant to register a nexus account or something?
if so how do I do that?
I'm using this article as a guide: https://www.baeldung.com/maven-deploy-nexus
in your profile
I don't have a profile
wait my computer isn't the repository is it?
I don't want to keep it on all the time
there is a user settings xml file. Cant quite remember where.
i think I need to create one
so the password is safe right?
and do I need to add settings.xml to my git ignore so no one can look the password?
settings xml should be in your .m2
not your project
ahh that makes a lot more sense
cuz it being a public repo and all...
I don't see it, should I just create one?
?paste
What is wrong with my code?
?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.
I'm having some issues with referencing the plugin instance in the NamespacedKey can anyone help?
Show some code
ok
😉
7smoe7 i can't find my settings.xml in my .m2
then create one
like this?
also stfu about me using linux
im not poor I have windows
and I use vim 😉
Did you mean: emacs
no, who do you think I am?
basically it says no calling non-static functions in a static function
i have no idea why this rule exists
it seems so random
Bump 😦
well you're calling local methods on a static context
so you won't have access to instance variables
java isnt random
and/or abstraction
Its not random at all. Static functions are in a class but non-static functions are in an instance of a class.
Totally different scopes.
it makes logical sense given static functions are functions that don't need an instance of a class
Gotta learn java to understand
taco talking the facts
and you're trying to call instance-specific methods that might depend on local variables, and/or modified through abstraction
ok
i get it
so i have a class where all my recipes go
and i need to access the plugin (main class) to use the namespace key
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
ffs learn java
does this look alright for a settings xml?
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 https://maven.apache.org/xsd/settings-1.0.0.xsd">
<localRepository>${user.home}/.m2/repository</localRepository>
<interactiveMode>true</interactiveMode>
<offline>false</offline>
<pluginGroups/>
<servers>
<server>
<id>nexus-snapshots</id>
<username>deployment</username>
<password>cIClicidEnto</password>
</server>
</servers>
<mirrors/>
<proxies/>
<profiles/>
<activeProfiles/>
</settings>```
So thats my settings.xml but when I deploy I get ```[WARNING] Could not transfer metadata com.neomechanical:NeoUtils-parent:1.0-SNAPSHOT/maven-metadata.xml from/to nexus-snapshots (http://localhost:8081/nexus/content/repositories/snapshots): transfer failed for http://localhost:8081/nexus/content/repositories/snapshots/com/neomechanical/NeoUtils-parent/1.0-SNAPSHOT/maven-metadata.xml
?paste
my pom is this https://paste.md-5.net/fihodikoxe.xml
validate your acc
oh
I have a mongodb database
I wan't to check state through user's ign (ingame) through my plugin
https://paste.md-5.net/iqoyeroleh
I just want to get value of "state" from database, for some reasons this don't throw any errors and don't even prints something out
smile your spigot profile picture is exquisite
borderline chat floodings
?paste might be good
its fine you're new
done
Thx. It was generated by an AI
DallE 2
amazing technology
Ok so first of all: This can easily cause lag. IO on the main thread is always a bad idea.
how can I
🤔
alternates please
Next: Why do you have MongoDB related fileds in your listener class?
All if this should be separated into several different classes.
Next: What if a player changes his name? (All his data will be lost)
You should never use the name of a player to identify them. Always use their UUID.
I thought it won't affect as its separated from onJoin thing, and it won't be called
Fine, I'll use uuid instead
still, how will I manage to get the values
ffs no one told me I needed to download Nexus Repository Manager
One moment im writing you how to query for a single field in mongodb
Oh sure, Thanks a lot \❤️
String playerName = ...;
MongoCollection<Document> collection = ...;
// This is the filter to search for a document
Bson filter = Filters.eq("ign", playerName);
// This is a projection meaning it will not return the
// whole object but only the fields you specify here
Bson projection = Projections.include("state");
// Query with the filter and the projection. The document
// will only contain the projected fields.
Document found = collection.find(filter).projection(projection).first();
if(found == null) {
// If no document was found then it will be null
}
String state = found.getString("state");
Also using the String "False" as a state is very questionable.
Did you master storing data in Files first?
Why do you need MongoDB?
I've done that with python through a discord bot (in mongo)
so its like user will use a command inserting there ign
and it will connect it's id and ign
and state is basically there presence in a voice channel
Nexus repo manager manages repos like docker, maven or npm
You need to install it on your server if you want to publicly provide maven dependencies.
There is a simpler way. Many people just use jitpack which spares you all the hustle.
I would like to use jitpack but its impossible if I am using mojang remaps
which I self host?
Well... yes. There are probably some lightweight alternatives.
fuck it I'll just not use remaps
actually
idk I'll try configure nexus and see what happens
its doing something
LETS GO
why does Inventory#remove remove all similar stacks?
is there an easy way to remove just the referenced itemstack instead
ah nvm can just do inventory.setItem(inventory.first(item), null);
inventory.first() iirc is based off the type and count of the ItemStack. It doesn't remove the referenced itemstack.
does it take meta data into account
Yeah, I ran into the same issue when creating my GUI api
So true
I finally installed nexus, made my account and setup my pom
however
errors
what should I do?
hey guys, im trying to connect my website to my mc server, but im having a doubt... How can i fetch the api from my plugin from the website (the website and mc server are in different hosts)
not sure what you are asking
im tryna make a buycraft website
that allows users to buy in-game items from the website
so you want to use the buycraft api in your plugin?
btw what buycraft api
third party stuff sorry
hm?
https://javalin.io/documentation#getting-started im using this
as mentioned by another person from here
That breaks eula
That means they’re breaking it aswell
You cant sell items that gives the player an upperhand on non paying players
I mean you still can but if mojang catches you…
they can't really do much
i mean there are very popular servers
like even hypixel
has a shop
so idk
having a shop isn't what would be against the EULA
Hypixel adheres to eula
for the most part
And anyways why dont you use the buycraft plugin
can u link me to it
and im tryna make a shop
so... 🦗
but just because a large server organization does something, doesn't mean its a good idea to do the same
large businesses can afford to not follow some rules, especially if those rules are from another business 😛
ok ty
Theres a dl link on the tebex site
Any Event for when a Sculk Shrieker is activated
not sure, maybe GenericGameEvent? https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/world/GenericGameEvent.html
it might be GenericGameEvent with underlying GameEvent.BLOCK_ACTIVATE or GameEvent.SHRIEK but you gotta try it and see
how is the repository id significant?
<id>neomechanical-repo</id>
<url>https://hub.neomechanical.com/repository/maven-snapshots/</url>
</repository>```
do I just put anything there?
🍆
🥒
so its whatever I use for distribution management id
i suppose
should probably change that then
oh and can you go to https://hub.neomechanical.com
Nexus Repository Manager
nvm discord found it
Hypixel is not breaking EULA since you cant pay to win
thats not allowed
thats why coloseum on hypixel's skyblock is closed
@wet breach @keen spindle @drowsy helm
was that ping necessary
wow wow wow don't ping people like that
no it wasn't
How can you efficiently check if player is in area
step 1
go to https://google.com
Search the world's information, including webpages, images, videos and more. Google has many special features to help you find exactly what you're looking for.
then
search
declaration: package: org.bukkit, interface: World
Hello, does anyone know why heads don't get placed properly in 1.8 when using the SkullCreator library? (https://github.com/deanveloper/SkullCreator/blob/master/src/main/java/dev/dbassett/skullcreator/SkullCreator.java) I'm using this method to create the head final Block skullBlock = this.block.getRelative(BlockFace.UP); SkullCreator.blockWithBase64(skullBlock, "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOGNjNzI1NzhhNjBjMGViMWEzZmEzODFhYTYyMmEwYzkyNzZkYTdmOTU4YWU5YTBjNzFlZTQ4ZTc3MWZiMmNjNSJ9fX0="); If anyone could help me fix this issue, it would be much appreciated.
try using BlockFace.(bottom or down idk what this enum has)
How can I get the block next to an entity?
to the right of
Can anyone help me figure out how to send formatted messages (i.e. with click & hover components) to players?
I currently have this, though as you can see, it isnt quite right, and Im not sure what Ive messed up
https://uploadi.ng/📷👞💫🌲
https://uploadi.ng/👚🍭🤿💎
that is single-handedly the most ugly cdn link i've ever seen
Yeah, the URL I was using previously expired like last night, and its using a default format rn
To get the block to the right of an entity you'll need to get the entity location, then get block. After use block.getRelative(BlockFace.EAST) and check if the block isn't an air block (if it isn't air you'll have the block your looking for). You can perform this in PlayerMoveEvent or you can create a task that runs every second and perform it for all players Bukkit.getOnlinePlayers().
Since im using kotlin, the "it" inside of the Bukkit.getServer().onlinePlayers.forEach loop is just a stand-in for the player
so it.sendMessage() is the same as player.sendMessage()
hi a question how i can remove /kill message from the chat? says like "Player fell out of the world"
Hello 🙂
The sendMessage method requires a BaseComponent, but you have an array of BaseComponent.
Instead of using the component builder you can create a new TextComponent and add hover and click actions using the methods (TextComponent#setHoverEvent and srtClickEvent) iirc
Is there a way to suggest a command when a player clicks an item in the inv?
Listen to the player death event, and don't send the message
Oh hey, thanks
Don't I recognize you from the holoBroadcast discord btw?
there's a way before the player die to put something in his inventory?
What are you trying to do
||https://xyproblem.info/||
if you want to add an item to the dropped player items just add that item to the dropped items collection
no need to give it to the player first
i have a plugin for corpse and this plugin doesn't have a API and i can't put inside of it something and i have a datapack managing most of the gameplay and this datapack owner is a dick head and wont help me and i want put a note inside every player before they die and then the corpse plugin make it find inside the NPC inventory
As Athlaeos said, add it to the drops collection, I guess the NPC is based on this event
If it doesn't work, try to put the event level to low
what's the event name?
PlayerDeathEvent
ok and i can still add inside of the inventory before the player hit respawn or in some other way?
you can add the item to the dropped items directly
no need to add to inventory first
try that
ok thanks
hm hey I had an idea so great it might just be really dumb, I'm making an api for my projects which I'll be shading in and there's quite a few apis that I tend to use on all of my projects, is it fine/possible to put those apis in my own api so I need to handle fewer imports?
if its shaded i dont see why not
i found a bit of an inconsistency with Block#getDrops() when applied on a crop block, it returns a collection with two itemstacks. One being the drops of the crop if broken when not fully grown and one where it is fully grown, is this a reportable spigot bug?
shading in an api with shaded in apis, I guess I shall be coding in the shade
so if i break a fully grown potatoes crop it returns 1xpotato and 2-5xpotato
stop
lmao
can someone help me with this code it should put skull item in slot for each player that is online on server but it doesnt set those skulls in inventory
api 1.8.8
server version 1.8
what packet is used when player opens inventory
why arent you doing for (Player p : players)
You’re opening the inventory for the players whos head is being given
Not for each player
my guy
He wrote it out for you lmao
my dear sweet child
player is argument given from when player executes command it is not for each player it is for player that executed command
it opens inventory
but it doesnt set skull item
in slots
as it should
45 isnt a valid size right?
Yes 45 is valid
it should be because it opens inv properly
Why you using var
cuz why not
why Bukkit::getOfflinePlayer is deprecated
and up to 54
Cuz getting by name?
If it's deprecated
its deprecated
Deprecated just means it’s outdated
depricated doesn't mean it wont work
Doesnt mean it doesnt work
deprecated just means it might not work consistently and might not work in the future
you can use
its no longer supported basically
public void playerGui(Player player) {
var pGui = Bukkit.createInventory(null, 45, "§c§lSelect player:");
Bukkit.getOnlinePlayers().forEach(p -> {
var playerHead = new ItemStack(Material.SKULL, 1);
var meta = playerHead.getItemMeta();
meta.setDisplayName("§c§l" + p.getName());
playerHead.setItemMeta(meta);
pGui.addItem(playerHead);
});
player.openInventory(pGui);
}```
doesnt work
what exactly
var is not a keyword in java
it still doesnt set skull item in slot
but it is in kotlin
bro
is it
java has var since java 13
it do be
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
Since java 10
sry my bad
It’s a keyword for lazy people who dont like strongly typed langs
removed
it's not a keyword
cuz you can declare variable
mb
half-keyword
You aren't setting the owner of the head
ItemStack playerHead = new ItemStack(Material.PLAYER_HEAD, 1);
SkullMeta meta = (SkullMeta) playerHead.getItemMeta();
meta.setOwningPlayer(player);
meta.setDisplayName("§ahead");
playerHead.setItemMeta(meta);
Strange
i wasnt trying
i assume this wont work because api im using is 1.8.8
just added name
replace with SKULL
sure
I need help with my jar file its too fat
if you apply to job with java don't forget
))
can I upload for you to inspect?
smh just work out
go to the gym smh
Just comiple in eclipse with no modules
...
ez
Caused by: java.lang.ClassCastException: class org.bukkit.craftbukkit.v1_8_R3.inventory.CraftMetaItem cannot be cast to class org.bukkit.inventory.meta.SkullMeta (org.bukkit.craftbukkit.v1_8_R3.inventory.CraftMetaItem and org.bukkit.inventory.meta.SkullMeta are in unnamed module of loader 'app')
./suicide
welp
this is an error im getting after adding your code and inventory is not even opening anymore
ez
it just runs into this error
you dont have to shade gson
and cast to jar
but its not included in 1.8
Kyori adventure is most of your plugin's weight
only a bit of nms required
shaded?
yeah how do I deal with that?
because I need kyori
💀
🩲
is it in maven central?
Nexus Repository Manager
adventure i mean
if it is you can use spigot lib loading
but I don't use resources because I got to support 1.8
why
because
except
ahhahahah
servers are DEPRECATED
minecraft servers = minorites
1.8 at least
what a strawman
so were minorities at one point of history
yeah
I probably dont need commons shaded
common r in spigot iirc
wait
are they in 1.8 servers?
wait they would be if I could remove commons from my pom on a module that is using 1.8
boom 1.6mb
from 3.7 or whatever
What the hell minorities? Syrians??
java.lang.ClassCastException
hey yo I didn't say anything about Syrians
Man the top Minority is Syrians
thats subjective
drip
metaverse
Enough man really enough dont be racist
don't call me a racist, because I'm not
thats not funny
you cant be racist when you hate everyone
hate eveyone equally
thats a good philosophy of life
bro hell no
Come to general i want to say you something
wtf man
1 or 2?
0
Chat bro
nah
imagine talking
why cant we program with our voice?
Im not on pc
rate my trade ui
looks like a penis, i like it
in what world
💀
SJSJOAAPOAOAPAPAOAUAYAYAGA
what have i done
why the balls orbiting the shaft tho?
this world
HR complaint
uh theres
i cant see any ContainerOpen packet tho
no clue what this one is
sounds promising tho
How can I convert this data into ItemStack?
config util will deserialize it for you
doesnt trigger
nor on horse
wait thats clientbound
you want serverbound
yeah theres only containre click and close
does client even send a packet for open
use protocollib and listen to all packets?
hOw
Client doesn't send a packet when opening it's inventory
There is no way
The server doesn't know that the inventory is open
bruh
to avoid XY
my goal is to make player not see armor
but see the armor items in inventoy
Don't think that's possible without a mod
Yeha dont think it’s possible
You can maybe send packets to hide the armour
Or rather, intercept the equipment packet
but i need 2 know when
You can just hide it for other players
Does it really matter if you can see your own armor
Is it?
theres like a big delay
Never noticed
Could also be the proxy
Does spawning a mob and then changing something in it's pdc work?
Dear Spigot team.
Have you got an discord bot to verify payed plugins in discord channels?
is there a way to get who executed a command?
thanks
@tender forge bru power ranks and multivers core plugins are not working in aternos
No, any premium purchases you make are between you and the seller, spigot doesn’t get involved
Don’t randomly ping staff over that
Also
?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.
Does anyone know why the hex color coloring here isnt working?
Im sure that im doing something wrong
https://uploadi.ng/🐁🚒😋🥥
ingame output
https://uploadi.ng/🤖🧩📂😴
Client and server version are 1.19
You can’t use ChatColor directly in components like that
Unless you use TextComponent.fromLegacyText
Hm, because the actual text that is going there needs to be read from the config, im not exactly sure how to accomplish what im trying to do
I managed to make a regex replacer that replaced #rrggbb with the proper ChatColor.of("#rrggbb"), but it wasnt working, I guess I know why.
When using the .fromLegacyText, how would I apply hover and click events to it?
Or what else could I use/do to get a string from my config, parse its colors/hex colors, then apply click and hover events to it
Should it?
Intellij seems to dislike that
https://uploadi.ng/🤽🏰🤿🍷
i need EnchantmentTarget.TOOL but only for pickaxes, what shouild i do?
shalli do includes?
I have a question. How can I code it that a player is in a different position. I don't mean teleporting. I mean that it looks like that player is swimming or stuff like this
You'd have to use NMS or a protocol library to send to others player a change is player state
Don’t work if they aren’t in the air/water
ok
hey how can i create a shield that shows the player's name?
What would be the best way to go about doing this?
how would a shield show any font? shields afaik can only show pre-made banner images
.append them to each other
Sorry i mean a sign
player.sendMessage("§fYou have been given a§f §4§lDctr's Space Helmet!§4§l §f§l(2022)§f§l");```
need help changing this to show the admin name who executed the command like AMONGUS gave you a Dctr's Space Helmet
this is so pain how do i check if an item is obtainable in survival mode? i've thought of every type of block that is illegal but theres still more. I can narrow it down with getRecipesFor, but that doesnt include like half of blocks: dirt, logs, sand, seeds, and more materials
i don't want to have to go through every material and write a list
plus its not future proof at all
how can i change armor stand head rotation ?
do you have commandsender?
i already tried that but the head doesnt
yes
wait I do
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
i suppose
Block block = ...;
Sign sign = (Sign) block.getState();
sign.setLine(0, "First Line");
sign.setLine(1, "Second Line");
sign.setLine(2, "Third Line");
sign.setLine(3, "Fourth Line");
do I just use this?
(Player)sender).getDisplayName()```
that works
who u talking to
the block there is obviously the sign-block you want to modify
me or Dev or Chloe
.
.getCustomName() will get nickname, or .getName() will get there actual name
bump because yes
i don't think there's a native way except having a list manually
i don't think so
so I just do
player.sendMessage((Player)sender).getName() + "gave you a dctr space helm");
?
material.isAir() removes the air blocks, isItem() removes the ones that cant get in ur inventory, and thats about all i have so far
how would i like rotate a voxel model
the only information i have is where each voxel should go like jsut a point in 3d space
and the size of the space
That will work
yea, that's all you can get
make a list of unobtainable items and use that
only way i think
yes, there's many items
it took me approx 3 hours in the past do do this
in 1.16 iirc
at least i don't think there's that many unobtainable items
Cannot resolve method 'sendMessage(org.bukkit.entity.Player)'
How do I trigger that? So players can see their names on the sign
player.sendMessage(((Player)sender).getName() + "§egave you a§e §cDctr's Space Helmet§c (§e001)§e!");
its just the annoying stuff like this
