#help-archived

1 messages · Page 37 of 1

fading owl
#

whats the way

inland meteor
#

We can't help you block something if you don't tell us how to do it lol

hollow rivet
#

the wurst client thing only works if you have a cracked server with bad passwords or if you have no firewall protecting your bungeecord install

worn gate
#

Op-sign

fading owl
#

errr

worn gate
#

well it worked on my premium server

fading owl
#

so they just spawn in a sign

#

right click

#

and theyre op

worn gate
#

they use a wurst hack to get the command /op ThereName and they are op

fading owl
#

Why would you have such a plugin enabled in production?

inland meteor
#

nono, it's part of the hacked client lol

fading owl
#

My apologies

hollow rivet
#

the op sign thing also only works on vanilla mc it doesn't work on spigot

inland meteor
#

"only works on servers running Minecraft 1.8 - 1.8.5 without Spigot"

#

But yeah, I thought that worldedit thing got fixed...

#

it was a massive thing back in 2016

hollow rivet
#

yeah i'd be surprised if it wasn't fixed already but i have all the filters for it in place still from when it was a thing

#

the PEX bug was funny as well you could just type /pex and hit tab and the server would die

#

when pex was a thing

inland meteor
#

LMAO yeah

#

I remember the "PexCrashFix.jar"

#

haha

hollow rivet
#

lmao i didnt hear about that one i've just been using chatcontrol rules for everything

inland meteor
#

Yeah, someone got like a stupid amount of downloads for it bc no one could be bothered to fix it at first xD

boreal tiger
#

@radiant hollow do you use acf in plotsquared?

frigid ember
#

use FAWE to stop the calc thing

worn gate
#

so how can hackers possibly get op on my server if it is bukkit/spigot premium and i'm the only op

frigid ember
#

because op people are literally clicking on the signs which run a command

worn gate
#

so how can i block signs from being used ?

hollow rivet
#

have people actually gotten op on your server or are you just worried that it could happen

#

because if your server is premium then there isn't a way

worn gate
#

i have got 3 person which got op in the night

hollow rivet
#

do you use bungeecord

worn gate
#

how do i know ?

hollow rivet
#

if you don't know then you don't use it

#

i recommend looking in your servers log files

worn gate
#

i did

hollow rivet
#

search for the people who got op, see what commands they've been running

worn gate
#

i found the //evaluate with this

#

but b4 they got op

#

i think

hollow rivet
#

you can run the //eval and //calc stuff without being OP

#

did they actually show up in your OPs file or did they just say they have it

stark lodge
#

still plugin no work

worn gate
#

so how can i stop that shiit ?

#

i'll look

#

my modérators told me they were op

stark lodge
#

it prints out true for launch being null

worn gate
#

checking

hollow rivet
stark lodge
#
package com.lonnonjamesd.Launch;

import org.bukkit.plugin.java.JavaPlugin;

public class Main extends JavaPlugin {
    
    @Override
    public void onEnable() {
        // startup, reloads, plugin reloads
        System.out.println((this.getCommand("Launch") ==null));
        this.getCommand("Launch").setExecutor(new Launch());
    }
    
    @Override
    public void onDisable() {
        // shutdown, reloads, plugin reloads
    }
}
worn gate
#

do you loose op when u get banned ? They are not op on the file

stark lodge
#
package com.lonnonjamesd.Launch;

import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;

public class Launch implements CommandExecutor {
    
    // Launch command!
    public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
        if (sender instanceof Player) {
            Player player = (Player) sender;
            
            // /launch
            if (player.hasPermission("launch.use") || player.hasPermission("launch.*")) {
                if (args.length == 0) {
                    // launch normally
                    player.sendMessage(ChatColor.LIGHT_PURPLE + "Zoom boy");
                    player.setVelocity(player.getLocation().getDirection().multiply(2).setY(2));
                    
                    return true;
                // launch [number]
                } else {
                    // launch with the arg they sent
                    
                    player.sendMessage(ChatColor.DARK_PURPLE + "Zoom boy");
                    player.setVelocity(player.getLocation().getDirection().multiply(Integer.parseInt(args[0])).setY(2));
                    
                    return true;
                }
            } else {
            player.sendMessage(ChatColor.DARK_RED + "You don't have access to that boy!");
            }
        } else {
            Player player = (Player) sender;
            player.sendMessage(ChatColor.translateAlternateColorCodes('&', "&oConsole Goes Flying!"));
        }
        return false;
    }
}
#
main: com.lonnonjamesd.Launch.Main
name: LaunchPlugin
version: 0.1
author: LonnonjamesD
api-version: 1.15

Commands:
  Launch:
    aliases: lch
    usage: "/launch <number>"```
#

it does not launch

hollow rivet
#

no you don't lose op when you get banned, if they arent in your ops file it is likely they were never op

#

it's highly liekly they just did the worldedit crash exploit thing and pretended to be op and your mods got freaked out lol

#

there isn't a way to give yourself OP on a premium spigot server

frigid ember
#

unless you use like mcmyadmin and login to the default rcon password

hollow rivet
#

ye but i doubt thats the case here

frigid ember
#

it ismt, but its fun xd

stark lodge
#

my brain on no sleep

#

can someone explain why this plugin isn't working

boreal tiger
#

small thing: this kind of comment // /launch is unnecessary

stark lodge
#

e

#

it says line 11 is a null

frigid ember
#

did you add the command in plugin.yml as well

boreal tiger
#

whats on line 11? @stark lodge

stark lodge
#

this.getCommand("Launch").setExecutor(new Launch());

boreal tiger
#

can you send the full error please

stark lodge
wind peak
#

Hi guys, i have a question, i'm not an expert, but can i create a database on my vps where im hosting my servers too? I want to sync authme, skinsrestorer, fastlogin etc.. in the database.
I don't know if it's possible

stark lodge
boreal tiger
#

are you reloading?

#

also can we see your main class too pls

stark lodge
#

I've sent them both

#

scroll up

boreal tiger
#

I would recommend trying to restart the serrver though

#

instead of reloading

arctic cloud
#

yes @wind peak you definitely can

wind peak
#

Umh.. could you explain me how? D: @arctic cloud

stark lodge
#

I restarted and still same error

hollow rivet
#

Is it a Linux VPS?

wind peak
#

Yes

arctic cloud
#

well just install mysql

#

by apt or yum or if its different y the fuc did u choose it

hollow rivet
#

Yeah I was looking for that digitalocean post

arctic cloud
#

do note that a lot of stuff doesn't support MySQL 8.x so you might need 5.x I'd check with the plugins first

boreal tiger
#

@stark lodge whats this for? System.out.println((this.getCommand("Launch") ==null)); was this for debugging?

stark lodge
#

yes

boreal tiger
#

what is it printing

wind peak
#

Uh ok, btw i can follow this guide, ty

stark lodge
#

true

arctic cloud
#

np

hollow rivet
#

@wind peak which Linux distro do you use btw?

wind peak
#

CentOS 8 64bit

boreal tiger
#

Commands: in your plugin yml change it to commands:

#

yaml is case sensitive

#

@stark lodge

wind peak
hollow rivet
#

To be honest I’m using the newest mysql build and I haven’t ran into any plugin incompatibilities

wind peak
#

To be honest I’m using the newest mysql build and I haven’t ran into any plugin incompatibilities
@hollow rivet Okay, thanks to both😄

hollow rivet
#

np

arctic cloud
#

yeah @wind peak

#

np

vale slate
#

Ah ok, but i still have to check if plugins supports it, right?
@wind peak I don't think the syntax changed

tiny dagger
#

is Bukkit.getofflineplayer ever returning null?

vale slate
#

if there is no player with this uuid in the mojang auth

#

oh no it doesn't, then it just won't fetch the other data

arctic cloud
#

I mean

#

both MyBB & Pterodactyl Panel don't support it which are pretty big softwares so I wouldn't be surprised if some plugin made by joethecoder42069 doesn't support both

dusty topaz
#

why is it not ... aaaa

hoary parcel
#

I think I had to create a custom version

#

Aka clone 1.15 and Change the log4j config in the version.json or smth

#

Forgot how the launcher format works

dusty topaz
#

{"argument": "-Dlog4j.configurationFile=${path}", "file": {"id": "client-1.12.xml", in 1.15.2.json

#

smh

frigid ember
unique oyster
#

how can i get all persistent data values from the minecraft namespace?

vale slate
#

yes^^

unique oyster
#

i want to save all values from spawners, ...

#

to save it in the config

#

with the blockdata

frigid ember
#

get metadata save metadata?

unique oyster
#

how?

frigid ember
#

hmm

unique oyster
#

i need it for the whole block

dusty topaz
#

okay, it seems I can change the default .xml files - however, upon modifying them they like to change themselves back

#

I'll try removing that argument from the json

#

and see if it lets me use my own then

#

noope lol

#

i wonder what it's checking against - there is no JSON file even there now

#

Can confirm that changing the sha1 checksum & the filesize still does not let me just change the logging config

ocean prism
#

Hey, i've a problem : He tells me my task is still in progress while I cancel it :x

dusty topaz
#

Show code?

ocean prism
#

yes yes

#

The blue arrow it's when I stop my task

dusty topaz
#

I think you're starting them too close to each other

#

Try setting a 1 or 2 tick delay on starting again

ocean prism
#

I'm going to try this

dusty topaz
#

.-. I give up with logging

vale slate
#

yeah it's a mess in Spigot

ocean prism
#

AvroVulcan i've the same problem

dusty topaz
#

can you show the start code

#

just show the whole startingTask object class if possible

ocean prism
dusty topaz
#

I think you need to create a new instance of the runnable

#

and run it

#

every time you stop it

#

I don't think you can register / unregister over and over

#

keywords: I think

ocean prism
#

yes

vale slate
#

This scheduler stuff confuses me, I'm just running normal Threads and synchronize them

blissful verge
#

To _Novato

vale slate
#

uhm language

blissful verge
#

What?

vale slate
#

What are you doing? In which language you are working

ocean prism
#

donc work avrovulcan

blissful verge
#

Spigot?

#

I mean

#

Im doing this

        if (label.equalsIgnoreCase("Play"))
        {
            if (sender instanceof Player)
            {
                //player
                Player player = (Player) sender;
                if (player.hasPermission("play.use") == true)
                {
                    Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "lp user " + player + " parent add player");
                    player.sendMessage(ChatColor.BLUE + "You have been granted access to play the game.");
                    return true;
                }
                player.sendMessage("You do not have access to this command.");
                return true;
            }else {
                //console
                sender.sendMessage("ERROR: You are using the console for this command. It is only usable by players.");
                return true;
                
            }
        }```
