#help-development

1 messages · Page 1474 of 1

sharp bough
#

no

#

i have to set everthing as a copy in the config.yml?

granite stirrup
# sharp bough no

well saveDefaultConfig only takes things from that file and puts it onto disk

wraith rapids
#

that is the only way to have comments with the bukkit config api yes

#

you need to write your config, defaults, and comments in the config.yml

cedar hamlet
#

Ok, last thing then ill stop bothering you

eternal oxide
#

We did just tell you, saveDefaultConfig takes the config.yml from inside your jar and saves it

cedar hamlet
#

?paste

queen dragonBOT
cedar hamlet
#

Im getting this error

sharp bough
cedar hamlet
#

its not stopping anything

#

but its clogging the console

wraith rapids
#

yes, it is pointless

sharp bough
cedar hamlet
#

((Player) p.getInventory()).updateInventory();

sharp bough
eternal oxide
#

you are casting an Inventory to player

cedar hamlet
#

Because i need to remove a snowball from the player

eternal oxide
#

p is a player not the inventory

granite stirrup
cedar hamlet
#

ah

granite stirrup
#

also theres already a bunch of crates plugins why are u making one???

wraith rapids
#

((Player) p.getInventory())
method calls take precedence over casting

#

the p.getInventory is executed first, yielding a PlayerInventory

#

only then does the cast happen

#

which then tries to cast a PlayerInventory into a Player

#

which explodes

cedar hamlet
#

i see

wraith rapids
#

((Player) p).getInventory().updateInventory();

#

this casts p to Player first

#

and then calls the method

cedar hamlet
#

ah

#

update, it seems to be absolutley functional without it

wraith rapids
#

same principle as with how 1 + 2 * 3 is different from (1 + 2) * 3

cedar hamlet
#

yeah

south onyx
#

how do i get all entities in a 20 block radius
using player.getNearbyEntities

lyric grove
#

How do i fix this?

wraith rapids
#

you are passing it a String

#

it doesn't take a String

#

either make it take a string, or give it what it wants

sharp bough
#

yet still it overrides the old config with the new one

wraith rapids
#

you're using config.save or saveconfig or something somewhere

#

basically, you never want to use bukkit's saveconfig or config.save or whatever

sharp bough
#

no i just checked that

wraith rapids
#

all of them nuke the comments

sharp bough
wraith rapids
#

nothing

#

you simply don't edit the config file through code

#

you edit it through the config.yml file

#

anything other than that nukes comments and newlines and formatting

sharp bough
#

does the set(path value) call the saveconfig?

young knoll
#

Or you take the time to find an API that keeps comments

#

Wether it be modern SnakeYML or something third party, you can probably find it on the forums

granite stirrup
sharp bough
#

lmao it was a DestinyCrates.get().saveConfig(); in the onDisable

granite stirrup
cedar hamlet
granite stirrup
#

bruhhhhh google wants me to confirm my age on youtube and i dont have a id or credit card ;-;

wraith rapids
#

Caused by: java.lang.NullPointerException

#

a NullPointerException is thrown when you try to call a method on a variable that is empty

granite stirrup
#

make sure it isnt

#

before doing the code u do with the itemstack

wraith rapids
#

just that you have a variable isn't a guarantee that there is something actually stored in that variable

#

for example, your p variable could be empty

cedar hamlet
#

ah

wraith rapids
#

it might not point at any object

#

it might be a null-pointer

#

and calling any methods on it would throw a null-pointer exception

granite stirrup
#

i wonder what null actually goes to XD

wraith rapids
#

0, generally

#

though that is an impl detail

cedar hamlet
#

so "item" was never previously defined

#

that could be it

eternal night
#

In C it does, so it wouldn't be a big surprise of java doing the same

wraith rapids
#

no, item is defined

granite stirrup
#

i just thought of it as like a space that anything u put in it just disappears

wraith rapids
#

you define it in that exact line

cedar hamlet
#

right

wraith rapids
#

like I just said just because you've defined something, you can't expect that something to have a value

#

ItemStack item; declares aka defines a variable named item

#

but does not assign anything to it

#

that means item is empty, it points at nothing, it's a null-pointer

cedar hamlet
#

ok

#

how do i work around this?

wraith rapids
#

you figure out what is null

#

and then either make it not null, or don't do stuff with it if it is null

#

on that line, there are 3 things that could theoretically be null

#

firstly, p itself could be null

#

secondly, the return value of p.getInventory() could be null

#

thirdly, the return value of inventory.getContents() might be null

cedar hamlet
#

ok

wraith rapids
#

now, figure out which one of these 3 is the case

cedar hamlet
#

so its not p because i have Player p = e.getPlayer();

wraith rapids
#

protip: split each . to a new line

