#help-development

1 messages · Page 2111 of 1

golden turret
#

see the code behing the class

#

i dont remember now

manic delta
#

🤨

civic apex
#

Im getting this Cannot invoke "org.bukkit.block.BlockFace.getOppositeFace()" because "this.mainFace" is null exception when constructing a new BlockIterator but Im not able to identify exactly when its going to be thrown

at org.bukkit.util.BlockIterator.<init>(BlockIterator.java:139) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]

golden turret
#

i think it is

#

name and the message

manic delta
#

yes i know but isn't working

golden turret
#

the defualt one is <%s>: %s

#

what is not working

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.

manic delta
#

i mean

#

the code what i do is working

#

but when i type one % in the chat

#

it breaks the format

golden turret
#

bruh

hybrid spoke
#

thats normal

golden turret
#

cancel the event

hybrid spoke
#

just replace it

civic apex
#

i expect it to properly instantiate a new BlockIterator object but its not, it sometimes happens it sometimes doesn't

golden turret
#

and send message to everyone

manic delta
#

bukkit.broadcastMessage?

golden turret
#

nop

#

e.getRexipients

manic delta
#

oh wait i forgot how is it

#

a

golden turret
#

or something like this

manic delta
#

why

solid jungle
#
package samplepluginspigot.samplepluginspigot;

import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;


public final class SamplePluginSpigot extends JavaPlugin {

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {

        if (sender instanceof Player) {

            Player player = (Player) sender;

            if(args[0].equalsIgnoreCase("hello")){
                player.sendMessage("Hello There");
            }

        }

        return false;
    }

}

I made this plugin which just sends a message to the player when they do /hello and i wondering if i did it correctly? ( Btw there are no errors )

golden turret
#

because it will get all recipients

manic delta
#

and?

golden turret
#

then you can send the message to them

#

using sendMessage

manic delta
#

but ijust can send the message as server

golden turret
#

it would no be good

manic delta
#

why

golden turret
civic apex
solid jungle
golden turret
spiral aurora
solid jungle
golden turret
#

they have a chst filter now

spiral aurora
#

use that

solid jungle
civic apex
#

then remove the arg check unless you want it to trigger on /hello hello

solid jungle
#

ah k

#

thank you for the advice/help

manic delta
golden turret
#

yes

#

but in that chase

#

you would not need to replace

solid jungle
manic delta
#

uh

#

ok

golden turret
#

just

golden turret
#

name + e.getMessage

#

is good

manic delta
#

i need to put the

#

set cancelled before or

#

after the for

solid jungle
golden turret
#

dont matters

manic delta
#

o

#

okay

golden turret
#

as long you cancel it

manic delta
#

done

upper mica
#

Hello, what packet is sent when player does riptide boost in water? I can't seem to find in Protocollib client's packet type category. I know (from what I found on google?) it's sent out to other players as entity metadata, there is a byte field Is in riptide spin attack, but how does server know when player tries trident boost from water? There isn't much on google about this. What I want is to cancel that packet, basically change boost behaviour.

manic delta
#

👍

golden turret
#

when i get home i will let you know

upper mica
golden turret
#

yes

#

i think i sent it here a time ago

#

try to search here

#

yes

#

.

#

@upper mica

#

1.17

upper mica
#

well ty!

golden turret
#

👍

#

see if it is calla
ed for tridents

manic delta
#

how can i get the block that the player is seeing?

#

with player.getEyeLocation().getBlock() ?

quartz valve
#

How to spawn a MushroomCow?

MushroomCow cow = (MushroomCow) loc.getWorld().spawnEntity(loc, EntityType.MUSHROOM_COW);     <- Error Line
cow.setCustomName("§7§oAlfred");
cow.setCustomNameVisible(true);

Error:

java.lang.IllegalArgumentException: Location or entity class cannot be null
#

Yeah but none of them is clear

eternal night
#

I mean EntityType.MUSHROOM_COW is definitely not null

noble lantern
#

@manic delta

echo basalt
#

location isn't null given that you call getWorld

noble lantern
#

You can just put %s first time is display name, second time is message

echo basalt
#

try calling spawn(loc, MushroomCow.class)

quartz valve
#

Okay

noble lantern
#

It will automatically be parsed, no need for the other 2 arguments

golden turret
manic delta
#

or get that

golden turret
#

or multiple the location with the getDirection for 3 times

#

wait

#

getTargetBlock

#

better

#

LivingEntoty#getTargetBlock

sterile token
#

Wizard ho do you told me to calculate if moving, to right left, etc?

golden turret
#

or something like this

sterile token
sterile token
#
  • PlayerMoveEvent
  • get facing block
  • difference between to and from

Algoritm:

  • if player facing north and the block is west = pressed a
#

But then im stuck with the nexts

golden turret
#

just check the difference between xs

#

zs

manic delta
golden turret
#

wdym

#

aa

#

?jd-s

undone axleBOT
golden turret
#

let me see

manic delta
echo basalt
river oracle
#

Girgleb

golden turret
manic delta
#

yes

#

Set<Material>

echo basalt
#

damn man has battery on his phone

golden turret
#

you can use null

sterile token
manic delta
#

but i want to summon one thunder

#

where player is looking

quartz valve
echo basalt
golden turret
#

getTargetBlockExact is better @manic delta

echo basalt
#

so you do some funky stuff to remove the yaw from the equation, then do your checks

manic delta
#

ok

golden turret
#

then use the int for the max distance

manic delta
#

oh sure

#

yes

#

ty

golden turret
#

👍

sterile token
echo basalt
#

the velocities are going to be in a single axis

#

tbh you can probably just

#

velocity.rotateAroundY(-yaw)

#

+Z should be north

sterile token
#

Oh im really dumb lmao

noble lantern
manic delta
#

okay

sterile token
echo basalt
#

just use the Y level for that

sterile token
manic delta
echo basalt
#