#

And want the player to be _Novato

#

Not the thing it is now

#

So it can be used to type a command into console

little crater
#

player.getName()

blissful verge
#

thanks

gritty mulch
inland meteor
#

looks like your scoreboard plugin is broken potentially

#

you should be good to delete your scoreboard.dat from your world and it will reset the teams that have been generated by it

wanton delta
#

@ocean prism sorry to @ but i love that color scheme looks nice 😍

ocean prism
#

@wanton delta

gritty mulch
#

@inland meteor is it possible to see my scoreboards? I'd assume its a plugin that fires every so often causing it? I Only get kicked once an hour?

#

Also, If i delete the file, Is there anything saved important in the scoreboard.dat?

#

So it's safe to delete and nothing will be lost?

ashen stirrup
#

How do you update scoreboards? Whenever I set the score again it just duplicated on the scoreboard

chrome lark
#

You'd need to remove the old score

wanton juniper
#

Hey guys i really need help!
I am trying to open a spigot server so me and my friends can play on it.
but they can't join the server and when i checked in port checker it say's the port is closed.

I did portforward for minecraft with my ipv4 and checked if my friends can join with my external ip which didn't work so

I allowed all the java apps to communicate through windows firewall.

i added the rules of the ports to the inbound rules and outbound rules for tcp and udp for the minecraft port 25565.

and it still didn't work

so i called my internet provider and asked them what is the problem they went through all of my config for the port and if i messed up something there but they told me everything is okay and there isn't any problem in the config, i heard that sometimes the internet provider doesn't allow ports to go through but they said it isn't the case.

and so here i am with absolutely no idea what to do.

I would appreciate if someone can help me!

chrome lark
#

otherwise you're just adding new entries into the scoreboard

#

Now, the "no flicker" scoreboards, actually just abuse the prefix/suffix for the team and send a single update for it, vs a remove + add

ashen stirrup
#

Hm, I set the player's scoreboard to a blank scoreboard, set the scores and then set their scoreboard back to the normal one.

#
player.setScoreboard(blankBoard);

Score balance = o.getScore(Formatting.colorize("&2 &aBalance: &7£" + String.valueOf(MineTropical.playerEconomy.getConfig().getInt(player.getUniqueId() + ".econBalance"))));
balance.setScore(12);

Score rank = o.getScore(Formatting.colorize("&2 &aRank: &7" + VaultAPI.chat.getGroupPrefix(player.getWorld().getName(), VaultAPI.permission.getPrimaryGroup(player))));
rank.setScore(13);

Score nickname = o.getScore(Formatting.colorize("&2 &aNickname: &7" + player.getDisplayName()));
nickname.setScore(14);

player.setScoreboard(board);
dusky herald
#

@wanton juniper are you hosting from home?

wanton juniper
#

yes

dusky herald
#

and you are using a Router, correct?

wanton juniper
#

correct

dusky herald
#

Did you forward ports on your router?

wanton juniper
#

yes

dusky herald
#

on the correct address?

#

Here I'll PM you

wanton juniper
#

okay thanks

ashen stirrup
#

So, I'm removing the scoreboard, changing the scores and then setting the scoreboard again but it duplicates

#

No worries, fixed it

frigid ember
#

i got a problem with my spigot server, it says i need to active ip fowarding, i put true but it continues saying that

ashen stirrup
dusty topaz
#

do you have the repository added

ashen stirrup
dusty topaz
#

6.1 doesn't exist

#

in worldguard-bukkit

ashen stirrup
#

Oh oaky

dusty topaz
#

yes

hoary parcel
#

Why not 7?

ashen stirrup
dusty topaz
#

probably 1.8 developer

#

yes

#

knew it 😄

hoary parcel
#

Reeeee

ashen stirrup
#

xD

#

Still doesn't work 🤔

dusty topaz
#

looks fine, but I don't think WG 7.0 is on 1.8

ashen stirrup
#

6.1 is

dusty topaz
#

okay, so the groupId is com.sk89q

#

artifact id is worldguard

#

and version is 6.1

#

(i think)

ashen stirrup
#

Still red, maybe it's the repo?

dusty topaz
#

it can't be, since you can literally view everything

ashen stirrup
#

Hmm

finite belfry
inland meteor
#

@ashen stirrup IntelliJ?

ashen stirrup
#

Yeah

finite belfry
#

help my server just crashed

#

this is the log

#

help

inland meteor
#

Right click the project in the top left, go to maven, and go to reimport

finite belfry
#

someone ps

inland meteor
#

@finite belfry be patient lol

cinder schooner
#

Rayvel, is that a crash log or the latest log?

inland meteor
#

@finite belfry:

[13:46:05] [Server thread/ERROR]: [Multiverse-Core] The world 'skywars' could NOT be loaded because it contains errors and is probably corrupt!
[13:46:05] [Server thread/ERROR]: [Multiverse-Core] Try using Minecraft Region Fixer to repair your world! 'skywars'
[13:46:05] [Server thread/ERROR]: [Multiverse-Core] https://github.com/Fenixin/Minecraft-Region-Fixer
cinder schooner
#

That’s not a crash.

#

Multiverse just failed to load that world.

ashen stirrup
#

Cheers @inland meteor , worked!

inland meteor
#

Yeah, but I'm saying if it crashed and he's relying on that world, that could be why

#

Cheers @inland meteor , worked!
@ashen stirrup No worries 🙂 IntelliJ with maven has been stupidly glitchy recently for some reason recently (at least for me)

vague totem
#

Someone here that has a good price list for minecraft 1.15.2 signshops ?

finite belfry
#

@inland meteor umm this is the crash report

#

help

boreal tiger
#

be patient

frigid ember
#

Hello is there a plugin that allows you to change the loot from lapis ore to random ore (diamond, gold, iron, ...)

hoary parcel
#

Can do with a datapack

frigid ember
#

Where ? I do not know how to do :/

#

1.8 verion

hoary parcel
#

Oh

#

1.8

#

Lmao

frigid ember
#

yes

stark lodge
#

how to get the block name the user clicked with an event

finite belfry
#

so how do i solve this

#

Can't keep up! Is the server overloaded? Running 8377ms or 167 ticks behind

inland meteor
#

How much ram have you got on your server and what version are you running @finite belfry

finite belfry
#

1.15.2, Mem: 1.0GB used/3.4GB free/8.8GB max

#

@inland meteor

inland meteor
#

You don't need to @ me right after you send, I'm just looking into stuff

finite belfry
#

ok

stark lodge
#

do event listeners need something in a plugin.yml

inland meteor
#

no

#

you just gotta register them in your main class

#

how to get the block name the user clicked with an event
@stark lodge PlayerInteractEvent > event.getClickedBlock().getType().toString()

#

should work

finite belfry
#

so this is my console rn

inland meteor
#

so this is my console rn
@finite belfry "SuperLobby" is causing those errors

finite belfry
#

ok

frigid ember
#

@inland meteor Thank you !!!! 😄

inland meteor
#

@inland meteor Thank you !!!! 😄
@frigid ember No problem 🙂

proud lynx
#

is spigot expensive as I am thinking of opening a server

unreal hedge
#

Alrighty, so in my minigame framework, I am supporting multiple signs per arena. In my ArenaSign class, I could have multiple instances of the ArenaClass where everything is the same for signs with the same arena just a different location, or I could have a Set of Location instances and update those locations instead of querying multiple times in my ArenaSignHandler class. What would you lot suggest for the sake of readability? Multiple locations per ArenaSign instance? Or multiple ArenaSign instances for each new location?

#

I'm just on the fence, because of efficiency and readability -_-

inland meteor
#

is spigot expensive as I am thinking of opening a server
@proud lynx Spigot itself is free

proud lynx
#

oh

#

but why ppl says it isnt cheap

inland meteor
#

Because you need hosting to go along with it

proud lynx
#

?

#

wdym

unreal hedge
#

Hosting is cheap, depending on what you're after. To make a booming server with plenty of players, that isn't cheap. Takes much time and money to maintain it.

inland meteor
#

So you buy server space from a host, to run the spigot server on

unreal hedge
#

Either finding/hiring builders, hire artists unless you have talent and can do it yourself, developers unless you're a Java developer and have the time to do it all yourself

inland meteor
#

Like major said