#
    .getInventory()
    .getContents()) {```
cedar hamlet
#

ok

eternal night
#

please only for debugging xD

young knoll
#

Or get those wonderful java 15 NPEs

wraith rapids
#

yeah, it doesn't look good, only use for debugging

eternal night
#

^^ the dude that added these is crying everytime people do this

wraith rapids
#

i don't have the effort to try and explain how to do that

eternal night
#

I still don't know how people are still defaulting to java 8

#

well or 11 I guess

cedar hamlet
#

so it has to be getInventory or getContents

wraith rapids
#

cause muh spigot tutorial says java 8

eternal night
#

java 17 when

cedar hamlet
#

should i just run an if statement ``if (p.getInventory() == null){System.out.println("getInv is null");}

wraith rapids
#

that is more effort than hitting enter 2 times

cinder thistle
cinder thistle
#

Only empty

wraith apex
#

since it's an LTS version

eternal night
#

Yeah, then we just wait for all the linux distros to upgrade to 17 as their default

#

and we shall never have this issue again

wraith rapids
#

neither inventories nor inventory contents should return null

wraith apex
#

rip all plugins

eternal night
#

why xD

granite stirrup
#

lmao why does electron even use so much cpu

eternal night
#

if you are in trouble because of jigsaw

cedar hamlet
eternal night
#

you were doing something very shady to begin with

cedar hamlet
#

for(ItemStack item : ((Player) p)
.getInventory()
.getContents()) {

wraith apex
#

you're jumping 6-7 java versions

#

depending on what got deprecated and removed

#

some things may break

cedar hamlet
#

lines 45-47

eternal night
#

I mean ye, java 9 removed a bunch of incubators I believe

#

and obviously nerfed reflection into the groud

cinder thistle
south onyx
wraith rapids
#

well this says line 48

cedar hamlet
#

if(item.getItemMeta().hasDisplayName()) {

cinder thistle
#

It’s like running a basic browser just for one or two pages

wraith rapids
#

an item may not necessarily have item meta

#

the return value of getItemMeta may be null

chrome beacon
wraith rapids
#

check hasItemMeta or check if meta == null

#

and don't call getItemMeta multiple times

#

every getItemMeta call clones the entire itemmeta

#

which can be catastrophically expensive for larger items

#

call it once and store it in a variable

cedar hamlet
#

if(item.getItemMeta().hasDisplayName() && item.getItemMeta() != null) {

wraith rapids
#

the other way around

#

the first statement is run first

#

which would explode

#

check first, then do stuff

eternal night
#

and then again, also incorporate NNYs suggestion

#
final ItemMeta meta = item.getItemMeta();
if (meta != null && meta.hasDisplayName()) { ... }
cedar hamlet
#
                    for(ItemStack item : ((Player) p)
                            .getInventory()
                            .getContents()) {
                        final ItemMeta meta = item.getItemMeta();
                        if (meta != null && meta.hasDisplayName()) {
#

like so?

wraith rapids
#

since we're no longer debugging, you can put those .'s back on the same line

cedar hamlet
#

console still has a heart attack

wraith rapids
#

the exception should have at least changed

cedar hamlet
#
   45                 for(ItemStack item : ((Player) p).getInventory().getContents()) {
   46                     final ItemMeta meta = item.getItemMeta();
   47                     if (meta != null && meta.hasDisplayName()) {
wraith rapids
#

getContents is the one that returns an array right? that's nullable iirc

#

that is, the individual elements of that array may be null

#

which means that item may be null

sage swift
#

well yeah you gotta check for null and air items first lol wyd

cedar hamlet
#

oh ok

wraith rapids
#

which brings us to what I always tell everyone

#

whenever working with bukkit inventories

#

always check for both null and for air

sage swift
#

he's not checking either though

#

:]

wraith rapids
#

if (item == null || item.getType() == Material.AIR)

#

bukkit is incredibly inconsistent with whether empty slots return null, or whether they return an itemstack of air

#

best always check for both and save yourself from a bunch of headache

cedar hamlet
#

wouldnt we want !=?

wraith rapids
#

depends

#

if we want to cancel, we want ==

#

if we want to do stuff, we want != and &&

#

if item is null or item is air, don't do thing X

#

if item is not null and item is not air, do thing X

cedar hamlet
#

ok

#

aaaa

#

oh wait hold on

#

nope still broken :(

wraith rapids
#

show code

cedar hamlet
#
                    for(ItemStack item : ((Player) p).getInventory().getContents()) {
                        final ItemMeta meta = item.getItemMeta();
                        if (meta != null && meta.hasDisplayName()) {
                            if (item != null && item.getType() != Material.AIR) {
wraith rapids
#

again, again, again

#

check first

#

final ItemMeta meta = item.getItemMeta();
this happens before you check

#

repeat after me

#

you can not do stuff with the contents of a variable

#

if the variable has no contents

cedar hamlet
#

right right

#

well

#

it seems like that was that

#

thank you so much for your patience

wraith rapids
#

👌🏿

quaint mantle
#

Ait I got a BlockBreak Event for when chests are broken but one of my things doesn't work unless I use static and I am trying to not use that.
ArenaManager class

    public static List<String> testerConfiguration = new ArrayList<>();
    public static List<String> chestConfiguration = new ArrayList<>();
    private final ArenaConfig arenaConfig;

    public ArenaManager(ArenaConfig arenaConfig, TIMV game) {
        this.arenaConfig = arenaConfig;
    }

BlockBreak Event class: https://paste.md-5.net/ijotoqexuw.cs
Main class for block break event:

pm.registerEvents(new BlockBreak(this, this.arenaManager), this);
visual tide
#

is there anything i can do to stop getConfig().set("something", something); wiping comments and the other things

young knoll
#

It doesn’t

wraith rapids
#

getConfig.set doesn't

young knoll
#

Saving the config does

visual tide
young knoll
#

Not with the bukkit API

#

You’ll need something else

wraith rapids
#

something better

visual tide
#

ah

wraith rapids
#

something that doesn't depend on half a decade old snakeyaml

visual tide
young knoll
#

Why can’t we PR an update to that

#

Actually, I haven’t tried

digital plinth
#

is there a way to disable ppl from getting illegal items from their saved hotbar while in creative mode?

wraith rapids
#

glhf basically

quaint mantle
#

Hey, does anyone know how I could possibly make a fake EntityPlayer able to have gravity and be vulnerable?

digital plinth
digital plinth
#

oh also can someone link me to the plugin that combines wither bossbars

quaint mantle
digital plinth
#

never worked with npcs

#

XD

young knoll
#

NPCs are just a packet sent to the client

#

In order for them to move, you need more packets

quaint mantle
#

well yes, but in the newer versions of minecraft (1.16.5), there is a function for each, for example for taking damage, I have already found it, you can override tick function and apply your damaging

#

so no need to send additional packets manually

#

but just stuck in applying physics, which still trying to find...

wraith rapids
#

then that is no longer a packet based npc

#

but an actual npc

quaint mantle
#

the class does extend the EntityPlayer and implements the values it needs, and I do also add it to the world via addEntity, and then sending packets for showing npc, and etc...

cold tartan
#

how would you make an entity not attack another entity?

#

does it require teams with friendly fire off?

quaint mantle
cold tartan
#

wdym

granite stirrup
#

XD

cold tartan
#

i mean i got the attacking down

quaint mantle
#

That works as well I guess

cold tartan
#

lemme explain what happens better

granite stirrup
#

wait EntityTargetEvent is legit EntityTargetLivingEntityEvent

quaint mantle
#

mhm

cold tartan
#

I want a zombie that acts like a dog, I figured out how to make the zombie attack the mob that I hit, but when the zombie attacks that mob it then turns around and targets me

#

thats the issue, i want it to continue targeting the mob I hit

#

should i just make it so that when the zombie hits the mob an event is called to target the mob again?

#

or is there a better way?

onyx shale
#

are you using nms pathfinders or api?

#

if api yes you should try resetting the target

cold tartan
#

i mean here is the code:

Creature zombie = (Creature) player.getWorld().spawnEntity(player.getLocation(), EntityType.ZOMBIE);
zombie.setTarget(entity);
onyx shale
#

yeah its api way

cold tartan
#

ok

onyx shale
#

you have to make use of the events

#

not rly another way

cold tartan
#

ok, are nms pathfinders better?

young knoll
#

You can set the target again and cancel any target event on the player

onyx shale
#

hopefully well get pathfinder api in 1.17

#

well nms pathfinders directly controls the AI basically

#

you can remove the player from the hostile list

cold tartan
#

oh, thats exactly what i need

onyx shale
#

well that way you can actually copy paste the dog ai

#

on a zombie..

cold tartan
#

wait i can

#

😳

onyx shale
#

using nms yes not the the easiest but eh

#

plenty of tutorials out there

cold tartan
#

ok, lemme find one

onyx shale
#

why is a manager used as a single instance thing?

#

shouldnt the manager hold multiple instances

#

e.q.. the manager should have a list of Arenas in wich each have theyr own lists or such

quaint mantle
#

me?

onyx shale
#

yes

#

also you didnt rly give relevant code

#

for example how you are accessing the lists

quaint mantle
#

The list isnt the problem

#

me not being able to use the constructor in the block event is

#

arenaManager.setChestLocation(event.getPlayer(), event.getBlock().getLocation());

#

cant access this

onyx shale
#

we dont know what setchestlocation is

quaint mantle
#

There is nothign wrong with it

onyx shale
#

also what the error is

quaint mantle
#

The problem is that I cant seem to use the constructor in the blockevent

onyx shale
#

wut Caused by: java.lang.NoSuchFieldError: END_PORTAL_FRAME

quaint mantle
#

no idea

#

not using any end portal frames

onyx shale
#

thats not a constructor issue

quaint mantle
#

god

#

it is my guy

#

It works fine when I switch it to static

onyx shale
#

at com.onarandombox.MultiverseCore.listeners.MVPortalListener.portalForm(MVPortalListener.java:74) ~[?:?]

quaint mantle
#

just not when I use it as a constructor

onyx shale
#

unless you made multiverse its not from you

#

or you posted a unrelated error

quaint mantle
#

yes probably the second one

#

nope no error

#

I just cant seem to use the constructor, but it works fine when I use static

#

and I have no idea why

onyx shale
#

what is the ide error

quaint mantle
#

no error

#

There is no error so I have no idea why it cant use the constructor

#

ait got an error message out of it there

#

and line 27 is arenaManager.setChestLocation(event.getPlayer(), event.getBlock().getLocation());

tawdry plume
#

This might be a dumb question but I want to create a function that I'm pretty sure does not fit into the listener or event type so I guess I'd just make a void function with no parameters? I'd like to leverage world.getEntities to then set their gravitiy all at once every x minutes

#

What do you guys think would be a good starting point?

granite stirrup
#

um BukkitScheduler takes in ticks and it does it every x ticks

#

20 ticks is one second

#

1200 ticks is one minute

onyx shale
#

or be lazy and do 20*60

tawdry plume
onyx shale
#

yep i usually write that as time

tawdry plume
#

yeah but how would I define the function? can I just do it in main as a void function without parameters/arguments?

onyx shale
#

yeah

tawdry plume
#

public void blah () {code}?

onyx shale
#

i mean its a simple void function

tawdry plume
#

yeah but then would I just call it in main?

onyx shale
#

and then call it on main

#

onEnable

tawdry plume
#

you're the man

#

ty

digital plinth
#

hmm can someone link me to a turotial on how to use maven?

tawdry plume
#

So I saw this for loop online

#
        .forEach(world -> world.getLivingEntities().stream()
                .filter(entity -> (!(entity instanceof Player)))
                .forEach(LivingEntity::remove));```
#

can someone explain that last line? how can I go thru all living entities and set their gravity one at a time? doesn't seem like there's a variable for them

#

i forgot what these types of loops are called but Im pretty sure they're a shortcut to the full for loop. If you guys tell me the name ill research it in java

tawdry plume
granite stirrup
#

actually i think u can

tawdry plume
#
    ...
}```
#

but that's completely diff syntax

granite stirrup
#

i think its .forEach((entity) => {code});

wraith rapids
#

what are we talking about

granite stirrup
#

wait forEach can run a function???

wraith rapids
#

i generally don't like streams but my unbiased recommendation on them is to forget about them until later

granite stirrup
#

inside it

quaint mantle
wraith rapids
#

stick with imperative for loops for the time being under you've found some better footing

quaint mantle
#

foreach should be one line statements

granite stirrup
#

but its not limited to one line

quaint mantle
#

if you have to use -> {
then use a for loop

wraith rapids
#

@tawdry plume don't worry about it for the time being but that last line is a method reference

tawdry plume
#
        .forEach(world -> world.getLivingEntities().stream()
                .forEach(LivingEntity -> LivingEntity.setGravity(false)));
        
    }```
