#help-development

1 messages · Page 111 of 1

vocal cloud
hasty prawn
#

Along side the loud artificial click sound

echo basalt
#

both bandicam and unregistered hypercam 4

vocal cloud
#

Turn the gain to 300%

echo basalt
#

make sure it's clipping

vocal cloud
#

Use both external and OEM software

echo basalt
#

netbeans with a weird theme

lost matrix
#

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.

vocal cloud
#

If I can't hear your heartbeat is it really a good tutorial?

echo basalt
#

title in english

vocal cloud
#

No

echo basalt
#

and I'm speaking broken spanish during the video

vocal cloud
#

Don't you dare

desert frigate
#

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

vocal cloud
#

No

echo basalt
#

mike you underestimate my power

vocal cloud
#

Delay it by 1tick

echo basalt
lost matrix
desert frigate
vocal cloud
#

We need a ?1tick command

echo basalt
#

I'd make sure to use Thread.sleep(50) on the tutorial

#

for delays

vocal cloud
#

Seriously, the amount of questions that are asked where the answer is 1 tick of delay

desert frigate
echo basalt
#

I know

lost matrix
#

Honestly its a bit shameful how often i fix something by simply delaying it by one tick...

echo basalt
#

let's actually modernize it

vocal cloud
#

Thread.exit()

desert frigate
echo basalt
#
CompletableFuture.runAsync(() -> {
  Thread.sleep(50);
});
vocal cloud
#

Is it really bad practice if no one practices it?

echo basalt
#

🤔

#

yo 7smile btw

#

I decided to get some "inspiration"

lost matrix
#

Hm?

#

Thats a weird way of saying you copied hundreds of lines of code

river oracle
#

its not shameful own it

echo basalt
#

no I didn't copy lines of code

river oracle
#

its proof you are a real developer

echo basalt
#

but I copied some of your concepts

#

and made map system

river oracle
#

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

echo basalt
#

with clicking

vocal cloud
#

I mean copilot is basically copy pasting other developers code with extra steps

echo basalt
#

copilot only recommends me random stuff

#

that doesn't work

echo basalt
#

it doesn't understand my concepts

vocal cloud
#

if(true) big();

echo basalt
#

fuck the version on my test server is broken

river oracle
#
while(true || false || true && true){
 CompletableFuture.runAsync(() -> {
  Thread.sleep(1);
 });
}
echo basalt
#

async and hella optimized

lost matrix
#

Have been getting into modelling for my newest project recently. Its quite fun actually.

vocal cloud
#

Geodude!

echo basalt
lost matrix
#

Looks like code that would be found in the "terrible plugin"

echo basalt
#

I made a PR

#

apparently atomic is thread safe

#

so we use atomic

#

to not cause issues

#

:)

vocal cloud
#

Honestly that plugin is too readable

echo basalt
#

yeah we should make all variables named "iiiiii1i1i1L1l1l1l1l1l1i1l1i1l1i1l"

vocal cloud
#

Exactly

echo basalt
#

should I pay 700€ to get this monitor 🤔

#

it's great for discord

vocal cloud
#

Any numbers need a few extra ____ in the 1_0_0_0

lost matrix
#

-.-

river oracle
#

what is the strictfp

echo basalt
#

strict floating point

river oracle
#

ahh

echo basalt
#

basically makes floating point operations consistent across jvm's

vocal cloud
#

Don't use it KEKLEO

lost matrix
#

Super useful keyword in newer java versions.

river oracle
#

I've never seen it used lol

vocal cloud
#

Well Java 17+ it literally doesn't do anything anymore

lost matrix
vocal cloud
echo basalt
#

but what if someone's running the server on an android phone on java8

vocal cloud
#

May it rest in peace hes_UwU

lost matrix
echo basalt
#

I actually started coding plugins on java6

#

so I don't mind much

sinful rapids
#
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?

river oracle
#

I'm taking a uni class for java next year and the book they gave us is for java 6 lmfao

sly depot
#

After creating the world and closing the server, the world apparently doesn't start when I open the server. How do I solve?

echo basalt
#

unless a plugin sets it

river oracle
echo basalt
#

because the client's the one sending stuff

#

compare from-to

#

instead of vel

lost matrix
echo basalt
#

world just said "nah"

#

sometimes I have weird issues with worlds

river oracle
#