stark lodge
#
    @EventHandler
    public void PlayerInteract(PlayerInteractEvent event) {
        System.out.println(event.getClickedBlock().getType().toString());
    }``` how to make it so this doesn't give me errors when it's air
inland meteor
#

if(event.getClickedBlock() != null && event.getClickedBlock().getType() != Material.AIR)

unreal hedge
#

Pretty sure there's a cleaner way, lemme see

inland meteor
#

oh wait

#

yeah

#

fuck

#

if(event.getAction() == Action.RIGHT_CLICK_BLOCK)

#

same with left click

unreal hedge
#

Yeah, that's the one

inland meteor
#

@stark lodge:

@EventHandler
public void PlayerInteract(PlayerInteractEvent event) {
    if(event.getAction() == Action.LEFT_CLICK_BLOCK || event.getAction() == Action.RIGHT_CLICK_BLOCK) {
      System.out.println(event.getClickedBlock().getType().toString());
    }
}
proud lynx
#

welp i dont know how to setup the spigot app

runic wadi
#

event.getClickedBlock() != null is this possible

unreal hedge
#

Or if you only want it to count if you punch or right click only, change accordingly.

inland meteor
#

Yes trapped, but Air still counts as not null I believe

unreal hedge
#

Apparently it is null, otherwise getType().toString() would just return AIR

inland meteor
#

ahh

frigid ember
#

is there a way to hide the NeutralPlasma issued server command: /login 123 from console?

inland meteor
#

I can never remember

frigid ember
#

getType().name()

unreal hedge
#

Well, for the sake of chunk loading/only updating signs that are loaded I'll go new ArenaSign instance per location

inland meteor
#

is there a way to hide the NeutralPlasma issued server command: /login 123 from console?
@frigid ember spigot.yml > Commands > log: false

frigid ember
#

thanks benh

stark lodge
#

how to make it so the plugin looks for chests with a certain item in them

inland meteor
#

What do you mean looks for chests

stark lodge
#

say I place down a chest anywhere

#

I place a shear in it

inland meteor
#

so you want it to check every chest?

stark lodge
#

then it turns that chest into a diamond block

inland meteor
#

or just when you place the item in

sturdy inlet
#

does anyone know how to set up viaversions 1.15 so 1.8 + can join

unreal hedge
#

You'll need an Inventory history per location.

#

If you want to support hoppers, furances etc as well.

stark lodge
#

when I place the item in

inland meteor
#

does anyone know how to set up viaversions 1.15 so 1.8 + can join
@sturdy inlet ViaVersion-Abstraction + ViaBackwards-Abstraction

unreal hedge
#

Didn't realize Abstraction was a thing tbh

inland meteor
#

lol

sturdy inlet
#

so i just get those and shoudl work

inland meteor
#

should do yeah 🙂

stark lodge
#

so how would I detect if someone put a certain item in a chest

neat orbit
#

@stark lodge i love ur pfp

stark lodge
#

ty

neat orbit
#

i'm getting a switch soon!

#

anyways, back to work

unreal hedge
#

InventoryClickEvent, check if the inventory is a 27 or 54 slots, but then you have the issue of custom inventories I suppose, you'd have to check the inventory name as well

#

But I suppose you need the Location as well

inland meteor
#

InventoryClickEvent, PlayerMoveItemEvent

unreal hedge
#

PlayerInteractEvent actually

#

Listen for interactions with chests.

stark lodge
#

can I get an explaination of what I do

neat orbit
inland meteor
#

What do you mean lopi?

#

When you first launch the server with this plugin, the config should load up

unreal hedge
#

InventoryHistory.java, store Map<Location, Inventory>, store in a config file, only load it when needed, don't immediately load into memory or that'll be too resource consuming

#

Fetch/store inventories when someone interacts with a chest (check with PlayerInteractEvent)

stark lodge
#

for me?

unreal hedge
#

Then you can grab the inventory by location whenever needed

#

Yes

#

I feel like there's an easier way to do this with world files though idk

stark lodge
#

I just want to put shears in a chest and it will do something

#

this is complicated

#

is there no way you can just listen to the chests the players are near

unreal hedge
#

Oh, I thought you just wanted to have a backup of the inventory for when your plugin turns it into something

#

So let me get this straight, you want it so whenever someone puts a particular item in a chest, that chest will change into another type of block?

stark lodge
#

or it will do something else like deleting the item in the chest or something, but yes

neat orbit
#

@inland meteor my plugins file is empty

#

which is why i want to copy it

inland meteor
#

did you get an error in the server log?

neat orbit
#

no

blissful verge
#

Is there any simple way of recording the number of blockx broken

neat orbit
#

the plugin doesnt even appear when i do /plugins

stark lodge
#

that means it didn't load

inland meteor
#

but yeah

#

that means that the plugin isn't loading

neat orbit
#

was that for me ben?

#

how to make it load 0:

unreal hedge
#

Okay, @stark lodge search for PlayerInteractEvent, listen for Action.RIGHT_CLICK_BLOCK

inland meteor
#

where is the jar file

neat orbit
#

in plugins

inland meteor
#

and there's no errors in your console?

unreal hedge
#

Make sure the block is a chest, cast it as a chest and grab the inventory, store the inventory instance within the class and in another class, listen for InventoryClickEvent, make sure the inventory viewers match.

inland meteor
#

Is there any simple way of recording the number of blockx broken
@blissful verge in code or with a pre-made plugin

stark lodge
#

how do you do that

neat orbit
#

@inland meteor let me check

stark lodge
#

cast it

unreal hedge
#

Upon InventoryCloseEvent, you no longer need the instance and can remove it.

stark lodge
#

jesus that still is complicated

blissful verge
#

Yeah but like how do I make it lol

unreal hedge
#

I mean, it's easy to get the inventory of a chest, but you'll need an event like InventoryClickEvent for whatever you're trying to do.

inland meteor
#

have a hashmap in your main class of <Player, int> then onblockbreak add one to their hashmap value, then ondisable save it in a .yml

dusky herald
#

Player and int?

dusky herald
#

Wouldnt it be better to use UUID and int?

blissful verge
#

hashmap?

inland meteor
#

I guess so @dusky herald, i was just trying to make it as easy as possible to write the base code lol

subtle blade
#

UUID and you can't use primitives as a generic type

dusky herald
#

True UUID and Integer

inland meteor
#

Yeah that's what i meant lmao, I just wanted to give them a rough idea of how to do it

unreal hedge
#

Then you'll want to create a List<Inventory>, store the inventories of chests players have interacted with from PlayerInteractEvent in there then on InventoryCloseEvent, go through all of the inventories in the List and check if the viewers match, if they do remove the instance from the list.

blissful verge
#

tf is a hashmap?

unreal hedge
#

Then on InventoryClickEvent, search the List of Inventories for the viewers that match the clicked inventory (to confirm it is a chest), actually you'd need the location I suppose so maybe a HashMap will do you better (HashMap<Location, Inventory>)

dusky herald
#

Also, using a HashMap to add ints seems bad, if you need to add more than one int, you could do something like

stark lodge
#

ok new plan

dusky herald
#

HashMap<UUID, List<Integer>>

inland meteor
#

@dusky herald it's just to track one number against a uuid

stark lodge
#

how do you get the nbt data of a block

inland meteor
#

they wanna track how many blocks broken

dusky herald
#

Just one number? Okay then

subtle blade
#

All NBT is hidden behind BlockState, Lonnon

unreal hedge
#

@stark lodge you want to listen for when a player puts something inside a chest, so you can turn that chest into another block, right?

dusky herald
#

They might want to track more data later, possibly so

#

They could create a custom PlayerData class, for example

stark lodge
#

Major, I'm doing this for fun, so that more complex than I need

inland meteor
#

Yeah, I was just going off what they wanted from the original question that's all

dusky herald
#

And add a field called blocksBroken (int)

stark lodge
#

so I'm just going to use a gui

#

a shit

dusky herald
#

Then refer to HashMap<UUID, PlayerData>

inland meteor
#

I do agree black, I was just trying to make it as simple as possible for them 🙂

dusky herald
#

I understand, I just think possibly the best or more efficient approach is good to try to instill into them as well.

stark lodge
#

how to decode block state

inland meteor
#

try

dusky herald
#

It's not too overwhelming anyways, unless they dont know Java.

subtle blade
#

What are you doing, Lonnon

stark lodge
#

getting the blockstate of a block

inland meteor
#

The only concern was that they hadn't heard of HashMaps, that's why I tried to keep it as simple as possible

subtle blade
#

Block.getState()

stark lodge
#

that's what I did

#

it gave me magic object

subtle blade
#

Yes. It would have given you a BlockState

stark lodge
#

how do I grab the nbt data out of that

subtle blade
#

Remove the concept of NBT from your mind. You're not interacting with NBT

#

It's all hidden behind the BlockState API

#

What is it you want to get?

sturdy inlet
#

hey i have viaversion and viarewind and it wont let me join with 1.8 i have a 1.15 server and i am trying to enable 1.8 to join

unreal hedge
#

I'll try make it simple. In a class ChestListener, create Map<Location, Inventory>, on PlayerInteractEvent, use event.getAction() make sure it == RIGHT_CLICK_BLOCK, get the block that was interacted with (event.getBlock() or whatever it is), then check if that is a Chest, if it is, cast (Chest) to the block state as per that link I gave you, then put the Chest's Location and use chest.getBlockInventory() and put that in as the value. Then on InventoryClickEvent, use entry set and listen for one of the entry's values inventories, get their viewers and find which one matches with the clicked inventory, (then you can assume it's a chest, and you have its location already), so if the particular item you are listening for is placed in the chest, you can set the block at the location as whatever. Then so you aren't flooded with instances in that map, use InventoryCloseEvent, loop through the values again and check if the inventory's viewers match, then remove it from the map.

#

That's as simple as I can put it.

dusky herald
#

Doesnt viaversion have a configuration guide?

stark lodge
#

I want to get the tag of the block to see if it has a tag noob with a value of 0

#

much grammar

subtle blade
#

So you want custom NBT. So instead of BlockState, you want its PersistentDataContainer

stark lodge
#

huh

wanton delta
#

He just said what u need

dusky herald
#

Its another fancy class to access persistent custom data

#

Emphasis on fancy

stark lodge
#

all these routes lead me down to hell

subtle blade
#

Get the block state, cast it to TileState (assuming it's a tile entity - because that's the only type of blocks that hold NBT)

#

Call that method and you may add or retrieve custom NBT values under the Bukkit namespace

stark lodge
#

/give @p dirt{BlockEntityTag:{Epic:0}} what is this called, bc it ain't a tilestate

subtle blade
#

That's not possible

unreal hedge
#

@sturdy inlet did you get ViaVersion Abstraction?

subtle blade
#

Dirt has no tile entity

dusky herald
#

That's not even a Bukkit command anyways

#

Lol

inland meteor
#

They got both Abstractions major

unreal hedge
#

oh

stark lodge
#

ok so use a chest

#

and give it whatever right?

subtle blade
#

Sure. Chests are tile entities, they hold NBT

stark lodge
#

ok how do I put nbt data on it

subtle blade
#

Using the method I described above

frigid ember
#

@inland meteor
You know a plugin for auto farm mobs a block that kills them automatically when they pass over them ?

unreal hedge
stark lodge
#

Get the block state, cast it to TileState (assuming it's a tile entity - because that's the only type of blocks that hold NBT)
Call that method and you may add or retrieve custom NBT values under the Bukkit namespace

subtle blade
#
TileState state = (TileState) block.getState(); // Again, this assumes it's a tile entity. Check first
PersistentDataContainer container = state.getPersistentDataContainer();
container.set(new NamespacedKey(yourPlugin, "YourTagKey"), PersistentDataType.INT, 0); // Setting it to 0
state.update();```
stark lodge
#