wraith rapids
#

basically a substitute for (entity) -> entity.remove()

tawdry plume
#

that's what I'm trying

wraith rapids
#

which is basically a substitute for new Consumer<LivingEntity>() {@Override public void accept(LivingEntity entity) { entity.remove(); }}

#

which is basically a substitute for

public class LivingEntityConsumer implements Consumer<LivingEntity> {
    
    @Override public void accept(LivingEntity entity) { entity.remove(); }
 
}

new LivingEntityConsumer()
granite stirrup
#

XD

wraith rapids
#

but yeah, until you get some better footing on what everything does

#

steer clear of streams

#

and maybe lambda expressions too

tawdry plume
#

thanks, so those are called streams good to know

wraith rapids
#

the .stream() part is called streams

tawdry plume
#

i've done those in a diff. language but i'm still getting under Java

#

haven't used this language in a while

granite stirrup
wraith rapids
#

the -> part is called lambda expressions

#

the thing wrong with lambdas is that it isn't super easy to grasp what they are and what they do if you're a beginner

tawdry plume
#

but didn't throw out any errors when loaded into the world

#

I'm calling the function in onEnable

wraith rapids
#

rewrite it with imperative for loops

granite stirrup
#

make sure the world is loaded before doing the function

tawdry plume
tawdry plume
wraith rapids
#

for (World world : Bukkit.getWorlds())
for (Entity entity : world.getLivingEntities())
entity.remove()

#

or more verbosely

for (World world : Bukkit.getWorlds()) {
    for (Entity entity : world.getLivingEntities()) {
        entity.remove();
    }
}
#

these are so-called "enhanced for loops"

granite stirrup
wraith rapids
#

they take a multiple of something, and then iterate over its elements one by one

#

for example Bukkit.getWorlds() returns a List<World> if i remember correctly

#

List<World> is a bunch of World's

#

so the : operator takes one World at a time from that list, and runs the { code } block once for each element

granite stirrup
#

idk i just think ArrayList is better even tho its not that different

#

to me

wraith rapids
#

the return type is a List intentionally

#

unless necessary, you don't want to program against the implementation

#

you want to write your code against the most generic interface that provides what you need