uh ok whatev

manic delta
#

like this?

#

i put the first %s on name variable

sterile token
#

I think that "%s" can only be used when doing:

String.format("text here with var %s", "var content")

brave sparrow
#

No that’s a placeholder api thing

hardy swan
#

lol

manic delta
brave sparrow
#

String format uses similar syntax

hardy swan
#

go to PAPI github for guide

manic delta
#

wym

#

xd

brave sparrow
#

Wait what are you trying to do

manic delta
#

i mean

brave sparrow
#

Lol

manic delta
#

implement the papi thing to

#

event.setFormat()

brave sparrow
#

What do you think that code is doing

manic delta
#

Replacing the color of %s (That should be the player name) to &7 color and add the vault prefix before

brave sparrow
#

event.setFormat needs two %s

manic delta
#

or i want to do that

#

yes

brave sparrow
#

The first one is the name, the second is the message

manic delta
#

i put the first one on name variable

brave sparrow
#

I see

#

That seems like it should work for you then

manic delta
#

yes i will try later im doing something more now

tardy delta
#

look at the implementation

manic delta
#

wym

brave sparrow
#

Seems like he did it correctly

#

Assuming his placeholder api stuff is correct

tardy delta
#

assuming this is asuncplayerchat event

brave sparrow
#

Yeah

manic delta
#

it is

#

obv

tardy delta
#

just decompile it and see how the format works

brave sparrow
#

That is how it works

#

Lol

#

First %s is the player name, second %s is the message

upper mica
tardy delta
#

discord just froze lol

upper mica
#

lmao

tardy delta
#

messages came in all at once

spiral aurora
#
public class VillagerInfectEvent implements Listener {
    @EventHandler
    public void onInfected(EntityDamageByEntityEvent ed){
        Entity e = ed.getEntity();
        if(e instanceof Villager){
            Villager vill = (Villager)e;
            if(vill.isDead() &&ed.getDamager() instanceof Zombie){
                vill.zombify();
            }
        }
    }
}
#

hm this doesnt work

#

(trying to convert into zombie villager on any difficulty btw)

brave sparrow
#

Villager is not going to be dead on the entity damage event ever

echo basalt
#

it could be declared dead on the following tick ^

#

but not yet

brave sparrow
#

Yeah

fading lake
brave sparrow
#

Definitely would not do next tick

echo basalt
#

scheduler to the next tick is dumb

brave sparrow
#

Use the damage value

echo basalt
#

health - event.getFinalDamage() <= 0

brave sparrow
#

Nah

echo basalt
#

zombify spawns a new entity

brave sparrow
#

^

golden turret
#

cancel the PlayerInteractEvent

upper mica
golden turret
#

yes thats the idea

#

you cancel the event

#

but

#

the client still will send the packet

crude loom
#

If I take a list from a config and make modifications to it, will it change the list in the config? (I mean the config that is in the jar and not saved yet to the server)

hybrid spoke
smoky adder
#

Hi I was trying to get a string using a method that comes from main ie getSpawnConfig
so in the event class I used main.getSpawnConfig.getstring ("test"); to set a join message but gives an error when the player enters the server I think it's the fault of the custom file .yml

undone axleBOT
golden turret
#

what is the error

upper mica
smoky adder
restive tangle
#

I have an API interface in the api package, should I add the implementation there too?

io.github.quzacks:
  api:
    IPlayerDataRegistry
  core_kits:
    packages:
      OtherThings
    CoreKits
#

So it would be

io.github.quzacks:
  api:
    IPlayerDataRegistry
    PlayerDataRegistry
hasty prawn
#

Well if you do that why would you need the interface anyways

#

The whole point of using Interfaces like that is to hide the implementations

restive tangle
#

Some guy told me it's better since it makes the implementation more "robust", just went with it

golden turret
crisp steeple
smoky adder
#

ok

upper mica
golden turret
#

show your code

upper mica
#
    @Override
    public void onEnable() {
        Bukkit.getPluginManager().registerEvents(new Listener() {
            @EventHandler
            public void onInteract(PlayerInteractEvent event) {
                if (event.getPlayer().getName().equals("ItsTauTvyDas") && event.getPlayer().getInventory().getItemInMainHand().getType() == Material.TRIDENT) {
                    event.getPlayer().sendMessage("Interaction cancelled.");
                    event.setCancelled(true);
                }
            }
        }, this);
        
        ProtocolLibrary.getProtocolManager().addPacketListener(new PacketAdapter(this, ListenerPriority.HIGHEST, PacketType.Play.Client.BLOCK_DIG) {
            @Override
            public void onPacketReceiving(PacketEvent event) {
                Player player = event.getPlayer();
                Object handle = event.getPacket().getHandle();
                
                if (!player.getName().equals("ItsTauTvyDas"))
                    return;
                
                
                if (!(handle instanceof PacketPlayInBlockDig))
                    return;
                
                PacketPlayInBlockDig.EnumPlayerDigType type = ((PacketPlayInBlockDig) handle).d();
                if (type != PacketPlayInBlockDig.EnumPlayerDigType.f)
                    return;
                
                if (player.getInventory().getItemInMainHand().getType() != Material.TRIDENT)
                    return;
                
                player.sendMessage(event.getPacketType().name());
                
                event.setCancelled(true);
                
                //boostPlayer(player);
            }
        });
    }
echo basalt
#

you don't need that nms check for protocollib

#

you can use the wrapped packet

#

sure the checks may be handled server-side but the client still does predictions

tardy delta
#

i dont think you want to do that in your onenable

echo basalt
#

such predictions may be items floating up, blocks being broken/placed for 1 tick

golden turret
manic furnace
#

For some reason my project in intelij is corrupted. It can't find the libraries, the src folder and the resource folder isn't set anymore. I looked at my project file and it is nearly empty.