ok

#

Block block = (Block) event.getClickedBlock() this how you get block?

inland meteor
#

getClickedBlock already returns a block, so you shouldn't need to cast it

stark lodge
#

ok

subtle blade
#

The cast is unnecessary but yes

stark lodge
#

what is the yourplugin, yourtag key thing

subtle blade
#

Oh already mentioned that lol

inland meteor
#

the your plugin is an instance of your main class

subtle blade
#

yourPlugin is an instance of your plugin's main class. The one that extends JavaPlugin

#

The key is... well... the key

stark lodge
#

wdym

inland meteor
#

I was about to type about the key, but I have no clue how else to phrase it

subtle blade
#

An identifier. Just like any other NBT key

#

"NoAI" is a key, for instance

stark lodge
#

ok I understand

#

I still don't fully understand yourplugin thing

subtle blade
#

You have a class that extends JavaPlugin. That is your "main" class

stark lodge
#

yes

subtle blade
#

It should be an instance of that class

stark lodge
#

so put this event in main class

subtle blade
#

Ehm, well, yea that would work. Or you can pass your plugin's instance through the constructor of your listener class

stark lodge
#

new Main()?

inland meteor
#

Nono

subtle blade
#

You can't instantiate your main class. The classpath prevents you from doing that

#

You can pass your instance using this. This is basic Java you should seriously understand before making plugins

edgy bloom
#

A Bot for notify new Resources exist?

stark lodge
#

my brain is melted

subtle blade
#

No God no. That would be spammy as hell lol

#

I think you're underestimating how many new resources are created on any given day

stark lodge
#

it gives error for this

edgy bloom
#

Nonono Choco

#

Only a member

#

No all

inland meteor
#

To add to your server blu?

#

I guess that’s technically possible

subtle blade
stark lodge
#

this.main

edgy bloom
#

Yes, add the Bot to my server and notify when I upload or update resources

To add to your server blu?
@inland meteor

stark lodge
#

it gives me an error saying this is illegal in this case

inland meteor
#

I guess it’s possible

#

You’d have to write one for yourself I think

keen sky
#

Hi, I need a little help, how can I change the version of the spigot in multicraft?

acoustic falcon
#

Use a different spigot jar

keen sky
#

where can i download it

stark lodge
#

I don't understand choco

#

it says this is illegal

naive stratus
#

I asked in here yesterday, about controlling the dragon in the normal world. It seems that a bit of a challenge. But what about sending people to The End and resetting the battle when a new group enters, is that doable?

stark lodge
#

I read this doc I don't understnad

acoustic falcon
#

If you’re doing new main(); you are creating another instance of Plugin

#

Which is not allowed

#

And will throw an illegal exception

#

Instead you can use JavaPlugin.get(main.class); (not sure if it was JavaPlugin or just Plugin)

#

But, you shouldn’t name your main class main, and for classes you should be using UpperCamelCase

#

@stark lodge

stark lodge
#

that's what I did

#

also the method get is not a thing for javaplugin

#

and plugin

acoustic falcon
#

@naive stratus that seems like a pretty simple task to do with a custom plugin

keen sky
acoustic falcon
#

Rename your jar fe to spigot.jar

#

File*

keen sky
silk bane
#

clearly you haven't

acoustic falcon
#

Is it in the correct directory?

stark lodge
#

how tf do I get plugin

acoustic falcon
#

Wait are you trying to get a plug-in instance from the main class?

stark lodge
#

yes

acoustic falcon
#

You literally use

#

This

#

That is all

stark lodge
#

I did

keen sky
stark lodge
#

and it says no

acoustic falcon
#

Send me a snippet of the code

stark lodge
#

if I cast it, I get 10 billion other errors

keen sky
#

🥺

acoustic falcon
#

@keen sky send me the script that’s starts the server up

#

@stark lodge is that in your main class?

stark lodge
#

no

acoustic falcon
#

This refers to the current class you are in

#

So you have to get an instance of main by saying

stark lodge
#

this code is in TestListeners

acoustic falcon
#

Plugin.getPlugin(Main.class);

#

Replace Main with your main class name

stark lodge
#

getPlugin is undefined

keen sky
#

this is all files of my multicraft

stark lodge
#

still undefined

acoustic falcon
#

It should be JavaPlugin.getPlugin();

stark lodge
#

that fucks up my main calss

acoustic falcon
#

Hm

#

No?

#

How?

vernal basalt
#

Anyone has this problem?

#

Disconnecting com.mojang.authlib.GameProfile@4323dcb[id=5,name=f1r,properties={},legacy=false] (): Failed to verify username!
[17:54:45 WARN]: Exception verifying f1
java.lang.IllegalArgumentException: Name and ID cannot both be blank

#

Any workaround?

acoustic falcon
#

Restart usually fixed my problem

#

I’ve had that a few times

#

Hm

vernal basalt
#

I restarted the server multiple times

acoustic falcon
#

@keen sky is there some setting in multi craft to select the jar

#

@stark lodge how would that mess up your main class? It gets an instance of your main class

stark lodge
#

cannot innieiate thing

chrome lark
#

have to be careful where you use that

acoustic falcon
#

You can also use dependency injection

stark lodge
#

how

chrome lark
#

tryna shove that in your own main class or something pulled up before the plugins class is actually fully initialized will cause issues

keen sky
#

I replace the spigot file for the new, But it won't let me select the new file, it's like it doesn't exist

stark lodge
#

what was I even doing

acoustic falcon
#

Dependency injection is when you pass an instance of your main through a constructor

stark lodge
#

I just moved it to my mian class

#

I'm not doing bs

acoustic falcon
#

@keen sky unfortunately, I am not super expirenced with multi craft. I’m not sure if there is an extra step

keen sky
#

Okay, thanks

#

:C

humble creek
#

So i was wondering can i edit the displayname of EntityPlayers (Above there head?)
in a different way then editing there gameprofile name
because that is only 16 chars long

mossy crane
#

I want to make a placeholder in PAPI, how do I do that?

frigid ember
#

**Hey everyone. **

Looking for a developer who had custom code/develop my own practice server. Any dev experience/practice server experience wanted.

Money to be made.

Message me.

Thanks,

George

mossy crane
#

This is not what this channel is for

#

also, why do you seperate each line like that

#

🤢

#

?services

worldly heathBOT
mossy crane
#

@frigid ember

frigid ember
#

Apologies, was hoping to find someone on here but no worries

stark lodge
#

Could not pass event PlayerInteractEvent to GuiTestPlugin v0.1 org.bukkit.event.EventException: null how to make it give this error when I open the chest