has he tried asking politely?

echo basalt
#

chunks not sending after reloading the world type deal

lost matrix
sinful rapids
#

ok

lost matrix
#

poor geodude only has 1hp

echo basalt
#

modelengine 👀

lost matrix
#

Right 👍

lost matrix
#

Get into spectator and fly up

arctic moth
#

how would i make one of these things in the recipe book

#

the multiple recipes thing

lost matrix
#

If you register a recipe then it will show up in the recipe book

arctic moth
lost matrix
arctic moth
#

that exists?

sly depot
#
World world = Bukkit.getWorld(strings[1]);
p.teleport(world.getSpawnLocation());

After restarting the server the code doesn't work

#

;-;

lost matrix
#

?notworking

undone axleBOT
#

"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.

sly depot
#

google translate

severe oak
#

Can you give more context?

sly depot
#

strings[1] = map name

severe oak
#

Is an exception thrown when the code is executed? Most likely a NullPointerException

sly depot
#

Bukkit.getWorld(strings[1]) - returns null

lost matrix
#

This just means that the world is not loaded or that the String input was wrong

sly depot
severe oak
#

If its not the default world, you need to load the world yourself.

lost matrix
#

^

severe oak
#

Only the default world is loaded on server startup

#

You need to manually load that desired world

lost matrix
#

The server does only load the default worlds. You need to load them again on every start if you want to keep using them

sly depot
#

How do I do that?

lost matrix
#

The same way you created the worlds. Spigot loads a world if you try to create it but the world folder already exists

quartz solstice
#

Hello, can anyone help me? I am trying to find the 1.19 spigot api shaded jar file

#

I am unable to find it

lost matrix
#

?bootstrap

undone axleBOT
#

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

quartz solstice
#

I don't understand what you are saying

#

Are you saying 1.19 is not released yet?

severe oak
#

They're saying that if you want to use the API shaded jar for your IDE you should use maven.

quartz solstice
#

Ok

#

So I have to create a new project in Maven

#

Then what would I have to do?

lost matrix
#

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.

quartz solstice
#

Ij

#
  • Ok
#

I would prefer to use that tbh

#

Where do I find the folders?

lost matrix
#

Idk im using maven so i dont have to deal with such nonsense.

quartz solstice
#

hmm ok

#

nvm I found it

severe oak
#

let them dig their own hole

quartz solstice
#

Another question

#

Would it be better to switch to Maven?

#

What are the advantages

#

I was told Gradle was faster

remote swallow
#

it is

severe oak
#

Performance doesn't really matter with this though

river oracle
#

the disadvantages are None

lost matrix
quartz solstice
#

hmm

#

I'll consider switching

river oracle
#

also its easier ihmo :P

quartz solstice
#

Ok

#

I

lost matrix
#

For maven you have the special sources plugin for paper you have the userdev plugin.
So
Spigot => maven
Paper => gradle

river oracle
#

or if your a crazy like me Paper => Maven

quartz solstice
lost matrix
#

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)

quartz solstice
#

nms meaning?

lost matrix
#

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.

quartz solstice
#

ok

#

so since im gonna be using paper i think imma stick with gradle

lost matrix
#

For now it doesnt matter. Choose whatever fits you.

quartz solstice
#

Ok

#

Could you or anyone here send me a link for documentation for spigot I can't really find anything

lost matrix
#

I would also use kotlin dsl for gradle. But thats optional.

quartz solstice
#

ye

lost matrix
#

?jd

quartz solstice
#

k

lost matrix
quartz solstice
#

k ty

lost matrix
#

Here is a list of important topics like how to setup an empty plugin and how to create your first commands etc

lost matrix
# quartz solstice k ty

I highly recommend the mcdev plugin for IntelliJ
It lets you generate maven and gradle projects for spigot and paper

quartz solstice
#

How do I get that? (This is my first time using IntelliJ)

river oracle
#

curious as I don't use intellij

lost matrix
#

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.

river oracle
#

Might go through the effort of making this for vscode some day

lost matrix
#

Imagine writing java in vscode

river oracle
#

I can and I'm doing it right now 😈

#

no one can stop me

quartz solstice
#

i've been using vscode since i started coding

#

this is the first time im using something else\

river oracle
#

I tried intellij not my thing 🤷‍♂️ all personal prefference