<?xml version="1.0" encoding="UTF-8"?>
<module version="4">
  <component name="FacetManager">
    <facet type="minecraft" name="Minecraft">
      <configuration>
        <autoDetectTypes>
          <platformType>SPIGOT</platformType>
        </autoDetectTypes>
      </configuration>
    </facet>
  </component>
</module>
upper mica
upper mica
faint harbor
#

Hey, I'm trying to set the players health on respawn but I cant seem get it working. Using player.setHealth(double) on both PlayerRespawnEvent and EntitySpawnEvent both seem to do nothing. Is there something that I'm missing, or is it just not possible without some sort of delay with a runnable

manic furnace
tardy delta
#

delay it?

#

got ninjad smh

crisp steeple
#

do not delay it !!!

zealous osprey
#

XD

hasty prawn
tardy delta
#

this happens every time

grand perch
manic furnace
#

no thing

crisp steeple
# hasty prawn Why

because then you don’t have the proper stats for however many ticks it takes

manic furnace
#

i updated my intelij

crisp steeple
#

fixing things by delaying it a bit should only be done for something not essential to gameplay

hasty prawn
#

It's definitely fine to delay by a tick.

#

Especially since there's basically no other option there.

smoky adder
crisp steeple
#

it is not

#

i have found many dupes on many different servers just because they wait just a tick or few to do something

echo basalt
tardy delta
#

i guess the message not being set

smoky adder
hasty prawn
zealous osprey
golden turret
#

one of them may work

timid quail
#

what is the easiest way to do something like this:

do something
wait x seconds
do something
wait x seconds
do something
wait x seconds
do something
wait x seconds
do something
wait x seconds
do something
hasty prawn
#

?scheduling

undone axleBOT
crisp steeple
#

people don’t seem to understand how many things you can do in one tick

smoky adder
hasty prawn
#

I never said that's a solution for everything, and I'm aware that it can cause issues. For them specifically though, there's absolutely nothing wrong with it. If you have another way to solve their issue, do explain.

zealous osprey
crisp steeple
timid quail
tardy delta
#

nested scheduling things

#

i would do that atleast

zealous osprey
zealous osprey
crisp steeple
# zealous osprey Add an event for plaer logging on

adding random event listeners for things that shouldn’t be a problem in the first place… not to mention trying to set the health would probably cause an exception and mess up anything else that was trying to take place

hasty prawn
#

If this is so problematic I really would like to hear your other solution that doesn't cause any of this.

crisp steeple
zealous osprey
#

We should probably stop this discussion and come to the concenses that people have different ways of solving issues.
In addition sheduling always needs careful consideration of possible sideeffects.
That was never something put into question

upper mica
crisp steeple
#

you can do it however you want, just don’t say i didn’t warn you when someone with a client logs on and breaks the entire game system

zealous osprey
#

._.

cursive falcon
#

https://imgur.com/2o8qJj3.png I'm configuring a plugin and I'd like to know if I can add a tag that only adds the effect if all the armor is equiped

#

itemtag:effects_list_full_set: SLOW,1,true,true

#

something like that

#

Or add the effects

For example if I want haste 4 do that the helmet gives you haste 1, the chestplate 2, leggings 3...

midnight shore
#

Hi! I know it’s not possible for listening to keys other than F. But does the client send something to the server whenever you press some keys on your keyboard?

#

Just for knowledge

tardy delta
#

wondering if this is a jdk or just eclipse?

eternal night
#

that is a jdk

#

termurin is what you use instead of adopt open jdk these days

tardy delta
#

ah java 16

#

aight

restive tangle
#

I'm going to make an API for a plugin, it's a kit PVP plugin and I just want to create it so that it returns a PlayerData class. I don't care about hiding the implementation since it'll be a private plugin so how do you think I should structure it?

eternal needle
#

hi i wonder how do i make so my plugin do a command in console

last ledge
zealous osprey
#

I have a question concerning Vault and mabe someone could help ?
I am not very familiar with Vault and am trying to setup a system where I can get the balance of something that isn't an OfflinePlayer, but rather a town/faction/group or similar.
How would one do so ?
I tried using an ID for the group, but the Economy#getBalance(String) is deprecated.
The only "right" thing there is is Economy#getBalance(OfflinePlayer), but I don't have one...
So maybe someone could give some advice, a nudge in the right direction.
Would be greatly appreciated, thanks :D

zealous osprey
glossy venture
#

maybe create a custom OfflinePlayer implementation with just a getName(), getUniqueId() and whatever else it needs

#

call it like VirtualGroupPlayer or something

restive tangle
#

I want to create a folder inside the data folder of my plugin to store data. So plugins/plugin-name/file-name/ If I wanted to do that would I do this?

        file = new File(plugin.getDataFolder().getAbsolutePath() + File.separator + "players", player.getUniqueId().toString() + ".yml");
zealous osprey
glossy venture
#

due to the way vault is (appereantly) implemented, i think this is the only way

restive tangle
#

Would getAbsolutePath for the data folder return plugins/plugin-name ?

tardy delta
#

you can just put the datafolder in there instead of the name

#

and then player + file separator + uuid .yml

#

ye

steel swan
#

hey, i m trying to add an API to my project but it doesnt seem to be working.
this is the ghithub : https://github.com/Janmm14/JsonMessageMaker

my code (in pom.xml)
i added :

<dependency>
            <groupId>de.janmm14</groupId>
            <artifactId>jsonmessagemaker</artifactId>
            <version>3.2.2</version>
            <scope>provided</scope>
        </dependency>

and

<repository>
                <id>janmm14-public</id>
                <url>https://repo.janmm14.de/artifactory/public/</url>
            </repository>

i also checked, the version is the right one :

GitHub

API for easy string to fancy minecraft json message - GitHub - Janmm14/JsonMessageMaker: API for easy string to fancy minecraft json message

tardy delta
#

did you try mvn reload?

restive tangle
tardy delta
#