#
    @EventHandler
    public void PlayerInteract(PlayerInteractEvent event) {
        System.out.println("Ran");
        if(event.getClickedBlock() != null) {
            System.out.println(event.getClickedBlock().getType().toString());
            Block block = event.getClickedBlock();
            Chest chest = (Chest) block;
            Player player = event.getPlayer();
            if (block.getType() == Material.CHEST) {
                if (chest.getCustomName() == "Epic") {
                    player.sendMessage("end");
                }
            }
        }
    }```
inland meteor
#

getCustomName can be null

subtle blade
#

And you cannot compare Strings with ==

#

Those should be .equals() compared

chrome lark
#

needs more .intern()

#

runs

subtle blade
#

Do "Epic".equalsIgnoreCase(chest.getCustomName()) and it will be null safe

chrome lark
#

But, yea, can't use == for stuff like that, also, don't really see where that could NPE

subtle blade
#

getCustomName() is nullable

chrome lark
#

The code running in your server is probably outdated

#

null == "String" would not result in an NPE

subtle blade
#

Yea but it also just wouldn't work lol

inland meteor
#

"Epic".equalsIgnoreCase(chest.getCustomName()) I never thought to do it this way ... :oo idk why

chrome lark
#

oh

inland meteor
#

that logic just didn't hit into my mind lmaoooo

chrome lark
#

You misread what I saw saying

inland meteor
#

I forgot that would be nullsafe

chrome lark
#

I was saying that I don't see where that block of code would NPE

subtle blade
#

I don't personally like that look of it but it's null safe because you're operating on a literal

inland meteor
#

Yeah

chrome lark
#

Also, actually

#

That will cause a CCE

#

You can't cast a Block to a Chest, etc

subtle blade
#

Good catch ;P

stark lodge
#

btw it still gives me an error

subtle blade
#

That will cause a CCE
You can't cast a Block to a Chest, etc

stark lodge
#

how fix

tiny dagger
#

you need to cast its data

frigid ember
#

anyone knows any good wildtp/rtp plugin for 1.15?

tiny dagger
#

or state

#

not sure where the data for chest is hold

stark lodge
#

I give up for today

tiny dagger
#

lol that easy?

#

the only way to get better at something is to keep trying

stark lodge
#

I spent a lot of the night coding plugins

#

and I'm tired

mossy crane
#

Any way to keep data (without external files) across server reboots?

subtle blade
#

How do you expect that data to remain persistent without writing it to file?

mossy crane
#

Exactly what I'm saying

#

Client says that it's possible

subtle blade
#

Yeaaaa... you can inform them that it most definitely isn't ;P

#

That being said, there are some forms of data you can sneak into Minecraft's files

#

i.e. the persistent data containers are written to NBT

mossy crane
#

I need to store a player with a number value

subtle blade
#

If you're on modern versions, NBT might be useful for that

#

If not, then yea you're going to need to write to file

mossy crane
#

nop, 1.8

subtle blade
#

Files it is!

mossy crane
#

im just gonna use arraylist and have it clear on reboot

#

can arraylist store a player and an associated integer?

subtle blade
#

Map would be better here. Map<UUID, Integer>

radiant pollen
#

You'd want a map

final verge
#

Also chest names can be changed in an anvil 😉 so i can just rename a chest to Epic and get access to whatever effects i want anywhere

vale slate
#

nbt

blissful verge
#

Is there a way to increase max enchant level?

dusty topaz
#

what would you mean by increasing it

#

how it looks in an enchant table?

#

or just applying efficiency 999 on your pick

blissful verge
#

Like you know that you enchant in enchant table like eff 10

#

or smthing

mossy crane
#

Why does map create so much fucking code?

vale slate
#

????

radiant pollen
#

@mossy crane what

agile rock
vale slate
#

use the HashMap not the Map interface

radiant pollen
#

Yeah, Map is an interface.

vale slate
#

@mossy crane

mossy crane
#

All I want to do Is store a player and an integer

final verge
#

You want to use map? wot

radiant pollen
#

@mossy crane Map<UUID, Integer> mymap = new HashMap<>();

vale slate
#

^

mossy crane
#

oke

#

thxx

final verge
#

ah

radiant pollen
#

Map is an interface, so you can't use it with new

final verge
#

i see what the issue was xD trying to make an instance of an interface

vale slate
#

or Map<Player, Integer>, but then it's not serializable any more

radiant pollen
#

It's better to use UUIDs

#

AFAIK

meager lantern
#

It makes no difference whether you use UUIDs or players, as long as you remember to clean them up when the player leaves

vale slate
#

Disagree, it depends if you want to use more memory or more CPU

final verge
#

UUID's are almost always better to use

meager lantern
#

You aren't storing more data by storing the player as a key

#

You're storing the reference

radiant pollen
#

It's still just a reference to an object

#

No memory difference

meager lantern
#

Same goes for UUIDs

dusty topaz
#

only issue is player will leak more

#

if you forget to cleanup

vale slate
#

oh shit we are in Java, my fault

agile rock
#

D:

meager lantern
#

Yeah, but that goes for any issue when it comes to back code or forgetting to do things in code

#

If you're calling .getUniqueId() just to store the user and remove the user, then you might as well just use the Player as a key

#

Less calls to other methods and less overhead when it comes to reading the code

vale slate
#

I think it should not make any difference

#

beside the player reference updates more often

meager lantern
#

That doesn't make a difference again

#

You're still only storing the reference to the player object

#

So if it changes, the reference is still the same

radiant pollen
#

The player object can change all it wants but the reference doesn't.

#

It all just depends on if you need a UUID for working with files, database, etc more or if you actually need a Player object to work with.

meager lantern
#

Exactly that

#

But at times where you just need to interact with the player, I'd be using the player object

agile rock
neat orbit
#

when i put it in multicraft

blissful verge
#

uhmmm

neat orbit
#

ya?

blissful verge
#

What's wrong here:

   {
       if (Block.getType() == Material.COBBLESTONE)
       {
       int value = map.get(e.getPlayer());
        map.replace(e.getPlayer(), value + 1);
   }
   }```
#

Whole code (HashMaps):


import java.util.HashMap;

import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.plugin.java.JavaPlugin;

public class HashMaps extends JavaPlugin implements Listener {
   public HashMap<Player, Integer> map = new HashMap<>();
 
   public void onEnable() {
       getServer().getPluginManager().registerEvents(this, this);
   }
   