drowsy helm
#

whats the equivalent of CraftItemStack.asNMSCopy for moj mappings?

#

cant find any method except for the compound tag constructor

river oracle
#

what version

drowsy helm
#

1.19

lost matrix
#

What do you mean? CraftItemStack.asNMSCopy exists in all versions...

river oracle
#

uhm isn't that a craft bukkit thing

drowsy helm
#

yeah thats the nms version

#

not mojang mappings

lost matrix
#

Thats CraftBukkit. It has nothing to do with nms.

river oracle
#

wouldnt you just cast
(CraftItemStack)ItemStack).asNMSCopy

#

should work fine

lost matrix
drowsy helm
#

ah im tripping

#

i can still use CraftItemStack.asNMSCopy

lost matrix
#

Exactly

quartz solstice
#

@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

lost matrix
#

Use the mcdev plugin. It generates you a clean setup.

#

PS: Dont build artifacts. Thats not how you compile in gradle nor maven.

river oracle
#

damn did it change or something?

lost matrix
#

Always has been

river oracle
#

oh lord :|

#

ItemStacks confused me in nms so much

#

glad they are easy with bukkit

lost matrix
#

Usually you are right. CraftBukkit implements Spigot and wraps nms.
So

NmsThing nms = ((CraftThing) Thing).getHandle();
quartz solstice
#

What do depend and soft depend mean? What do I put for both of them

lost matrix
quartz solstice
#

Ok

lost matrix
#

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)

quartz solstice
#

I understand thank you

#

Yay my plugin works!

#

(Like the setup_

#

)

lost matrix
#

Did you compile the empty plugin and tried starting a server with it?
I would start there.

quartz solstice
#

ok

#

So you said something about not using build artifacts?

#

Then how do you compile the code?

lost matrix
#

gradle or maven?

quartz solstice
#

maven

lost matrix
#

Intellij has buttons for that

quartz solstice
#

ok

lost matrix
#

Then the jar should be in your "target" folder

quartz solstice
#

I can't find the "Lifecycle" folder

lost matrix
#

Right side there should be a Maven tab

quaint mantle
#

hey

quartz solstice
#

ok

quaint mantle
#

i got a question

drowsy helm
quaint mantle
#

how can i make tnt firework rockets

#

like when a firework rocket impacts on something it makes an explosion like tnt

quartz solstice
quaint mantle
#

with explosion power but not destroying the area too

drowsy helm
#

check if its a firework, make explosion

quaint mantle
drowsy helm
#

an event

quaint mantle
#

oh i remembered something

#

i dont know how to code

lost matrix
#

lol. Wrong channel then.

quaint mantle
#

could yoy recomend me a program>

#

?

quaint mantle
drowsy helm
#

sounds like a pretty specific plugin, doubt theres anything

quaint mantle
#

yeah i know

#

im searching for like

#

a imploding crossbow like the one from mc dungeons

drowsy helm
#

try asking on ?services

quaint mantle
#

?

drowsy helm
#

its a pretty easy plugin, maybe someone generous enough would make it for oyu

#

?services

undone axleBOT
quaint mantle
#

wait

#

where can i send a video

#

so i can show you what im looking for

drowsy helm
quartz solstice
#

@lost matrix tysm for the help the plugin works!

lost matrix
quartz solstice
#

Idk

#

I have a mc server with some irl friends and I wanna make a plugin for that

#

Maybe like custom items and stuff

lost matrix
#

Start small:

  • Create custom join and quit messages
  • Add bleeding particles when someone hits an entity
quartz solstice
#

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

lost matrix
#

Hint: The event you want to use is the PlayerJoinEvent
And the event has a method called setJoinMessage(String)

quartz solstice
#

hmm

#

So I have to create a eventlistener

quartz solstice
#

@lost matrix i figured out the first one

#

When a player joins it that they joined in chat which includes their ign

lost matrix
#

Alright whats your next plan?

quartz solstice
#

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?

lost matrix
#

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);
quartz solstice
#

hmm

#

so i figured out how to make the entity damage event

#

but how do I check if the entity is a player?

worldly ingot
#

if (entity instanceof Player)

#

Then you've got yourself a player

quartz solstice
#

ok

lost matrix
# quartz solstice but how do I check if the entity is a player?

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

worldly ingot
#