new File(plugin.getdatafolder, "player" + file.separator + uuid.toString + ".yml")

steel swan
#

thx anyway

restive tangle
#

Oh, so it appends it

#

Cool

tardy delta
#

the first argument is the parent file

#

a folder is considered being a file too in java

restive tangle
#

No, I want it to be in the players/ folder inside plugin-name

#

Nevermind, just had a brain fart

shrewd sentinel
#

I spawn custom mobs and then I just leave the world and come back some time later and the path finder goals seem to be resetted

eternal needle
last ledge
ornate heart
#

How would you go about making a player fly in a boat?

eternal needle
midnight shore
#

Bukkit.dispatchCommand(Bukkit.getConsoleSender(), “command without the slash”);

#

There’s no reason it shouldn’t work . Either you don’t call that part of the code or the command doesn’t exist

steel swan
#

hey so i have this code :

if (command.getName().equalsIgnoreCase("gang")) {

            if (Objects.equals(args[0], "invite")){
                if (getjobs(playerSender) == Job.PARRAIN) {
                    Player argumentOne = Bukkit.getPlayer(args[1]);
                    assert argumentOne != null;
                    TextComponent message = new TextComponent("Would you like to join ?");
                    
                }else{
                    onError(playerSender);
                }
            }
}

but when i run it, i have this error :
TextComponent(java.lang.String) is not public in java.awt.TextComponent; cannot be accessed from outside package

worn tundra
#

Wrong import?

tardy delta
#

please

worn tundra
tardy delta
#

if that will compile it wont work without errors

#

check the length of the args and use String#equals instead of causing an out of bounds exception

steel swan
#

thats not the whole code

#

thats just the part thats making it bug

tardy delta
#

handle cases where the player is not found too

steel swan
#

ofc i check if its a plyer, if its right etc

tardy delta
#

well still

#

wrong import lol

#

its not the awt

steel swan
#

nvm

#

fixed it yeah it was a wrong import

#

thx

smoky adder
tardy delta
#

lol what

worn tundra
#

Ohh I see

tardy delta
#

npr for the quit string probs

smoky adder
#

plugin.getConfig work

#

but main.getSpawnConfig doesn't work

worn tundra
#

What's on line 20 in Eventi

smoky adder
#

wait

#

nothing

tardy delta
#

do you ever initialize the main variable

smoky adder
#

how can i solve?

tardy delta
#

how is java supposed to know what main points to?

crisp steeple
#

it uses its artificial intelligence neural network of course

worn tundra
#

it just knows

smoky adder
#

I don't know how to program well yet but I created the getSpawnConfig in the main and reported it on the event class does not give any error on intelj

crisp steeple
#

that is because it is a runtime exception

#

not a compile time

smoky adder
#

you can solve the problem, I don't understand English well too ...

#

?

crisp steeple
#

i have no clue why you are doing Plugin plugin = Main.getPlugin(Main.class);

#

?di

undone axleBOT
worn tundra
crisp steeple
worn tundra
#

my mom

crisp steeple
#

ok

smoky adder
smoky adder
crisp steeple
#

you need to pass the main instance into the eventi class

#

something like

#
public Eventi(Main main){
    this.main = main;
}
smoky adder
#

ok I try and let you know

crisp steeple
#

ok

tardy delta
#

the problem is that main is null

smoky adder
#

the word "main" remains red ...

tardy delta
#

and youre basically having your plugin instance twice bcs of those two fields

smoky adder
#

could you solve the problem so that I can see the code please (sorry for the inconvenience)

#

?

worn tundra
#

Try that

#

and fix errors

#

wasn't doing that in an editor

tardy delta
#

?amin smh

#

?main

worn tundra
#

:P

river oracle
#

Amin

worn tundra
#

Amen

river oracle
#

Main class named main smh

worn tundra
#

Let my man have a break

#

they just coding a little join quit plugin

smoky adder
tardy delta
#

well read it and it kinda makes sense

smoky adder
worn tundra
#

had to learn not to have two plugins with main classes called "Main" the hard way

river oracle
#

Aha

smoky adder
#

i don't understand sorry

worn tundra
river oracle
#

As long as your other plugins don't follow this practice no issues should occur

torn shuttle
#

of course you shouldn't call your main class "Main" you dumdum

#

you need to index them

#

so Main0, Main1, Main2, Main3

#

and remember that utility classes are negatively indexed so Main-1, Main-2, Main-3

#

also remember to name your methods by picking 5 pi digits sequentially in the class

ancient plank
#

Main[] mainArray = new Main;

smoky adder
#

'Eventi(me.dragon.rcjoin.Main)' in 'me.dragon.rcjoin.Eventi' cannot be applied to '()' onother error

torn shuttle
#

surely you mean main.main.main.Main0

sleek pond
celest nacelle
#

Not sure if this is the right server for bungee plugin development however I was wondering, how do I get the ip of a connecting player from the net.md_5.bungee.api.connection.PendingConnection class

tardy delta
torn shuttle
#

fun fact my plugin celebrates 5 years today

#

how time flies when you're creating and then fixing bugs

ancient plank
#

how time flies when you're making quests

torn shuttle
tardy delta
torn shuttle
#

ah understandable have a nice day

ancient plank
#

ty u 2

torn shuttle
#

making low poly unity games is quite fun

#

really cute when stuff starts to visually come together

ember estuary
#

Is it a problem to have tons of scheduleSyncDelayedTasks ?
like 100 at once?

tardy delta
#

depends on what they re doing

ember estuary
#

removing a block after a second

torn shuttle
#

I literally have thousands of them up at a time sometimes

tardy delta
#

probably not

ember estuary
#

alright

torn shuttle
#

it's fine

#

just keep in mind async can get backed up

tardy delta
#

BRUHHH

#

i pressed esc while copying 8 gigs of data

torn shuttle
#

like if some giga5brain plugin decides to start requesting every head skin ever from mojang