   public void onJoin(PlayerJoinEvent e) {
       map.put(e.getPlayer(), 0);
   }
   public void BBE(BlockBreakEvent e)
   {
       if (Block.getType() == Material.COBBLESTONE)
       {
       int value = map.get(e.getPlayer());
        map.replace(e.getPlayer(), value + 1);
   }
   }
}```
radiant pollen
#

@blissful verge Your issue is with Block.getType()

#

You need e.getBlock().getType() to get the type of block that was broken...

blissful verge
#

Wait no

#

thx

#

BUTT

#

How can I show these values lets say in the console and save these values?

tawny crypt
#

im having an issue can anyone help me solve i finally have players on my server but now that players are in sleep cycles are acting up going into a bed wont reset to day

#

??

radiant pollen
#

@blissful verge Bukkit.getLogger().info("message") for console message. If you want to save the values and keep the values after the server restarts, you need to use files. There's plenty of tutorials for YAML files for data storage.

neat orbit
#

guys

#

i downloaded this plugin and multicraft says it is too big

tawny crypt
#

@radiant pollen would you have any info on my question sorry to bother you ?

neat orbit
#

its only 4mb

radiant pollen
#

@tawny crypt One of the plugins you've installed is messing with the day cycle.

#

Check the configs for your plugins

tawny crypt
#

it works when im solo thats the weird part

radiant pollen
#

So people are in the bed but it won't switch to day?

tawny crypt
#

correct the light dims like its about too but then just stays night

#

and opens chat menu

radiant pollen
#

Is everyone in a bed?

mossy crane
#

How do I get the killer when someone dies?

radiant pollen
#

@mossy crane There's an event that let's you get killer.

tawny crypt
#

no just me sleeping i have it where the whole server turns to day if 1 goes to sleep

mossy crane
#

What event is it?

radiant pollen
#

@tawny crypt Then the plugin you're using to do that isn't setup right.

#

@mossy crane Learn to use the docs.

mossy crane
#

the docs are shit and you know it

radiant pollen
#

Haha no.

mossy crane
#

PlayerDeathEvent does not work

#

I can't pull anything from it

radiant pollen
#

@mossy crane EntityDamageByEntityEvent

blissful verge
#

Oh this shit complicated

radiant pollen
#

Check if final damage is greater than entity's health, if it is, damager is the killer.

blissful verge
#

I aint doing this complicated of shit

mossy crane
#

thanks

obtuse rose
#

Pterodactyl gang anyone?

radiant pollen
#

@blissful verge huh

mossy crane
#

Pterodactyl gang anyone?
@obtuse rose Yup, I'm a sysadmin

obtuse rose
#

yay xD

arctic cloud
#

I just wish it had a better theme by default rofl

neat orbit
#

How to add files above 2mb in Multicraft?

#

It says

#

The maximum size of one file is restricted by net2ftp to 2 MB and by PHP to 8 MB

obtuse rose
#

@neat orbit it's hosting company's multicraft or your own?

neat orbit
#

@obtuse rose hosting

#

It says by PHP 8mb so i should be able to add a 4mb file

obtuse rose
#

wait... so can you upload via FTP?

neat orbit
#

yes

#

supposedly

#

yeah i can @obtuse rose i just checked. yes.

radiant pollen
#

@neat orbit You'll need to connect with an FTP program

neat orbit
#

whats that then?

radiant pollen
#

like WinSCP

neat orbit
#

does my host provide me with one?

#

i have a mac.

mossy crane
#

FileZilla

radiant pollen
#

FileZilla

neat orbit
#

Okay

#

Is it provided by host or my own decision?

radiant pollen
#

Your host will provide you with the information to connect to the server

neat orbit
#

Okay

#

Thanks.

obtuse rose
#

@neat orbit your host should provide you FTP credential

radiant pollen
#

No, you can connect with any FTP client, but the information to connect is given by your host.

vale slate
#

^

neat orbit
#

okay

#

what is it called by a host? @radiant pollen @obtuse rose

#

like whats the formal name for it

mossy crane
#

@radiant pollen Can I just check if the final HP was equal to 0?

#

It's only for players

radiant pollen
#

@mossy crane No, the entity's current HP is the health before the damage. You need to check if their current health is less than the getFinalDamage()

#

@neat orbit Your host should have given you some information called FTP credentials

obtuse rose
#

hp - getFinalDamage() <= 0

mossy crane
#

hp - getFinalDamage() <= 0
@obtuse rose what

drowsy canopy
#

Hey guys. As i never used protcollib, i have a question. I would like to modify an item in player inventory (just want to change the current items model data). So i what is know: "PacketContainer setSlot = new PacketContainer(PacketType.Play.Server.SET_SLOT);" i have to send this. but i dont know any parameters. Anyone can help me with this?

mossy crane
#

I want to see if they're dead

radiant pollen
#

@mossy crane yes that's what that does

mossy crane
#

OHHHHH

radiant pollen
#

That will return true if the damage that they're being dealt will kill them.

mossy crane
#

ok

obtuse rose
upper hearth
#

If they're hp - the damage they took is less than 0 they're definitely dead

radiant pollen
#

less than or equal*

upper hearth
#

whatever lol

mossy crane
#

What does e.getEntity output?

#

an entity type?

radiant pollen
#

The Entity that was damaged.

#

Yes.

mossy crane
#

yea, I want that

radiant pollen
#

You'll have to check if it's a player.

mossy crane
#

if(e.getEntity() = Player)

#

doesn't work

inland meteor
#

if(e.getEntity() instanceof Player)

mossy crane
#

thanks

obtuse rose
#

or do e.getEntityType() pretty sure that's a thing

subtle blade
#

It is and if you're comparing to a Player, you should

#

It's the last entity in its hierarchy

mossy crane
#

?

subtle blade
#

That being said, an instanceof check is a lot more standard and likely a bit safer in the case of modded software

vale slate
#

instanceof is the official way to check before casting

obtuse rose
#

ah, he casting it?

mossy crane
#

How do I make a map accessable in all methods?

radiant pollen
#

@mossy crane public static

inland meteor
#

if its all methods in a class

#

private static

vale slate
#

public static and not final is discouraged (to Zaxarner)

inland meteor
#

if its all methods, you're better off putting it to private static and then having a method that returns it

keen sky
#

Does anyone know how to change the spigot version in multicraft?

#

i rlly need help

mossy crane
#

Will this work:

#
package tech.sshdoes.wantedlevel;

import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.plugin.java.JavaPlugin;

import java.util.*;

public final class WantedLevel extends JavaPlugin {
    @Override
    public void onEnable() {
        getServer().getConsoleSender().sendMessage(ChatColor.DARK_AQUA + "WantedLevel hast started - Made by SSH#4388");
        // Plugin startup logic
    }
    public static Map<UUID, Integer> mymap = new HashMap<>();
    @EventHandler
        public void onPlayerJoin(PlayerJoinEvent e) {
            Player p = e.getPlayer();
            mymap.put(p.getUniqueId(), 0);
    }
    @EventHandler
    public void onKill(EntityDamageByEntityEvent e){
        if(e.getEntity() instanceof Player) {
            Player p = (Player) e.getEntity();
            if (e.getFinalDamage() >= p.getHealth()){
                Integer currentLevel = mymap.get(p.getUniqueId());
                mymap.put(p.getUniqueId(), currentLevel+1 );
            }
        }
    }
}
inland meteor
#

are you using the map in any other classes

#

if not, set it to private

vale slate
#

why is everybody making their types final

subtle blade
#

Why wouldn't you?

inland meteor
#

.. ^

mossy crane
#

imma make it available in papi so I'll see

subtle blade
#

Plugin being final makes sense, listeners being final makes sense, commands being final makes sense

#

That Map should also be final by the way lol

inland meteor
#

lol

vale slate
#

yes it should, or private

mossy crane
#

what's the difference?

subtle blade
#

Also,

            Integer currentLevel = mymap.get(p.getUniqueId());
            mymap.put(p.getUniqueId(), currentLevel+1 );

No, this won't work

vale slate
#

final vars cannot be changed

subtle blade
#

NullPointerException waiting to happen

mossy crane
#

I set it to 0 as the player logs in

#

Won't that guarantee that doesn't happen?

subtle blade
#

Oh just saw that listener 😛

mossy crane
#

oke

#

so, that's fine

frigid ember
#

can someone change my nick to qbasty because I also changed it on spigot (i donated)

vale slate
#

move the class variables to the top of your class

subtle blade
#

Though to be honest, I'd remove that join listener and change those two calls to mymap.merge(p.getUniqueId(), 1, Integer::add);

mossy crane
#

Though to be honest, I'd remove that join listener and change those two calls to mymap.merge(p.getUniqueId(), 1, Integer::add);
@subtle blade I am very confused

#

THat code confuses me

#

move the class variables to the top of your class
@vale slate no

subtle blade
#

merge will map the player's UUID to 1, or, if the key already exists, get the existing value and apply the supplied function. In this case, it will add one to the existing value

#

So, add one to existing values or set to 1 if nonexistent

vale slate
#

@vale slate no
@mossy crane why

subtle blade
#

That way you're also not holding data for every single player when they join, only when you call upon it

mossy crane
#

I want to hold data

#

It's gonna be a star level

inland meteor
#

Though to be honest, I'd remove that join listener and change those two calls to mymap.merge(p.getUniqueId(), 1, Integer::add);
this line of code is beautiful - and I don't know why

mossy crane
#

So, when they join, it'll give them 0 stars

subtle blade
#

Java 8 is great 😄

ocean prism
#

Hi, I have a little problem, my timer here won't start, I've been at it since this morning.

silk bane
#

maybe it's because you cancelled it?

inland meteor
#

^

subtle blade
#

🤔

ocean prism
#

He not cancelled it

subtle blade
#

.cancel() would say otherwise

silk bane
#

it says cancel right there

inland meteor
#

.cancel();

vale slate
#

🤔 🤔

inland meteor
#

hahah

wanton juniper
ocean prism
#

but the .cancel isn't work

silk bane
#

sounds like it's working to me

inland meteor
#

But your problem is that it doesn't start?

ocean prism
#

No, wait 2 seconds

#

I don't have error

inland meteor
#

very confused lol

ocean prism
#

Yes sorry i've a very bad english x)

inland meteor
#

It's okay

ocean prism
#

When I .cancel() I didn't have error on the console

inland meteor
#

ok

#

What does "StartingTask" class extend?

ocean prism
#

But when I start a new Bukkit runnable after cancel, i've a IllegalStateException on the console

#

BukkitRunnable

#

check :

mossy crane
#

Though to be honest, I'd remove that join listener and change those two calls to mymap.merge(p.getUniqueId(), 1, Integer::add);
@subtle blade Doesn't work

#

My IDE says there's an error

subtle blade
#

What'cha got?

ocean prism
#

I can't stop my task, if I Bukkit.getServer().getScheduler().cancelTask(taskID); doesn't work, this.cancel() too, but I don't know why

subtle blade
#

Might not be using Java 8 (which you should)

mossy crane
subtle blade
#

OH. It's sum. Sorry

#

Integer::sum

mossy crane
#

So, this code adds one to the killers wanted level every time he kills someone? ```java
@EventHandler
public void onKill(EntityDamageByEntityEvent e){
if(e.getEntity() instanceof Player) {
Player p = (Player) e.getEntity();
if (e.getFinalDamage() >= p.getHealth()){
Integer currentLevel = mymap.get(p.getUniqueId());
mymap.merge(p.getUniqueId(), 1, Integer::sum);
}
}
}