granite stirrup
#

lol

wraith rapids
#

f.e it is very strange for something to return an ArrayList rather than a List

granite stirrup
#

i guess

#

but i like ArrayList

wraith rapids
#

ArrayList is a List

granite stirrup
wraith rapids
#

that doesn't make it not a List

granite stirrup
tawdry plume
#

what is a good way to see if the worlds have loaded before executing code? do we check for a not null world?

#

if world != null then proceed?

wraith rapids
#

where are you obtaining this world

tawdry plume
#

local server

wraith rapids
#

no, how are you obtaining this world value

tawdry plume
#

trying to make a plugin to make everything in the world not have gravity

wraith rapids
#

what are you calling to get this world

#

i'm asking because my answer depends on your answer

tawdry plume
#

not going to lie i've been searching thru the docs looking for the right method to use for this

wraith rapids
#

do you want a specific world

#

or all of the worlds

tawdry plume
#

i want to use the world where the players are currently located in. I'm guessing this way we use less resources

#

or we just do it x amount of blocks around the player

wraith rapids
#

in that case, you need to get yourself a Player first

#

do you want to do this for a specific player, or all players

tawdry plume
#

all players

#

there's only going to be 4

wraith rapids
#

then the starting point of your code should be Bukkit.getOnlinePlayers()

tawdry plume
#

and we should be close to one another

#

10-4

wraith rapids
#

which returns a Collection<Player>

#

that is, a series of several players

#

in arbitrary order

tawdry plume
#

i'd like to test the code for just all worlds right now then dive in that way. just want to see if it works but if i execute it i'm pretty sure it's executing before the server completely finishes loading because the script is being called under onEnable

#

does that make sense?

wraith rapids
#

onEnable is called when your plugin is enabled

#

which is by default post-world

tawdry plume
#

oh hmm

wraith rapids
#

unless you've changed that in your plugin.yml

tawdry plume
#

so it should be working

#

hmm nothing yet

wraith rapids
#

show code

tawdry plume
#
import org.bukkit.*;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.entity.*;
//import org.bukkit.entity.Player;
//import org.bukkit.entity.LivingEntity;


public class Main extends JavaPlugin {
    private static Main instance;
    
    public static Main getInstance() {
        return instance;
    }
    
    @Override
    public void onEnable() {
        instance = this;
        getServer().getPluginManager().registerEvents(new Listeners(), this);
        System.out.println("We're LIVE");
        
        callGravity();
    }
    
    
    public void onDisable() {}
    