tardy delta
#

i hate my life

worn tundra
#

at me.dragon.rcjoin.Eventi.onJoin(Eventi.java:26) ~[?:?]

torn shuttle
worn tundra
#

What's on line 26

rain grove
#

Is there a function to visually see the chunk you're on?

smoky adder
torn shuttle
worn tundra
torn shuttle
torn shuttle
#

?learnjava

undone axleBOT
rain grove
torn shuttle
#

unless you go extremely sparse odds are you will lag a client out trying to render the required volume of particles

smoky adder
rain grove
worn tundra
#

What worked? Wasn't there an error with your old code?

torn shuttle
worn tundra
#

From main and eventi

torn shuttle
#

at least I think that's how they did it, I never looked into it myself

smoky adder
smoky adder
worn tundra
smoky adder
tardy delta
#

i found a very good site

smoky adder
tardy delta
torn shuttle
#

this is just creating a cargo cult approach to making a plugin

tardy delta
#

lemme see

torn shuttle
#

I hate that website

tardy delta
#

what

smoky adder
worn tundra
smoky adder
#

where??

#

ok you fix this thank you very much

left swift
#

Is there any way to deplooy jar to multiple folders using sftp? (intellij deploy tool). Currently I deploy my jar to one folder.

midnight shore
smoky adder
#

si

midnight shore
#

Bella

smoky adder
#

Bella ahah forsi mi prendono per il culo

#

forse*

#

lol

midnight shore
#

Ahah

smoky adder
#

come faccio a vedere se un player ha 2 permessi ? tipo if (p.hasPermission("prova") || ("prova1")){}

#

?

midnight shore
#

Devi fare if p.hasPermission(“uno”) || p.hasPermission(“due”){}

smoky adder
#

ok grazie

midnight shore
#

👍🏻

slow burrow
#

Is there anyway to instantiate all classes that extend a base class

midnight shore
#

I don’t think so. You can either put all of that information inside an Hashmap or a List or either I think reflection can help, but in that case I can’t help you

smoky adder
#

Voglio fare tipo che se un player ha il permesso join.owner il messaggio di join cambia se un player ha il permesso join.utente allora il messaggio sarà un altro, pero se un player ha l'op avra tutti e due i permessi quindi si sminchia tutto ci sarebbe un metodo ?

midnight shore
#

Se ha l’op puoi verificarlo con il permesso *

smoky adder
#

gia ho fatto una bozza ma c'è sto problema

smoky adder
restive tangle
#

Maven is not properly shading all the dependencies, I don't know why it does this. It used to work fine before

    <groupId>io.github.quzacks</groupId>
    <artifactId>CoreKits</artifactId>
    <version>1.0.0</version>

    <properties>
        <maven.compiler.source>16</maven.compiler.source>
        <maven.compiler.target>16</maven.compiler.target>
    </properties>

    <repositories>
        <repository>
            <id>papermc</id>
            <url>https://papermc.io/repo/repository/maven-public/</url>
        </repository>
    </repositories>

    <dependencies>
        <dependency>
            <groupId>com.destroystokyo.paper</groupId>
            <artifactId>paper-api</artifactId>
            <version>1.16.5-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>1.18.24</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>
#

?paste

undone axleBOT
midnight shore
restive tangle
#

Maven is not properly shading all the dependencies, I don't know why it does this. It used to work fine before

midnight shore
#

Sorry I’m not really good at Maven… so instead of probably saying something wrong I let someone else help you

eternal oxide
echo basalt
#

lombok likes to bug my gradle

#

"failed to clean up stale outputs" after I install it

slow burrow
#
Set<Class<? extends BaseItem>> classes = reflections.getSubTypesOf(BaseItem.class);
        try {
            for (Class<? extends BaseItem> clazz : classes) {
                clazz.getConstructor().newInstance();
            }
        } catch (InstantiationException | IllegalAccessException | InvocationTargetException | NoSuchMethodException e) {
            e.printStackTrace();
            getServer().getPluginManager().disablePlugin(this);
        }```
the exception is

java.lang.IllegalArgumentException: wrong number of arguments
at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:?]
at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77) ~[?:?]
at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:?]
at java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499) ~[?:?]
at java.lang.reflect.Constructor.newInstance(Constructor.java:480) ~[?:?]```

#

I dunno anything about reflection tbh

chrome beacon
#

I mean it tells you what the issue is

#

You need to give it the arguments of the constructor

slow burrow
chrome beacon
#

You sure

slow burrow
#
public BaseItem() {
        System.out.println("Hey?");
    }

very much so

chrome beacon
#

Try getDeclaredConstructor()

unique spindle
#

Do any of you know if/when Mojang will require java 18 for Minecraft?

chrome beacon
#

I'd expect them to stay on 17 since it's LTS

#

Anything new you need on 18?

slow burrow
hollow sand
#

anyone know any sources where I can find about CustomMobAi?

#

for 1.8.8

echo basalt
#

well

#

it's the same for all version

#

pathfindergoals

#

just look at any nms mob class like EntityZombie

#

and how it uses multiple pathfinder goals

#

and make your own

#

then you can use reflections to access its pathfinder goals, or extend the class entirely for more control

#

@hollow sand

hollow sand
#

hm

#

I see

#

well

#

ig I'll try

#

thanks

pastel juniper
#

Can sb tell me what is PluginInstance

hollow sand
pastel juniper
#

I get this

undone axleBOT
quaint mantle
#

@last temple i like you

#

straight to the point

#

we wouldve had the same answer

#

i didnt mean it like that but ok

#

..

hollow sand
#

or mob

echo basalt
#

look at the constructor

#

and look at how NMS calls it

hollow sand
#

custom mob ai 👍

#

thats for later

#

loc.getWorld()

echo basalt
zenith saddle
#