Better yet, you can make the variable in the instanceof as a pattern if you're using modern Java

lost matrix
#

And for the newest versions

    if(attacker instanceof Player attackerPlayer) {
      
    }
worldly ingot
quartz solstice
lost matrix
#

the former

remote swallow
#

former = first

quartz solstice
#

ok

#

lmao i didn't know

fervent robin
#

does anyone know if your allowed to manually obfuscate code?

#

like just make ur code harder to read by hand lmao

lost matrix
#

You should never ever do that. Always strive to make your code easier to read.

fervent robin
lost matrix
#

They will find it anyways. But its not specifically forbidden as long as the staff can still make out what your plugin does.

fervent robin
#

ight thanks

quartz solstice
#

@lost matrix I finished it

#

Do you have any other ideas for what to do

lost matrix
#

Create a furnace recipe that lets you smelt rotten flesh into leather

worldly ingot
drowsy helm
#

finally, got everything synched up.

#

each player is on a different server

lost matrix
quartz solstice
#

ij

#

ij

#

ok

drowsy helm
#

time to get cross-player interaction workin

lost matrix
drowsy helm
#

could you elaborate

#

not sure what you mean

lost matrix
#

One of the servers has to have authority over certain objects or you will end up with horrible duplication bugs and other desync issues.

drowsy helm
#

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

lost matrix
#

And which endpoints do the server proxy?
And how can they be both proxies. Are they in parallel or series?

drowsy helm
#

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

lost matrix
#

Well then the packets are not proxied but merely broadcasted. This might lead to problems but youll get there.

drowsy helm
#

what sort of problems?

#

so far it's pretty robust

lost matrix
#

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.

drowsy helm
#

ah im not going to do damage

#

this is merely for visuals

#

and cross-server trading which won't rely on this system anyway

lost matrix
#

Ah i see

drowsy helm
#

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

quartz solstice
#

@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?

drowsy helm
#

just a key that is attributed to your plugin

#

new NamespacedKey(plugin, "tag");

quartz solstice
#

I don't fully understand the use of it

drowsy helm
#

just think of it as a regular key, it just allows multiple plugins to have the same key name and not interfere with eachother

lost matrix
#

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");
quartz solstice
#

so what would i put as the key

#

just "key"

#

or something else?

lost matrix
#

a descriptive name for your recipe like "rotten-leather-furnace-recipe" for example.

quartz solstice
#

ohhh

#

ok

#

i understand what is it for now

#

what do i put for plugin

lost matrix
#

Everything in minecraft is keyed

quartz solstice
#

hmm ok

#

but what do i put for the plugin input

lost matrix
quartz solstice
#

how?

#

i tried using "this" but it doesn't work

lost matrix
#

By using basic java?

quartz solstice
#

im new to java

#

im a python programmer

river oracle
#

this is equivalent to self

#

they act the same

quartz solstice
#

"this"?

river oracle
#

the this keyword

#

"this" = self

quartz solstice
#

ye

#

but i put it there and it shows a red underline

lost matrix
#

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();
quartz solstice
#

ohh

#

ok

lost matrix
# quartz solstice ok

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);
  }
quartz solstice
#

im still getting an error

#

how do i take a screenshot on windows?

lost matrix
#

ctrl + shift + S

quartz solstice
#

k

#

one ssec

lost matrix
#

But you wont be able to post it here because you didnt verify your spigot account

quartz solstice
#

oh

#

hmm

#

but why wouldn't it be working

river oracle
#

🤷‍♂️ your best verifying and posting the image

#

too many factors to beable to guess

quartz solstice
#

figured it out

crude delta
#

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.

edgy oak
#

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) {
        }

    }
}
lost matrix
#

One tick later

river oracle
#

use a scheduler

#

?scheduler

#

i forgot the command

#
Bukkit#runTaskLater(final Plugin plugin, Runnable task, final int delayInTicks)
shadow zinc
#

uhh so am I meant to register a nexus account or something?

#

if so how do I do that?

lost matrix
#

in your profile

shadow zinc
#

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

lost matrix
#

there is a user settings xml file. Cant quite remember where.

shadow zinc
#

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?

river oracle
#

not your project

shadow zinc
#

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?

hasty obsidian
#

?paste

undone axleBOT
hasty obsidian
#

What is wrong with my code?

shadow zinc
#

?notworking