subtle blade
#

No need for that currentLevel variable there anymore

#

Just the call to merge will do

#

You could remove the join listener as well

#

(I guess, unless you're using that value elsewhere)

mossy crane
#

?

subtle blade
#
            if (e.getFinalDamage() >= p.getHealth()){
                mymap.merge(p.getUniqueId(), 1, Integer::sum);
            }```
#

That's it

mossy crane
#

yup

#

oke

#

so, I want to set stuff like this:
0 Stars ✩✩✩✩✩
1 star ✯✩✩✩✩
2 star ✯✯✩✩✩
3 star ✯✯✯✩✩
4 star ✯✯✯✯✩
5 star ✯✯✯✯✯

#

And throw it to papi

#

I'm confused on how this works

neat orbit
#

@radiant pollen I have configured everything and added my server credentials, created a new site and I am about to connect when I receive the message saying that: this server does not support ftp over tls

#

what is the reason?

#

anybody can help me in general; i'm using filezilla.

keen compass
#

it means they don't support encryption

neat orbit
#

how can i fix it then? @keen compass

keen compass
#

if you have a host where they give you limited access, then its on your host to fix it

#

otherwise if you have full access, then you just need to change your configurations on the ftp server

#

but ftp is still usable even without encryption

neat orbit
#

how do i change my config exactly?

keen compass
#

depends which server software you are using to provide ftp, but if you have full access I would recommend using sftp instead

frigid ember
#

Hi I'm looking for a plugin that gives an anti-fall potion effect in the form of a consumable item or an orb

#

1.8

keen compass
#

good luck, 1.8 isn't supported anymore

#

should definitely upgrade since it is years old XD

#

and riddled with bugs

frigid ember
#

I saw a server having an anti fall orb

#

as soon as it is in the inventory the player does not take fall damage

neat orbit
mossy crane
#

How would I get the number associated with a player UUID in a map I made in another class?

#

got it

keen compass
#

then I doubt you are going to be able to do anything about it @neat orbit

neat orbit
#

@keen compass i guess i'll ask my host

keen compass
#

either complain to your hosting provider, accept you can't use encryption for ftp or change hosts

neat orbit
#

but it says

#

that my password and files will be sent over the internet

mossy crane
#
  1. why are you using multicraft
  2. why are you using hostinger
neat orbit
#

in clear over the internet

keen compass
#

in the clear yes

neat orbit
#

what does that mean exactly

#

@mossy crane they bad?

mossy crane
#

for mc, yes

neat orbit
#

: ( cant change it now

keen compass
#

it means if someone was sniffing your traffic, which is a man in the middle attack, they could see your credentials

neat orbit
#

oh lordy

#

ill ask my host

tawny crypt
#

@radiant pollen so i figured my issue out with the sleep thing its working great for everyone else but when it comes to me i cant sleep and switch day / ihave op so not sure if that could be it or not

radiant pollen
#

Yeah, probably a permissions problem.

#

Check the plugin you're using to see if there's a bypass permission or something similar.

tawny crypt
#

do you possibly know what plugin would have this permission im using essentials but only thing i see in config is if players are afk

radiant pollen
#

I know Essentials has a essentials.sleepingignored and a essentials.home.bed

#

I don't know if either of those would fix your issue.

sick spear
#

hey! Im trying to make a thing where i need the plugin to know if the player got kicked by a player or console, or if the player got kicked from server closing

#

Is there a specific reason that signifies the player got kicked from server closing

#

im basically trying to make it so if a server shuts down it automatically transfers the player to another lobby

dusty topaz
#
                sysout("here3");
                Check check = gson.fromJson(content, Check.class);
                System.out.println("here4");
#

gets to 3, but not to 4 - why is fromJson freezing me 😄

#

content is a string:

[{"minecraft.net":"red"},{"session.minecraft.net":"green"},{"account.mojang.com":"green"},{"authserver.mojang.com":"green"},{"sessionserver.mojang.com":"red"},{"api.mojang.com":"green"},{"textures.minecraft.net":"green"},{"mojang.com":"red"}]
dark shuttle
#

Its a json array?

dusty topaz
#

yeah

#

querying mojang api

#
public class Check implements MojangAPIResponse {

    private List<Map<String, String>> status;

}
dark shuttle
#

and what is Check class lol

#

oh

dusty topaz
#

Perhaps it has to be private Map<String, String>[] status;

#

noope made no difference

acoustic herald
#

Can i use .sk plugins?? how do they work?

dark shuttle
#
Check check = new Check();
check.status = gson.fromJson(content, List.class)

Idk lol, i didnt even see status field in your json response

frigid ember
#

they are not plugins

#

they are skripts

cosmic ridge
#

no

#

It doesn't save

radiant pollen
#

@cosmic ridge yes it does?

cosmic ridge
#

oh nvm

#

My didn't see the scroll bar

radiant pollen
#

@paper compass I would look into using a separate file instead of a config file for the player's info. I can't tell if you're already doing that with the code you provided, but yeah. You could also look into SQLite.

cosmic ridge
#

I don't think that would work in a server crash rn

radiant pollen
#

He has a save interval.

subtle blade
#

Mentioned this in #general but you moved here, so:

Recommend doing things through Vault

radiant pollen
#

But yes you should just call saveAll when the server stops.

subtle blade
#

Implement its Economy

#

Register it as necessary

dark shuttle
#

vault support multiple economy?

wanton delta
#

does anyone know if there is a way to call a PacketEvent?

dark shuttle
#

yes, send packet

wanton delta
#

figures. lol

runic wadi
#

wtf would be the point of a packetevent

#

events are in response to packets

wanton delta
#

yes i know

runic wadi
#

use the packet

#

lol

#

that is the event

wanton delta
#

i know

hot girder
#

Is there public 1.16 spigot jar?

wanton delta
#

no

runic wadi
#

no md_5 is hoarding it in a pile of spiders

hot girder
#

or spigot-api

#

fuh

wanton delta
#

there are no public spigot jars, actually

#

alright so heres my next questino

#

say i want to remove the glowing affect from a player that i added with a packet

#

anyone know how i would go about doing that>

frigid ember
#

why i cant pvp in the skywars game
(ProSkywars plugin)