I am trying to make blocks that disappear and have a yml config file. In the file I store the block that disappears, and how long until it disappears. I want to create an item stack with these values (The time until it disappears is in the lore). How do I do this? I have a get, setup, reload, and save method for the yml in a class called customConfig. (P.S. I started Java 72hrs Ago.)

echo basalt
#

man's timing his java career

glossy venture
zenith saddle
#

Only one block

hollow sand
zenith saddle
#

Chosen at a time

echo basalt
#

literally what I did

glossy venture
# zenith saddle Chosen at a time

choose a block, create an item stack, make the lore, set the lore on the ItemMeta using itemMeta.setLore(List<String>) gotten from itemStack.getItemMeta() and then set the item meta back using itemStack.setItemMeta(meta)

#

then do whatever you want with that item stack

hollow sand
#

Sorry, I'm a slow learner

zenith saddle
glossy venture
#

since Material is an enum, use Material.valueOf()

#

or nevermind use Material.getMaterial()

left swift
#

What will be better way to catch plugin messages on proxy (from spigot) and spigot (from proxy) and handle it? Make one plugin message listener and use switch case block, or make separated listener for each one subchannel?

echo basalt
zenith saddle
#

Here Is it value of worked best.

echo basalt
#

legit just middle-click an NMS entity class and look at the constructor

#

NMS entity classes follow the following naming scheme: Entity<mobtype>

#

EntityZombie, EntitySkeleton

#

EntityBlaze

#

just look at the constructor and replicate it

left swift
echo basalt
#

make packets through messages

#

you're transmitting binary data

#

a huge if / case block will be a ugly solution

#

also bungee messaging is kinda bad as it uses the client's socket to communicate instance<->proxy

#

and if there are no players online, the instance can't receive messages

pastel juniper
#

Still get errors

undone axleBOT
noble lantern
#

because getPlugin() requires a string

arctic moth
visual tide
#

essentialmod

#

cringe

glossy venture
arctic moth
zenith saddle
#

well the mouataintan is no longer there...

#

no

arctic moth
zenith saddle
midnight shore
#

Hi! is the playSound method creating the sound for everyone near the player's location or is it like a packet, so the sound will only play to the specified player?

arctic moth
midnight shore
arctic moth
#

player.playSound is packet

#

and i think theres a world.playSound

zenith saddle
midnight shore
#

so it is packet based

#

ty

arctic moth
#

should i make that an actual thign

zenith saddle
#

yes totally

#

in the lore of the Item:

#

Legend has it It once translocated a mouaintan in to non-existance

arctic moth
#

public class Class extends Class

#

lol

red sedge
#

Are there any disadvantages to a builder pattern?

#

if so what?

quaint mantle
#

no

zenith saddle
#

If I had an ItemStack with 1 Item in it, can I have a command give multiple of that item?

red sedge
arctic moth
#

translocated a hole

zenith saddle
quaint mantle
arctic moth
#

anyone elses test server look like this lol

#

and thats after world reset

hybrid spoke
#

mine is full of crops

red sedge
arctic moth
quaint mantle
#

"or something else"

arctic moth
#

all i did was yeet a ton of falling blocks

quaint mantle
#

np

arctic moth
#

it stays after relogging, so its serverside smh

quaint mantle
#

tf did you do

glossy venture
#

test server

arctic moth
#

not a sky world tho

glossy venture
#

mine is superflat

#

i made huge voidi

#

lmao

#

also this is epic

#

did it crash?

#

lmfoao

granite owl
#

is it possible to create a true false dialog field when requesting a connection to the server but before actually transfering map data(joining)?

glossy venture
#

i get this every time i load my server

#

for some reason

#

some corrupted item stack or smth

granite owl
#

a simple true false dialog would suffice with custom text(for legal compiliance reasons)

#

and ofc close the connection if declined

#

question is if the bukkit api and vanilla client support such

#

but that requires already being loaded into the world

#

i wanna put it on hold til the eula is agreed on

#

hm

red sedge
#

What are you even trying?

granite owl
#

forcing players to agree/disagree the servers eula and gdpr compiliance agreement

#

before interacting with other server components

#

that ive said before^

red sedge
#

and why do you need them to not be loaded in the world?

#

just put them in a box or smth

granite owl
#

thats not exactly the point of EU law saying u must not store data of users unless they agree to it

#

governments give little fk about a bedrock box if player data is still stored

#

i already do that

red sedge
#

im so extremely confused

granite owl
#

but blocking the user from interacting with the env takes up alot of resources

#

esp blocking player movement events

#

mhm

left swift
#

Is it possible to make getter of spigot server name using bungee messaging channels ("GetServer")? Idk how can I handle it :/

granite owl
#

this i do but ive also written a system around it blocking any other interaction as well as deleting all data upon leaving the server if they havent agreed yet. problem isnt the functionality but the performance

red sedge
#

Minecraft doesnt really store personal data tho does it?

#

Even if it does, it doesnt give it to servers

granite owl
#

first off

quaint mantle
#

the client only gives away its ip, uuid

granite owl
#

it links the uuid to the users ip address

#

so uuid becomes personal data

#

2nd

#

govt not giving a flying about us not re-distributing data

red sedge
#

how tf does uuid become personal data? yk what im not questioning it

quaint mantle
#

your ip is given to every server you connect you...

red sedge
granite owl
#

and as such u can trace someones geolocation by uuid

zenith saddle
#

Can you have an int in a .yml file?

red sedge
eternal oxide
#

neither UUID nor IP, combined or separate are personal data. an IP can be anyone

quaint mantle
#

ELGAR

#

@eternal oxide hi

red sedge
eternal oxide
#

hi

quaint mantle
granite owl
red sedge
#

ah right

granite owl
#

the vanilla logger that stores ip address and uuid in the same file an ip address that can be traced down to the streets name?

zenith saddle
quaint mantle
red sedge
#

not sure tho

quaint mantle
#

why are you on discord rn?

#

your location could be compromised!! 😱