    public void callGravity() {
        
        
        for (World world : Bukkit.getWorlds()) {
            for (Entity entity : world.getLivingEntities()) {
                entity.setGravity(false);
            }
        }

    }
}```
wraith rapids
#

when in doubt throw stouts at it

sullen dome
#

isn't there World#isLoaded?

wraith rapids
#

probably

sullen dome
#

i mean... that's probably the best way

#

to see if it's loaded lol

wraith rapids
#

depending on how you obtain it, it could be null as well

#

there aren't very many cases where you'd get your hands on an unloaded world I don't think

sullen dome
#

well, probably only when loading on startup

#

or when using custom worlds. idk if postworld is called after or before custom worlds

tawdry plume
#

RIP

sullen dome
#

well, i guess you wanna set gravity to false for every entity?

#

if so, you'd probably apply it to a spawning entity instead of on enable. because that doesn't apply on later-spawning entities

chilly meadow
#

How different is Spigot from Fabric modding

sullen dome
#

well

#

fabric is modding

#

spigot is server-plugins

#

or to be more clear: spigot is a server software - fabric a client-modloader/api

granite stirrup
#

u can do more with fabric than spigot

#

lmao

#

without texture packs i mean

#

cuz with modding using fabric u can add textures and custom items

#

and things

sullen dome
#

fabric is client-modding.

so obviously you can change like the whole game with fabric/forge

#

and with spigot just what the server gives you

granite stirrup
#

well i think it uses texture packs..

#

i actually dont know

sullen dome
#

wtf?

granite stirrup
#

actually dont listen to what i say

wraith rapids
#

lol

sullen dome
#

yeah

#

fabric is a modloader, and modding api

#

from concept, it's like the same as forge

granite stirrup
#

i believe u can add custom items with textures in fabric

sullen dome
#

yeah

#

or change like everything in the whole client

#

you could technically make like skyrim with that i guess

granite stirrup
#

u could do same with spigot but they would have to install a resource pack tho for custom textures

sullen dome
#

wait a sec

wraith rapids
#

not really

#

resourcepacks are still very limited

granite stirrup
wraith rapids
#

yeah, still very limited

#

can't modify blocks

#

can't modify entities

#

can't modify gui

#

you can basically modify specific block textures and specific item models and that's it

#

compared to actually modding the client, that is jack shit

granite stirrup
#

u can change models of items with customModelData tho and still kinda make blocks with like barriers and armor stands i think

wraith rapids
#

yeah and lag the client to shit

granite stirrup
#

XD

sullen dome
#

sometimes i feel like my pc is like a potato

wraith rapids
#

not feasible

sullen dome
#

WTF

#

what have i done

granite stirrup
#

XD

sullen dome
#

nvm, i guess its only clientside?

#

who cares, works now

granite stirrup
#

i think spigot is only server side and mods can be client/server/both side

sullen dome
#

you guys dont see it like this, right?

granite stirrup
#

are u on phone?

sullen dome
#

nah

granite stirrup
#

oh

sullen dome
#

i changed my settings. so like i thought, thats only clientside

#

well, guess you cant read german lol

#

so useless

wraith rapids
#

ToTALEN KRIEG

sullen dome
#

god

#

please don't say this

granite stirrup
# sullen dome

isnt that the option where it always compresses files above 10mb?

sullen dome
#

yeah

#

like, it doesnt show it

#

if bigger than 10mb

granite stirrup
#

oh

sullen dome
#

if i enable it, it shows like this. default

granite stirrup
#

that feature can protect u from crash gifs

sullen dome
#

true

granite stirrup
#

unless its a under 10mb crash gif

#

but i dont think thats possible

#

XD

sullen dome
#

well, gifs are mostly under 10mb

#

far under 10mb

granite stirrup
#

lol

#

i found this ^

#

its the whole of tankman 1

#

in a gif

sullen dome
#

i mean... my pfp is like 2mb

#

and it's like 1080x1080

granite stirrup
#

btw on emojis what is the ?v=1 thing actually mean in discord

sullen dome
#

never heard

#

btw:
i bought a iphone 12. that's my first iphone in my whole life. probably will change my life entirely

#

idk why i tell you that, but yea

wraith rapids
#

iphones are gay

sullen dome
#

yeah... idk

#

i think they're cool. only thing i hate without having one, you have to buy like everything seperately

#

i mean, i luckily got an usb-c to usb adapter, but without i would have to buy a fucking adapter to charge it lol

granite stirrup
#

lmao

#

i think android is better

sullen dome
#

well, i got no reason why android is better for me. i dont think i do anything where android is better

#

i mean, i almost never installed some apk's, i never tried to root/jailbreak/whatever it...

granite stirrup
#

i mean android is kinda like iphone now

sullen dome
#

i usually was using huawei because of prising, but because of that google thing, i need to get another one. and wanna try apple for the first time

#

i mean, i cannot even create a .inf file onto my sdcard, because of permissions. wtf is that...

granite stirrup
#

?

sullen dome
#

i do

#

i can do everything

#

create files

#

rename files

#

delete files

granite stirrup
#

¯_(ツ)_/¯

#

android or iphone

#

i never used a sdcard XD

#

i never need to use one

sullen dome
#

but if i try to rename smt to .inf, or create/copy an inf file, it's like permission denied

#

i used it to save my music on, where i had a phone in past with like 8gb of memory. now, i just use it to like copy files to my pc fast, because my loading-slot was kinda broken when moving my phone like 1mm

#

i will wait for that iphone to arrive, and test it out.

granite stirrup
#

whats a .inf file

#

anyway

sullen dome
#

well

#

windows setup uses an autorun.inf

#

to boot from it

granite stirrup
#

i think maybe android blocked making .inf for a reason so it doesnt autorun things XD

sullen dome
#

i wanted to create that onto my otg-usb, but couldnt. my pc was broken, and i had like no way to recover my pc

#

yeah obv its bc of that, but why can't i do what i want with MY OWN BOUGHT phone

#

i mean, i pay money to not get permissions

granite stirrup
#

¯_(ツ)_/¯

sullen dome
#

well, let's install life is strange 2. wanna try out that game

#

even if it's probably not as good as lis1

granite stirrup
#

@sullen dome do u know how to come up with plugin ideas

sullen dome
#

well, let's not install it

#

because 16gb ram not enough lmao

sullen dome
granite stirrup
sullen dome
#

it's a setup lol

#

but it uses like 8gb of ram or smt

granite stirrup
#

wtf

#

what setup uses that much memory

#

mc doesnt even take that much and its a bigger game than that life is strange shit

sullen dome
#

yeah, thats the bad side of downloading games [fully legally ofcourse cough]

granite stirrup
sullen dome
#

sometimes 🦆

#

but if i see that games are good, i usually buy them after it

granite stirrup
#

same i just have no money i cant afford games that i just want to play but i actually payed for minecraft

sullen dome
#

nah

#

just imagine i'd have bought cyberpunk

granite stirrup
#

lmao i got among us for free without pirating

sullen dome
#

tf

granite stirrup
#

epic games

#

made it free for liek one week

#

its still rn

sullen dome
#

gifted or what

#

oh lol

#

interesting

#

i actually got gta5 free like 1 year ago, where it was free on egs

granite stirrup
#

i downloaded it 🙃

#

free among us yay

#

XD

#

on it to

sullen dome
#

see, i don't always just pirate games

#

if i like them, i'll buy them after i played them

#

or while playing them

#

the thing is, i mostly only play like storygames or offlinegames in general, so i have like no con's lol

granite stirrup
#

i only pay for the games i llike alot

sullen dome
#

well, i dont mean i personally like

#

i mean games that i've played, and where i can see that they're well made

paper viper
sullen dome
#

not like cp xd

granite stirrup
sullen dome
#

i mean, cp is well made but.... buuuugs

paper viper
granite stirrup
#

yeah bugs suck i never actually seen a bug in mc

#

like ever

sullen dome
#

i've seen hundreds

paper viper
#

bugs?

sullen dome
#

i see a bug everyday, that has not been fixed since like 1.5 or smt

#

or whenever it occured

paper viper
#

most of the bugs are from like 2b2t

#

Lmao

#

that exploit the living shit

sullen dome
#

with the graphic issues on held items

paper viper
#

of some stuff

granite stirrup
#

the Only bug i know about in mc is the infinite markers on map bug and it crashes your game and it can crash servers

paper viper
#

thats from 2b2t lol

granite stirrup
#

but it works on any server

sullen dome
#

newgrounds omg

#

gives me like so big flashbacks

granite stirrup
#

yeah its got week 7 on it

#

thats why i play it there sometimes

#

cuz they havent released week 7 :(

#

on itch or whatever

sullen dome
#

og who still knows clipfish lol

#

wait nvm not clipfish, i'm dumb

#

how was it called

granite stirrup
#

lol

sullen dome
#

miniclip omg

#

best website change my mind

granite stirrup
sullen dome
#

they still got that old ass design ahhhhhhhh

#

flashbaaaaaaacks

granite stirrup
#

who loves mild audio and mild text

#

tankman is so funny ngl

sullen dome
#

intellij users crying in the corner

#

oh maybe i know why my pc uses 10gb

#

should probably close intellij AHAHA

granite stirrup
#

lol

#

intellij uses alot of ram yeah

sullen dome
#

well, i think normally it uses smt like 2gb

#

but i increased to 5

granite stirrup
#

mine normally uses about 1gb

sullen dome
#

well, if youre used to code a minecraft 1.16 client, you usually use like much ram

#

with a 500mb+ big project lol

granite stirrup
#

lol

lofty mulch
#

oh yea intellij

candid galleon
#
Caused by: java.lang.NoSuchMethodError: 'long org.bukkit.World.getGameTime()'
#

🤔

granite stirrup
#

try getFullTime?

candid galleon
#

getFullTime and getTime work as intended

#

getGameTime is documented

dusk flicker
#

what version is your server

candid galleon
#

1.16.5-R0.1-SNAPSHOT

dusk flicker
#

and it cant find getGameTime?

candid galleon
#

mhm

dusk flicker
#

what the fuck

candid galleon
#

spigot-1.16.5.jar:git-Spigot-138d451-e5cb519

#

yeah idk

dusk flicker
#

Can you send a code snippet

#

of where its called

candid galleon
#
@Override
protected boolean exec(CommandSender sender, String label, String[] args) {
    if (!(sender instanceof Player)) {
        MSG.tell(sender, Lang.COMMAND_PLAYER_ONLY);
        return true;
    }

    Player player = (Player) sender;
    MSG.tell(player, "The current time is &e%d &7/ &a%d &7/ &b%d", player.getWorld().getTime(), player.getWorld().getFullTime(), player.getWorld().getGameTime());
    return true;
}
dusk flicker
#

Honestly not sure

#

I don't see why it would throw that error

#

can you provide the entire stacktrace?

candid galleon
granite stirrup
#

line 22 of TimeCommand?

candid galleon
#

MSG.tell(player, "The current time is &e%d &7/ &a%d &7/ &b%d", player.getWorld().getTime(), player.getWorld().getFullTime(), player.getWorld().getGameTime());

#

I know how to code guys 😂

dusk flicker
#

ima decompile spigot give me a sec lmao

granite stirrup
#

have

#

to

dusk flicker
#

?bt

queen dragonBOT
dusk flicker
#

Im confused lmao

granite stirrup
#

if u use intellij u can do it in seconds

#

just one file

dusk flicker
#

either way I dont have a 1.16.5 jar

granite stirrup
#

u just need to open where getFullTIme is

candid galleon
#

also it looks like getTime and getRelativeTime are returning the same methods

#

which- I don't think is intended?

dusk flicker
#

org.bukkit.World

#

ignore that

floral flare
#

Does anyone know of a way to make a timer of how long a player has been online on the server?

dusk flicker
#

Make sure you are on the exact latest then id say /ver should say up to date or whatever it is

candid galleon
#

might be that, says im 36 versions behind

dusk flicker
#

yeah could be that lol

#

Run buildtools and get a latest jar

candid galleon
#
Error compiling Spigot. Please check the wiki for FAQs.
If this does not resolve your issue then please pastebin the entire BuildTools.log.txt file when seeking support.
java.lang.RuntimeException: Error running command, return status !=0: [cmd.exe, /D, /C, sh, applyPatches.sh]
#

oh that's lovely

dusk flicker
#

oh god

#

thats gonna be fun

sweet oak
#

hey i am new to coding. But I am trying make a plugin that when I player rights click with a sword to force the player to crouch. I am trying to go this to allow geysermc allow bedrock players block one 1.8 But I can seem to force sneak even with player.setSneaking(true); is there way to force block or for shield on spigot 1.16+?

candid galleon
#

yikes

#

redownloaded buildtools and it still throws that error

candid galleon
# sweet oak hey i am new to coding. But I am trying make a plugin that when I player rights...
It is impossible to control what the client does aside from limiting their mobility via packets/events.

If the client wants to sneak, the client will output packets as if it were sneaking. setSneaking only gives them the appearance server-side of what you set it to, but the client will do what it chooses to do. Granted, if the client were sending sneaking packets but walking normally, the server would catch on (or anticheats would, at least). 

https://www.spigotmc.org/threads/player-setsneaking-false-has-no-effect.303165/

#

@vagrant stratus would you know anything about this?

#

nvm think I got it, sorry for the ping

vagrant stratus
#

I believe it's a purely client side thing functionality wise, you can only stop other players from seeing them sneaking

candid galleon
#

not that lol

dusk flicker
#

lmao

candid galleon
#

i think it was because i was running it in CMD

dusk flicker
#

git bash ftw

#

also congrats Optic

candid galleon
#

it always used to work, but I guess running it in git bash is required now

vagrant stratus
#

Thanks @dusk flicker

#

and yea, most likely @candid galleon

candid galleon
#

unfortunate

#

congrats also ^

dusk flicker
#

🏓

#

lmao

candid galleon
#

updating fixed that issue, cheers

sweet oak
#

is it possible to force block with a shield by sneaking?

south onyx
#

how do i check if an entity is in a players line of sight?
i dont want an answer like "oh just use vectors"
cuz idk what to do

#
@EventHandler
    public void onInteract(PlayerInteractEvent e) {
        Player player = e.getPlayer();
        for (Entity entity : player.getNearbyEntities(20, 20, 20)) {
            
        }
    } 
#

what i have so far

candid galleon
#

I'm so confused

#

what's the point of Objects#requireNonNull

#

it just throws a NPE, aka what would happen without it

#

@south onyx you can raycast

paper viper
#

without it, nothing happens (if isnt null)

candid galleon
#

seems redundant

south onyx
#

what does that mean??

paper viper
candid galleon
#

Yeah but it throws a NPE either way right?

paper viper
#

Uh no?

#

it only throws an NPE if the object you passed in is null

candid galleon
#

right

#

oh I see

#

I meant if you ever use it though

paper viper
#

wdym

candid galleon
#

like, Objects.requireNonNull(world).getPlayer

#

for example

#

would be redundant

paper viper
#

Not necessarily, like if world is null

#

like if that was from Bukkit.getWorld

#

if the world doesnt exist

#

it returns null

#

then in that case, you can use that

candid galleon
#

@south onyx get the vector from the entity to the player, cast a ray using that vector, and check if the ray's length is longer than the original vector

#

if it is, it went past and there are no blocks between the player and the entity

paper viper
#

It is usually more widely used in like argument checking for like constructors/methods

#

like if an argument is null, (and cannot be), throw the NPE with the custom message

candid galleon
#

that makes more sense

candid galleon
#

IntelliJ's just annoying with it suggestion

south onyx
#

and would it also check if the entity is in their line of sight?

paper viper
#

and sees that the method can return null

paper viper
#

so it just does that

candid galleon
#

¯_(ツ)_/¯

#

thanks for the explanation

paper viper
#

i mean.. you shouldnt ignore them either

candid galleon
#

well lik

paper viper
#

and doing a simple conditional like if (world == null)

candid galleon
#

event.getLocation().getWorld()

paper viper
#

should make it go away

#

Yeah

#

oh in that case

candid galleon
#

i dont really see how it could return null

#

just annoying lol

paper viper
#

that can return null..?

candid galleon
#

according to IJ

#

🌚

paper viper
#

maybe you could initialize a location with a null world?

#

idk

candid galleon
#

probably

#

definitely shouldn't be able to call a CreatureSpawnEvent with a null world though

scarlet cape
#

The server doesn't enable my plugin. (It doesn't even try).

#

Main class:

package me.FarrosGaming.SpawnPillager;

import org.bukkit.plugin.java.JavaPlugin;

import me.FarrosGaming.SpawnPillager.commands.PillagerCommand;

public class Main extends JavaPlugin {
    @Override
    public void onEnable() {
        new PillagerCommand(this);
    }
    
    @Override
    public void onDisable() {
        
    }
}
#

Command Class:

#
package me.FarrosGaming.SpawnPillager.commands;

import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;

import me.FarrosGaming.SpawnPillager.Main;

public class PillagerCommand implements CommandExecutor {
    private Main plugin;
    
    public PillagerCommand(Main plugin) {
        this.plugin = plugin;
        plugin.getCommand("chase").setExecutor(this);
    }
    
    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        
        if (!(sender instanceof Player)) {
            sender.sendMessage("Only players who can send this command.");
            return true;
        }
        
        Player player = (Player) sender;
        Location location = player.getLocation();
        World world = player.getWorld();
        
        for (int i = 0; i < 10; i++) {
            world.spawnEntity(location, EntityType.PILLAGER);
        }
        
        return false;
    }
    
}
#

plugin.yml:

name: SpawnPillager
version: 1.0
author: FarrosGaming
description: blabla
main: me.FarrosGaming.SpawnPillager.Main

commands:
  chase:
    description: Spawn pillager in your location
    usage: /chase
#

No errors

#

No "INFO" for enabling the plugin

candid galleon
#

send the jar?

#

and can we see the plugins folder?

scarlet cape
#

ok

#

here

candid galleon
#

oh wait

#

what server version are you using?

scarlet cape
#

1.16.5

candid galleon
#

right

#

add api-version: 1.16 to the plugin yml

scarlet cape
#

lemme try

scarlet cape
candid galleon
#

correct

#

just 1.16

scarlet cape
#

ok

stone light
#

I'm getting this error when I start a server with my plugin
Fatal error trying to convert TerrorGames v1.0:me/TerrorGames/SurvivalGames/Main.class
java.lang.IllegalArgumentException: Unsupported class file major version 8243
can anyone help?

south onyx
#
@EventHandler
    public void onInteract(PlayerInteractEvent e) {
        Player player = e.getPlayer();
        Vector playerLookDir = player.getEyeLocation().getDirection();
        Vector playerEyeLoc = player.getEyeLocation().toVector();
        for (Entity entity : player.getNearbyEntities(20, 20, 20)) {
            Vector playerEntityVec = entity.getLocation().toVector().subtract(playerEyeLoc);
            float angle = playerLookDir.angle(playerEntityVec);
            if (angle < 0.2f) {
                entity.setFireTicks(4);
            }
        }
    }
#

code i have rn

#

it sets the cow on fire when i look at it

#

but it even sets it on fire when there are blocks in between me and the cow

south onyx
#

any way to get all blocks in a 20 block radius?

tacit drift
#

maybe you are using a older java ver on your system

#

and a newer one to compile the plugin

scarlet cape
candid galleon
#

what is your plugin yml?

scarlet cape
#
name: SpawnPillager
version: 1.0
author: FarrosGaming
description: blabla
main: me.FarrosGaming.SpawnPillager.Main
api-version: 1.16

commands:
  chase:
    description: Spawn pillager in your location
    usage: /chase
#

here, @candid galleon

candid galleon
#

hm

#

nothing in logs?

scarlet cape
#

nothing

#

no error or info

candid galleon
#

can you send them just in case?

scarlet cape
#

send what?

candid galleon
#

the logs

scarlet cape
#

wait

#

after world generation:

Time elapsed: 2002MS
Done (12.729s)! For help, type "help"
candid galleon
#

...

#

no like

#

the full logs

scarlet cape
#

ok

#

How can I copy all of the logs, tough?

#

there it is (More than 2000 characters)

#

@candid galleon

#

@candid galleon it might be an error here "Could not load 'plugins\PillagerChasing.jar' i
n folder 'plugins''"

candid galleon
#

So

#

There was an error

scarlet cape
#

Could not load 'plugins\PillagerChasing.jar' i
n folder 'plugins'
org.bukkit.plugin.InvalidPluginException: java.lang.UnsupportedClassVersionError
: me/FarrosGaming/SpawnPillager/Main has been compiled by a more recent version
of the Java Runtime (class file version 59.0), this version of the Java Runtime
only recognizes class file versions up to 52.0

#

@candid galleon what is this even mean?

candid galleon
#

so there was an error

#

:/

scarlet cape
#

please help me

candid galleon
#

Your server is running an outdated Java version

#

And you’re combining with an updated version

scarlet cape
#

so, I need to update java?

candid galleon
#

Either down compile or update the Java

scarlet cape
#

ok, so I need to update java

quaint mantle
#

k

scarlet cape
#

@candid galleon

candid galleon
#

What’s your %JAVA_HOME% pointing to?

scarlet cape
candid galleon
#

Google

quaint mantle
rotund pond
#

Hello everyone !
I'm trying to create an enumeration with all my inventories for a plugin... But I don't know if it's possible...

#

Does this work ? Or is there an other way to do ?

public enum PunishEnum {

    TEST(Bukkit.createInventory(null,54));

    private final Inventory inventory;

    PunishEnum(Inventory inventory) {
        this.inventory = inventory;
    }

    public Inventory getInventory() {
        return inventory;
    }
}

chrome beacon
#

If it doesn't you can use static variables instead

ivory sleet
rotund pond
#

I mean

ivory sleet
#

Also haven the suffix name Enum is somewhat redundant

rotund pond
#

If I have only 3 inventories it's okay, but what if I have 1000 inventories ?

#

Enums will be easier to setup i guess

ivory sleet
#

Registries

chrome beacon
#

This ^

rotund pond
#

Registries ?
I don't know what it is, gonna look up, thank you 🙂

ivory sleet
#

Basically you back yourself on a Map or BiMap and then you have some methods like register getByName getByValue

rotund pond
#

Yeah that's what I'm reading

#

Thank you 😮

ivory sleet
#

👍

burnt current
#

i have a question: Is it possible to temporarily save messages from the chat in Minecraft and translate them with the Google translator?

cinder thistle
#

That’s many questions lumped together:

cinder thistle
#
  1. is it possible to change a message in chat before people see it?
  2. how can I use google translator with Java?
#

and really I wouldn’t use google translate

candid galleon
#

you can cancel messages and then send them once they're translated

drowsy helm
#

Anyone know how to add additional methods to a lombok superBuilder?

#

been searching everywhere cant find an answer

burnt current
burnt current
chrome beacon
#

Google usually has good docs for their APIs

#

So find that

candid galleon
#

delombok

burnt current
candid galleon
#

funny

cinder thistle
#

People tend to use google’s not because it’s good but because it’s easy to access

#

It’s not bad there’s just better

burnt current
#

OK
can you get the api from it somehow?

candid galleon
#

you have to use google's api

burnt current
#

if i want to use deepl translate?

candid galleon
#

you google "deeptranslate api"

#

and use that

opal juniper
#

Hmm, I notice that most of the translation APIs are paid and I understand why but is there like some library so I can run the translation locally?

echo ether
#

Is there any problem to build 1.8.8 on Windows 10?
difflib.PatchFailedException: Incorrect Chunk: the chunk content doesn't match the target

opal juniper
#

I’m assuming this is build tools? @echo ether

burnt current
echo ether
#

I've tried to build on Ubuntu and Debian too but the result was same as Windows 10.

opal juniper
#

Hmm idk then

tired spoke
#

someone can link me how to use NSM to add 1.8 support to a 1.12.2 plugin

#

or everything you can suggest for me

echo ether
# opal juniper Hmm idk then

After some searching and testing on my VPS, the problem caused due to internet provider or the country by itself. I know it sounds ridiculous but I am 100% sure about it.

tacit drift
#

can i make a plugin prevent accesing an event?

#

without modifying the plugin or the plugin that has that event

candid galleon
#

what do you mean by prevent access

tacit drift
#

So

#

let's say that a plugin listens for UserBalanceUpdateEvent from essentials

#

how can i prevent that plugin from listening for UserBalanceUpdateEvent

opal juniper
#

how can i get this:
import org.apache.tiki.language.LanguageIdentifier

#

I am trying to google it but can't find it

eternal oxide
tacit drift
#

😢

eternal oxide
#

Well, perhaps take a look at the event Handlers. You could unregister a listener

wild moon
#

Hey everyone
I'm trying to set the pickup status of an arrow. Currently, I'm doing:
Arrow arrow = p.launchProjectile(Arrow.class); arrow.setPickupStatus(PickupStatus.DISALLOWED);
but I can't get it to work. Applying effects to it doesn't work either. Has someone an idea why this is not working?

bitter ridge
#

Can you make a npc with pathfinding? Basicly I want to make custom mob with player skin. Mob that I can attack and it can attack me

gaunt relic
# bitter ridge Can you make a npc with pathfinding? Basicly I want to make custom mob with play...

Here's a tutorial on how to do it using nms https://www.spigotmc.org/threads/how-to-create-and-modify-npcs.400753/ but I highly suggest you find an API for that like citizens

wild moon
#

Hey everyone
I'm trying to set the pickup status of an arrow. Currently, I'm doing:

Arrow arrow = p.launchProjectile(Arrow.class); arrow.setPickupStatus(PickupStatus.DISALLOWED);

but I can't get it to work. Applying effects to it doesn't work either. Has someone an idea why this is not working?

(repost since I didn't verify my account before)

torn shuttle
#

I didn't even know there was a pickup status method, I've just been setting the pickup delay to a value beyond what the arrow's duration is

wild moon
#

Hmm... I can't set any properties of the arrow. I don't know what I'm doing wrong xD

#

At least it has no effect

summer scroll
#

If I have a timer task inside a method and I return inside the timer task, will the task stop or cancelled?

#
    @Override
    public void load() {
        Common.runTaskTimerAsynchronously(0, (20 * ConfigValue.SALARY_MODE_ANNOUNCE_EVERY), () -> {
            if(!ConfigValue.SALARY_MODE_ENABLED) return; // will this make the task stop?
        });
    }
#

the method will be called onEnable

opal juniper
#

no

#

it will just stop that time, but the other ones will still run

#

cancel() will cancel the loop

summer scroll
#

alright thanks

#

just making sure

opal juniper
#

cool

#

Ok, so this is basic java probably but idk what to do.

I have a StringBuffer that contains this text:
{'translations': [{'detected_source_language': 'EN', 'text': 'Hallo Mein Name ist Ollie!'}]}

How can i access the text

mellow fox
#

anyone has a good free 1.16.5 vehicle plugin in mind?

coral sparrow
#

You cant like summon cars lmao

#

you need to get a mod

#

not plugin

#

bukkit cant make a custom item

#

forge mods can

mellow fox
#

@coral sparrow

mellow fox
#

read it

coral sparrow
#

this is literally different than what you call a "forge mod"

mellow fox
#

this. is. a. spigot. plugin.

#

plugins work

coral sparrow
chrome beacon
#

Yeah that's a bunch of armor stands

coral sparrow
#

yes

mellow fox
#

yes

coral sparrow
mellow fox
#

i asked for a plugin, then u said i need a mod

coral sparrow
mellow fox
#

i have a public server

#

i cant make people download mods

coral sparrow
#

wtf lmao

mellow fox
#

i simply asked for a free plugin, nothing else

coral sparrow
#

just using blocks

coral sparrow
mellow fox
coral sparrow
#

its good ryt

mellow fox
#

i dont have money

coral sparrow
summer scroll
#

can someone help me creating .gitignore in intellij?

chrome beacon
summer scroll
#

idk how to create it

#

i want some folders that will be ignored when pushing to the git

chrome beacon
#

Also there's a .ignore plugin

summer scroll
chrome beacon
#

Create a .gitignore

summer scroll
#

what, there is .gitignore in .idea

quaint mantle
#

Hello i'm new in the development, so I registered my "api" in my onEnable, but how can I acces it from other functions?

public class Main extends JavaPlugin implements Listener {
    
    
    @Override
    public void onEnable()
    {
        RegisteredServiceProvider<LuckPerms> provider = Bukkit.getServicesManager().getRegistration(LuckPerms.class);
        if (provider != null) {
            LuckPerms api = provider.getProvider();
        }
        getServer().getPluginManager().registerEvents(this, this);
    }

    
    
    
    @EventHandler
    public void onChat(AsyncPlayerChatEvent  e)
    {
        Player player = e.getPlayer();
        User user = api.getPlayerAdapter(Player.class).getUser(player);
        String prefix = user.getCachedData().getMetaData().getPrefix();
        System.out.println(prefix);

    }
}

#

I can't acces "api" in my onChat since it's registered in onEnable

#

anyone could help me?

coral sparrow
chrome beacon
quaint mantle
#

Thanks

tacit drift
#

@eternal oxide it worked, thanks!

raw swallow
quaint mantle
#

Hey guys, in java, can we use .replace(x, x1) if the x doesn't exist? I mean like if the x doesn't exist it'll raise an error or just pass?

#

?paste

queen dragonBOT
quaint mantle
#

Can you help me: here's my code and the error

raw swallow
quaint mantle
dusk flicker
#

?spoon

queen dragonBOT
#

Spoonfeed a newbie for a day and they'll come back with more questions. Teach them to find their own answers and you'll both be better off: you won't get stuck answering the easy questions and they'll be much more productive than before.

quaint mantle
#

My config looks like that:
format: "$prefix$ i'm new"

quaint mantle
dusk flicker
#

Stop spoonfeeding

eternal oxide
#

if you use replace and the search items is not in the string, the complete unchanged string is returned.