undone axleBOT
#

"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.

quartz solstice
#

I'm having some issues with referencing the plugin instance in the NamespacedKey can anyone help?

quartz solstice
#

ok

shadow zinc
#

😉

quartz solstice
#

but i have to verify first lol

#

gimme like 5 min

shadow zinc
#

7smoe7 i can't find my settings.xml in my .m2

echo basalt
#

then create one

river oracle
#

create one

#

damn you you beat me to it

shadow zinc
#

like this?

#

also stfu about me using linux

#

im not poor I have windows

#

and I use vim 😉

reef lagoon
#

Did you mean: emacs

shadow zinc
#

no, who do you think I am?

quartz solstice
#

i have no idea why this rule exists

#

it seems so random

granite burrow
#

Bump 😦

echo basalt
#

so you won't have access to instance variables

shadow zinc
echo basalt
#

and/or abstraction

lost matrix
#

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.

echo basalt
#

it makes logical sense given static functions are functions that don't need an instance of a class

vocal cloud
#

Gotta learn java to understand

shadow zinc
#

taco talking the facts

echo basalt
#

and you're trying to call instance-specific methods that might depend on local variables, and/or modified through abstraction

quartz solstice
#

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

echo basalt
#

?di

undone axleBOT
shadow zinc
#

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>```
#

?paste

undone axleBOT
shadow zinc
quaint mantle
#

I can't attach image?

#

🤔

lost matrix
#

validate your acc

quaint mantle
#

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

shadow zinc
#

smile your spigot profile picture is exquisite

shadow zinc
#

?paste might be good

undone axleBOT
quaint mantle
#

oh 😓

#

wait

shadow zinc
#

its fine you're new

quaint mantle
#

done

lost matrix
#

DallE 2

shadow zinc
#

amazing technology

lost matrix
shadow zinc
quaint mantle
#

🤔

#

alternates please

lost matrix
#

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.

quaint mantle
quaint mantle
#

still, how will I manage to get the values

shadow zinc
#

ffs no one told me I needed to download Nexus Repository Manager

lost matrix
quaint mantle
#

Oh sure, Thanks a lot \❤️

lost matrix
#
    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.

lost matrix
#

Why do you need MongoDB?

shadow zinc
#

smile I got no idea what I'm here with nexus

#

Do I need to download the manager?

quaint mantle
#

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

lost matrix
# shadow zinc Do I need to download the manager?

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.

shadow zinc
#

I would like to use jitpack but its impossible if I am using mojang remaps

lost matrix
#

Yeah its not possible then

#

So you need your own repo

shadow zinc
#

which I self host?

lost matrix
#

Well... yes. There are probably some lightweight alternatives.

shadow zinc
#

fuck it I'll just not use remaps

#

actually

#

idk I'll try configure nexus and see what happens

#

its doing something

#

LETS GO

drowsy helm
#

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);

severe oak
drowsy helm
#

does it take meta data into account

severe oak
#

Nope

#

afak, there is no api method to remove itemstacks based on their meta

drowsy helm
#

yeah you're right

#

well thats super annoying

#

wait im dumb

severe oak
#

Yeah, I ran into the same issue when creating my GUI api

drowsy helm
#

i can just set the slot to null

#

lmao

severe oak
#

So true

shadow zinc
#

I finally installed nexus, made my account and setup my pom

#

however

#

errors

#

what should I do?

keen spindle
#

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)

keen spindle
#

that allows users to buy in-game items from the website

shadow zinc
#

so you want to use the buycraft api in your plugin?

keen spindle
#

i made an api in my plugin

#

that does stuff that i need it to (like giving items)

keen spindle
shadow zinc
#

third party stuff sorry

keen spindle
#

hm?

#

as mentioned by another person from here

drowsy helm
keen spindle
#

how?

#

i have seen many other servers have it tho

drowsy helm
#

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…

wet breach
keen spindle
#

like even hypixel

#

has a shop

#

so idk

wet breach
drowsy helm
#

Hypixel adheres to eula

wet breach
#

for the most part

drowsy helm
#

And anyways why dont you use the buycraft plugin

keen spindle
#

can u link me to it

keen spindle
#

so... 🦗

wet breach
#

but just because a large server organization does something, doesn't mean its a good idea to do the same

drowsy helm
#

Not sure if it still works

wet breach
#

large businesses can afford to not follow some rules, especially if those rules are from another business 😛

keen spindle
#

ok ty

drowsy helm
#

Theres a dl link on the tebex site

tawny otter
#

Any Event for when a Sculk Shrieker is activated

icy beacon
visual tide
#

it might be GenericGameEvent with underlying GameEvent.BLOCK_ACTIVATE or GameEvent.SHRIEK but you gotta try it and see

shadow zinc
#

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?

shadow zinc
#

🍆

icy beacon
#

🥒

shadow zinc
icy beacon
#

i suppose

shadow zinc
#

should probably change that then

#

nvm discord found it

amber bronze
#

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

drowsy helm
#

was that ping necessary

shadow zinc
#

wow wow wow don't ping people like that

shadow zinc
amber bronze
#

How can you efficiently check if player is in area

shadow zinc
#

step 1

#
#

then

#

search

amber bronze
#

spigot page is not working for me

#

im stuck on cloudflare thing

brittle loom
#

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.

GitHub

An easy to use library to create player skulls in minecraft - SkullCreator/SkullCreator.java at master · deanveloper/SkullCreator

amber bronze
obsidian drift
#

How can I get the block next to an entity?

obsidian drift
white root
quaint mantle
#

that is single-handedly the most ugly cdn link i've ever seen

white root
#

Yeah, the URL I was using previously expired like last night, and its using a default format rn

brittle loom
# obsidian drift to the right of

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().

white root
cobalt thorn
#

hi a question how i can remove /kill message from the chat? says like "Player fell out of the world"

agile anvil
manic furnace
#

Is there a way to suggest a command when a player clicks an item in the inv?

agile anvil
white root
cobalt thorn
white root
hushed spindle
#

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

cobalt thorn
# white root What are you trying to do ||https://xyproblem.info/||

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

agile anvil
#

If it doesn't work, try to put the event level to low

agile anvil
#

PlayerDeathEvent

cobalt thorn
hushed spindle
#

you can add the item to the dropped items directly

#

no need to add to inventory first

#

try that

cobalt thorn
torn shuttle
#

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?

drowsy helm
#

if its shaded i dont see why not

hushed spindle
#

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?

torn shuttle
#

shading in an api with shaded in apis, I guess I shall be coding in the shade

hushed spindle
#

so if i break a fully grown potatoes crop it returns 1xpotato and 2-5xpotato

mellow pebble
#

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

onyx fjord
#

what packet is used when player opens inventory

hushed spindle
#

why arent you doing for (Player p : players)

drowsy helm
#

Not for each player

hushed spindle
#

my guy

drowsy helm
#

He wrote it out for you lmao

hushed spindle
#

my dear sweet child

mellow pebble
drowsy helm
#

Ah

#

Is it not opening the inv at all

#

Or

mellow pebble
#

but it doesnt set skull item

#

in slots

#

as it should

toxic reef
#

45 isnt a valid size right?

drowsy helm
#

Yes 45 is valid

mellow pebble
drowsy helm
#

Why you using var

fluid river
hushed spindle
#

any multiple of 9 is fine

#

except 0 ofc

noble crown
#

why Bukkit::getOfflinePlayer is deprecated

hushed spindle
#

and up to 54

fluid river
noble crown
#

but it works

#

🤔

fluid river
#

If it's deprecated

toxic reef
#

its deprecated

fluid river
#

It still works

#

most of the time

drowsy helm
#

Deprecated just means it’s outdated

old jay
#

depricated doesn't mean it wont work

drowsy helm
#

Doesnt mean it doesnt work

hushed spindle
#

deprecated just means it might not work consistently and might not work in the future

toxic reef
#

it will be removed in a later version. its a warning

#

or it wont be fixed

fluid river
#

you can use

hushed spindle
#

its no longer supported basically

fluid river
#

getOfflinePlayer(UUID)

#

It's not deprecated

fluid river
fluid river
#

what exactly

hushed spindle
#

var is not a keyword in java

mellow pebble
#

it still doesnt set skull item in slot

hushed spindle
#

but it is in kotlin

fluid river
hushed spindle
#

is it

fluid river
#

java has var since java 13

old jay
#

it do be

fluid river
#

and it's not keyword

#

still

undone axleBOT
drowsy helm
#

Since java 10

fluid river
drowsy helm
#

It’s a keyword for lazy people who dont like strongly typed langs

fluid river
#

removed

hushed spindle
#

ah i see yeah

#

gotta upgrade jdk to get it

fluid river
#

cuz you can declare variable

hushed spindle
#

mb

fluid river
#

var var = 10;

#

and it's gonna work

noble crown
#

thx all

fluid river
#

half-keyword

toxic reef
drowsy helm
#

Strange

mellow pebble
fluid river
#

just added name

mellow pebble
#

there is no

#

Material.PLAYER_HEAD

#

in 1.8.8

toxic reef
#

replace with SKULL

drowsy helm
#

Skull works

#

For it

mellow pebble
#

sure

shadow zinc
#

I need help with my jar file its too fat

fluid river
#

if you apply to job with java don't forget

fluid river
shadow zinc
#

can I upload for you to inspect?

old jay
toxic reef
fluid river
shadow zinc
shadow zinc
fluid river
#

ez

mellow pebble
# toxic reef replace with SKULL
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')
old jay
mellow pebble
#

welp

fluid river
#

javac Class.java

#

for all files

mellow pebble
#

this is an error im getting after adding your code and inventory is not even opening anymore

fluid river
#

ez

mellow pebble
#

it just runs into this error

fluid river
#

and then put folder by folder

#

to rar archive

drowsy helm
fluid river
#

and cast to jar

shadow zinc
drowsy helm
#

oh 1.8

#

lol

shadow zinc
#

1.8-1.19

#

im a beast

fluid river
#

Kyori adventure is most of your plugin's weight

shadow zinc
#

only a bit of nms required

fluid river
#

shaded?

shadow zinc
#

because I need kyori

fluid river
#

I never worked with adventure

#

sry

onyx fjord
#

💀

shadow zinc
#

🩲

onyx fjord
#

is it in maven central?

shadow zinc
onyx fjord
#

adventure i mean

shadow zinc
#

oh

#

idk

onyx fjord
#

if it is you can use spigot lib loading

shadow zinc
#

but I don't use resources because I got to support 1.8

onyx fjord
#

why

shadow zinc
#

because

onyx fjord
#

thats less than 6% servers

#

let em cope

shadow zinc
#

replace servers with todays minorities

#

yeah

#

thats what I thought

onyx fjord
#

except

drowsy helm
#

ahhahahah

onyx fjord
#

servers are DEPRECATED

drowsy helm
#

minecraft servers = minorites

onyx fjord
#

and

#

end of life

shadow zinc
#

1.8 at least

drowsy helm
#

what a strawman

onyx fjord
#

watch this

#

😂

shadow zinc
onyx fjord
#

what the fuck is that example

#

u tryna make me look bad or what

shadow zinc
#

yeah

onyx fjord
#

if (Server instanceof Minority)
-> false

#

there you go

#

take this

shadow zinc
#

I probably dont need commons shaded

onyx fjord
#

common r in spigot iirc

shadow zinc
#

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

kindred valley
onyx fjord
#

java.lang.ClassCastException

shadow zinc
#

hey yo I didn't say anything about Syrians

kindred valley
#

Man the top Minority is Syrians

shadow zinc
#

thats subjective

onyx fjord
#

wanna see my honest reaction?

shadow zinc
onyx fjord
#

metaverse

kindred valley
shadow zinc
#

thats not funny

hybrid spoke
#

you cant be racist when you hate everyone

onyx fjord
#

hate eveyone equally

shadow zinc
#

thats a good philosophy of life

onyx fjord
#

bro hell no

kindred valley
onyx fjord
#

wtf man

shadow zinc
reef lagoon
#

0

kindred valley
#

Chat bro

shadow zinc
#

nah

hybrid spoke
#

imagine talking

shadow zinc
#

why cant we program with our voice?

kindred valley
#

Im not on pc

drowsy helm
#

rate my trade ui

old jay
drowsy helm
shadow zinc
#

i mean they are kinda correct

#

there is a resemblance

onyx fjord
opal juniper
#

how inspiring

kindred valley
onyx fjord
#

what have i done

shadow zinc
old jay
onyx fjord
#

why can i crouch on horse

shadow zinc
#

HR complaint

kindred valley
#

Too dangerous position

onyx fjord
#

realtalk

#

what packet used when player open inv

severe marsh
#

How can I convert this data into ItemStack?

drowsy helm
#

config util will deserialize it for you

drowsy helm
#

wait thats clientbound

#

you want serverbound

#

yeah theres only containre click and close

#

does client even send a packet for open

old jay
onyx fjord
#

i am using a packet wrapper

#

oh

#

i get what u mean

#

it kills mah server 💀

old jay
#

hOw

onyx fjord
#

bruh i trid

#

and nothing shows up

#

like

#

when opening inv

chrome beacon
#

Client doesn't send a packet when opening it's inventory

onyx fjord
#

then how do i check

#

some event?

agile anvil
#

There is no way

chrome beacon
#

The server doesn't know that the inventory is open

onyx fjord
#

bruh

#

to avoid XY

#

my goal is to make player not see armor

#

but see the armor items in inventoy

chrome beacon
#

Don't think that's possible without a mod

drowsy helm
#

Yeha dont think it’s possible

onyx fjord
#

dang

#

well

#

at least player can click tha invisible slot

#

but experience sux

drowsy helm
#

You can maybe send packets to hide the armour

#

Or rather, intercept the equipment packet

onyx fjord
#

but i need 2 know when

chrome beacon
#

You can just hide it for other players

onyx fjord
#

ye

#

i do that already

chrome beacon
#

Does it really matter if you can see your own armor

onyx fjord
#

fine ig

#

realtalk tho

#

why is horse gui so delayed

#

don tell me its server side

drowsy helm
#

Is it?

onyx fjord
#

theres like a big delay

drowsy helm
#

Never noticed

onyx fjord
#

its very noticable on wynncraft

#

or any server where you have 100+ ping

drowsy helm
#

Id assume it’s server side

#

Since the horse inv isnt client side

quiet ice
#

Could also be the proxy

fervent gate
#

Does spawning a mob and then changing something in it's pdc work?

onyx garden
#

Dear Spigot team.
Have you got an discord bot to verify payed plugins in discord channels?

quaint mantle
#

is there a way to get who executed a command?

iron glade
#

what?

#

CommandSender

quaint mantle
#

thanks

late drum
#

@tender forge bru power ranks and multivers core plugins are not working in aternos

young knoll
young knoll
#

Also

#

?notworking

undone axleBOT
#

"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.

white root
#

Client and server version are 1.19

young knoll
#

You can’t use ChatColor directly in components like that

#

Unless you use TextComponent.fromLegacyText

white root
# young knoll You can’t use ChatColor directly in components like that

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

young knoll
#

Same way you do it there

#

fromLegacyText will return a component

white root
young knoll
#

Ah right it returns an array

#

You’d have to join them all together

onyx fjord
#

i need EnchantmentTarget.TOOL but only for pickaxes, what shouild i do?

#

shalli do includes?

safe hatch
#

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

agile anvil
onyx fjord
#

or cancel event 💀

#

there is one for swimming and gliding

young knoll
#

Don’t work if they aren’t in the air/water

thorny marsh
#

hey how can i create a shield that shows the player's name?

white root
slate mortar
young knoll
quaint mantle
#
                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
sacred mountain
#

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

vital sandal
#

how can i change armor stand head rotation ?

remote swallow
vital sandal
#

i already tried that but the head doesnt

quaint mantle
#

wait I do

#
@Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
slate mortar
# thorny marsh Sorry i mean a sign

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");
quaint mantle
#

do I just use this?

(Player)sender).getDisplayName()```
remote swallow
#

that works

quaint mantle
#

who u talking to

slate mortar
quaint mantle
#

me or Dev or Chloe

remote swallow
slate mortar
sacred mountain
#

cry

#

is there ways around it other than manually

slate mortar
#

i don't think so

quaint mantle
#

?

sacred mountain
#

material.isAir() removes the air blocks, isItem() removes the ones that cant get in ur inventory, and thats about all i have so far

red sedge
#

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

sacred mountain
slate mortar
#

make a list of unobtainable items and use that

#

only way i think

sacred mountain
#

theres so many tho

#

oh well

slate mortar
#

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

quaint mantle
thorny marsh
quaint mantle
#
                player.sendMessage(((Player)sender).getName() + "§egave you a§e §cDctr's Space Helmet§c (§e001)§e!");
sacred mountain
#

its just the annoying stuff like this