red sedge
#

your ip is being tracked!!!!

granite owl
#

omg do you

#

know european law?

quaint mantle
#

im from Merica brother

granite owl
#

then stop mocking me

zenith saddle
#

pepole dont respect laws...

#

nomater what

quaint mantle
red sedge
eternal oxide
#

I'm UK and I run websites, so yes I know all about data protection. IP is not in it

zenith saddle
#

silence continues...

tardy delta
#

cannot drop air lol kinda funny

left swift
#

How can I make getter of spigot server name using bungee messaging channels? Idk how can I handle it from the listener :/

granite owl
# zenith saddle silence continues...

its just cringe that ppl tell me "ur wrong blabla". its my property at risk if i violate laws not theirs so honestly, idk what to say to someone telling me im an idiot for trying to abide by the law in good faith

#

and this happens all too often

#

ive asked a simple question and get bashed for something else xD

zenith saddle
#

No one said you dont respect the law, you have to assume others dont.

#

your not an idiot if you abide by the law.

granite owl
#

ik

zenith saddle
#

You assume others dont.

red sedge
#

The IP a server recieves is not personal information

#

You can't link it to a specific individual

zenith saddle
#

If you have a car and dont lock it then your dumb for assuming others wont take it.

red sedge
#

And it's required for the server to function it is literally just a way of connecting your device to another one using the internet

granite owl
#

im trying to say this in a respectful way, if you believe u cant be traced by ip address then idk what to say

echo basalt
#

then you can do whatever with that server id

red sedge
#

Oh no! How shall I live with someone knowing my general location

#

You can't link my IP to me, sure you'll know my general location but it's not my personal information

red sedge
#

Especially since it's using one's public IP

#

which is usually reset after a while

echo basalt
#

ehh not exactly reset

#

but ok

#

there's communication with DNS to indicate a change of IP

zenith saddle
#

do you need a value for catch and what is finally?

tardy delta
#

finally will run whenever there was an exception or not

echo basalt
#

finally will run regardless, even after return statements

tardy delta
#

basically equivalent for java try { // some operation final_stuff(); } catch (exception e) { final_stuff(); }

red sedge
#

But I think the GDPR says its personal information and I can't say anything to that

zenith saddle
#

so you need to know what exeption?

tardy delta
#

just try {} catch {} finally { final_stuff() }

#

you can just do catch(Exception e) then that will catch all types of exceptions

#

or you would do catch (IlegalArgumentException e) to catch that specific one

#

depends on how you want

granite owl
#

xD

#

which gets us back to the beginning

red sedge
granite owl
#

idk where gl diving

red sedge
#

Yeah but minecraft also stores the IP

#

so its minecrafts problem

granite owl
zenith saddle
#

Laws are usless, and uhh thats why firewalls exist.

red sedge
#

Laws are required

#

Unless the law is bullshit

#

in that case oh well what can ya do

granite owl
#

bullshit is

#

that the gdpr forbids us from collecting data by default

#

but the data preservation law forces us to collect all data regardless

#

to be able to assist authorities

#

with uncovering crimes

red sedge
#

Again, the law is bullshit

#

Doesn't mean we don't have to follow it but oh well

granite owl
#

^^

#

at this point we've done a 360°

red sedge
#

But still you shouldnt have to worry about it

ivory sleet
#

can this topic move into a thread or #general thanks

granite owl
arctic moth
#

is it bad if it takes about 7 seconds per tick

arctic moth
#

yay

red sedge
#

its perfect

arctic moth
#

xD

zenith saddle
#

OOPS

red sedge
#

I only see perfection

granite owl
#

question still stands if i can fake a download resource pack prompt tho to get the agreement done prior to joining the server or not

#

which someone said no to

red sedge
#

Just like

#

make a website link on first join

granite owl
#

already done

red sedge
#

and require them to accept in the website

#

and then let em join

arctic moth
#

theres not even anything spawned

granite owl
#

that requires the usage of an sql data base

#

and a webserver

cyan compass
#

How do i give dyed leather armor?

red sedge
#

just use some random website builder bs that deals with that for you

cyan compass
#

Cause meta.setColor isn't a thing

red sedge
#

they should comply with it

red sedge
granite owl
zenith saddle
#

does someone have example code for a /give command?

red sedge
arctic moth
#

i alt+f4ed the console and it decided it wants to be immortal

#

what do i do

red sedge
zenith saddle
#

task manager

red sedge
#

Computers have taken over

arctic moth
#

lol

#

just a keybind version

granite owl
zenith saddle
#

well ur fricked

arctic moth
#

yay

red sedge
#

Give up under the power of computers

#

Obey by their laws before its too late

zenith saddle
cyan compass
red sedge
granite owl
red sedge
#

literally, cast it

cyan compass
#

Ah ok

zenith saddle
#

stick.setItemMeta(meta);

granite owl
#

iirc addItem also checks if theres a free itemslot

red sedge
cyan compass
#

Yeah

red sedge
zenith saddle
red sedge
#

and add that item

red sedge
#

aka Material.valueOf

#

so not literally cast but like

granite owl
red sedge
#

you get it

zenith saddle
#

ok but the player?

granite owl
alpine coral
#

Hello, I'm tryna get setup on Eclipse, and I cannot get this working ... oh great just found out a dev help channel doesn't have image perms so you can upload a screenshot of the error

granite owl
#

like when comes player

alpine coral
#

fantastic

granite owl
#

when comes itemstack

#

when comes amount etc

red sedge
#

There

#

just ignore error safety

alpine coral
#

this

#

why can't it import it?

red sedge
#

also i just realized that wont work lmfao

alpine coral
#

I added it to the libraries

cyan compass
#

okay so i see fromRGB(int rgb) and i'm wondering. can i do something like25510255 all as 1 int for that?

ivory sleet
#

mye

#

well its easier to use a hex int 0xFFFFFF for instance

ivory sleet
#

which would be white

cyan compass
ivory sleet
#

rather than the base 10 format

granite owl
# zenith saddle ok but the player?

since u can only add items to inventories of players who are online...
use online players

Player p = Bukkit.getPlayer(args[urIndex]);

p.getInventory().addItem(...);
``` @zenith saddle
alpine coral
#

How do I get started with spigot cuz the tutorial didn't work

#

if yall obv won't look at the screenshot

#

just hold my hand

red sedge
#

and use split

ivory sleet
#

Honestly, I'd start by trying IntelliJ, cause most of us use IntelliJ

cyan compass
ivory sleet
#

and so you'll be provided much better assistance with that one

alpine coral
#

I don't have time to install a bunch of stuff I gotta go work in less than 20 minutes

red sedge
cyan compass
#

Oh

ivory sleet
#

that wont work

red sedge
#

70gbs?

red sedge
alpine coral
#

Its not how big it is

#

its how slow my hdd is

ivory sleet
#

cause its not a valid integer

cyan compass
#

Exactly!

red sedge
ivory sleet
#

"255, 255, 255"

alpine coral
#

aaaaaand this is already wasting time just trying to get help cyall

red sedge
#

Yeah, as I said, split()

ivory sleet
#

why tho

#

you can simply put sth like 0xRRGGBB

waxen plinth
red sedge
#

Because, 255255255 looks a lot more confusing than 255, 255, 255

waxen plinth
#

^^

cyan compass
#

That's fine

#

I do not care about readability for that right now as i just want to get some base setup that i can easily change later

red sedge
#

use hex

#

your way will require some sort or parsing eitherway

zenith saddle
red sedge
#

but imo rgb is just easier for most users

cyan compass
#

Wdm use hex? I have to parse that into RGB then

waxen plinth
#

Are you looking for a solution to the problem using the spigot api?

ivory sleet
#

fromRGB takes an int value as the rgb representation alr

waxen plinth
#

Or are you open to using another library that would help you do this much more easily?

#

Because I have a command library that will make it easier

red sedge
ivory sleet
#

just getPlayer

waxen plinth
#

hello sergei

feral socket
#

hmm, maybe we should do some checks before blindly doing all that

ivory sleet
#

and then you in principle need to catch the possible exception Material::valueOf throws

waxen plinth
#

yeah you definitely should

red sedge
feral socket
#

hello Redempt

waxen plinth
#

hence libraries

red sedge
#

When you can just... ignor eit

waxen plinth
#

which do all the safety for you behind the scenes

red sedge
#

its not that hard to make it safe tho just gotta add like 2-3 checks

waxen plinth
#

bruh

#

gonna take more than that

red sedge
#

just check if the getPlayer returns a valid player

#

and args[0] is a valid material

waxen plinth
#

make sure the amount is positive

#

make sure the player has the right permission

red sedge
#

or just you know....

waxen plinth
#

inventory space

red sedge
#

plugins.yml
permissions

feral socket
#

what is permishen?

waxen plinth
#

you could also

feral socket
#

how to add

red sedge
#

also you're just going off rails

#

they asked a replica of /give

feral socket
#

plss help

waxen plinth
#
give player:target material:type int<1,>:amount?(1) {
  hook give
}```
ivory sleet
waxen plinth
#
@CommandHook("give")
public void give(CommandSender sender, Player target, Material type, int amount) {
  target.getInventory().addItem(new ItemStack(type, amount));
}```
zenith saddle
#

I have an Item stack pre defined in an item manager class, It is an Item stack of one(changeable). Command: /block <Player> <amount>.

waxen plinth
#

This will do literally all the checks required

#

It will automatically convert the types

#

You don't have to check argument counts

#

It supports optional arguments and will fill in default values if they are supplied

red sedge
#

jeez okay red you can sell your product

waxen plinth
#

It won't allow negative values because of the <1,> on the amount

red sedge
#

ah yes Math.min(1,)

waxen plinth
#

If you want to do all that stuff yourself then you can and it can be a valuable learning experience

feral socket
#

and if i put 65

zenith saddle
#

I have an Item stack pre defined in an item manager class, It is an Item stack of one(changeable). Command: /block <Player> <amount>.

red sedge
waxen plinth
#

But if you want to do it more easily this is one way

red sedge
#

i guess

waxen plinth
#

Well that implementation won't

#

You'd have to write the code to break it up into stacks as needed for that

feral socket
#

how to make fly plugeni, i want to get flie on ssever and backdor

zenith saddle
#

ok, I will just use a for loop and do it x times.

red sedge
#

I think addItem already does that

#

not sure tho

waxen plinth
#
while (amount > 0) {
  int stackSize = Math.min(type.getMaxStacKSize(), amount);
  amount -= stackSize;
  target.getInventory().addItem(new ItemStack(type, stackSize));
}```
#

Something like this would work for that

red sedge
#

???

feral socket
#

how do i fly phugin

#

hel

#

guys i NEED to fly like berd

red sedge
#

fly like bread?

ivory sleet
#

this is certainly a compelling troll...

waxen plinth
#

spigot ban% speedrun

#

oh he's already gone lol

river oracle
#

anyone have a resource on custom inventory texturing for spigot I tried some research, but couldn't find anything solid from what I see the best approach to this is a Unicode character, but I'd need an example I'm not too familiar with resource packs

zenith saddle
#

heh

#

NEVERMIND

sterile token
#

In fact im doing something wrong because the letters are correct on some facings

#

I would be greathfull if someone can take a look

zenith saddle
#

WTH

#

fixed

worldly ingot
#

Likely just have another server running already in the background

river oracle
#

oop

zenith saddle
#

terminal is closed

river oracle
#

likely going to need taskmanager

#

if your on linux reccomend btop or htop

zenith saddle
#

Ahh I know what happend

#

my computer fell asleap when loading server, and the session.lock flile is locked