#help-development

1 messages ยท Page 185 of 1

alpine narwhal
#

damn

fluid river
#

well i'm 19 and i think i sound like 19

tardy delta
#

someone has experience

fluid river
#

in smoking?

#

me

vocal cloud
#

How do you not have an accent

fluid river
#

call me lol

#

one sec

#

gonna switch to laptop with headphones

tardy delta
#

cmon man

quaint mantle
#

event.setCancelled(true);

alpine narwhal
#

player.closeInventory()

quaint mantle
#

i try

tardy delta
#

๐ŸŒ

alpine narwhal
#

Does your redwool one work?

#

HumanEntity#closeInventory is the only way to close a displayed inventory to a player.

zealous osprey
tardy delta
#

looking thro sqlite impl

zealous osprey
#

wait that's in the impl?

tardy delta
#

yep

zealous osprey
#

๐ŸŒ

tardy delta
#

always interesing

#

now i understand why its so slow

zealous osprey
#

Welp, not gonna deal with that, gonna go back making an ALU with logic gates, cya

last ledge
#

Inventory.getitem(material.iron).remove();

tardy delta
#

bruh private and public possible for a default method in an interface, but protected not ๐Ÿค”

alpine narwhal
#

Why would you need protected methods from an interface?

wary topaz
tardy delta
#

hmm fixed it

#

calling the method didnt work but doing MyInterface.method worked :/

worldly ingot
#

I still find a rare use case for private methods in interfaces

tardy delta
#

find out that i can just access it when it has no access specifier

#

im feeling like a noob now

charred blaze
#

if (Message.lastmessaged.containsKey(uuid)) { why is this check failing? im pretty sure there is that object in the map.

wary topaz
#

".lastmessaged" I think it's .lastmessage

charred blaze
#

no

#

its not

#

i have a hashmap named "lastmessaged" that stores last messaging players. "Message" is a class name

fluid river
ocean ginkgo
#

how do i get the block the player is looking at?

fluid river
#

and why are you coding on Java 8 for mc 1.19

fluid river
#

10 is search radius, so if block is 11 blocks away method would not return it

ocean ginkgo
#

ahh ok

dry forum
#

i have a bukkitrunnable which just runs code once, but i want it to run multiple times, but i also need to be able to run the runnable whenever i want, the bukkitrunnable has a .run() method but a bukkittask doesnt, any way around this or smthn?

alpine narwhal
#

then use the runnable?

fluid river
#

BukkitTask bukkitTask = bukkitRunnable.runTaskTimer(plugin, 0, 1);

#

int taskId = bukkitTask.getTaskId();

wary topaz
rough drift
#

if I pass in "" as a permission to hasPermission(String) would it return true or false?

wary topaz
#

I'm making npcs

ocean ginkgo
#

is there a way to add variables that are directly linked to the individual player?
basically i have been using the players XP as a variable that I can change and then read if statements from, and wanted to know if i could create a variable directly into the player class?

tardy delta
#

Make a wrapper

ocean ginkgo
#

so that i could do something like player.getMana();

#

alr

#

?wrapper

rough drift
#

what

#

no

#

that's not valid java

alpine narwhal
#

bros bout to learn what sessions are

ocean ginkgo
#

uh oh

rough drift
#

bro's about to learn how java works fr

#

?learnjava

undone axleBOT
rough drift
#

go ahead

ocean ginkgo
#

fun

rough drift
#

DAMN I TYPED THAT AS MY SONG SAID IT

#

but basically

#

you can't edit a class's functions unless you implement it yourself

#

which is annoying

tardy delta
#

Your song saying learn Java?

rough drift
#

you could just do

tardy delta
#

Damn song

rough drift
#

ManaManager.get(player);

rough drift
#

It said "go ahead" as I typed it

#

I I I got this feeling in my soul go ahead and throw your stones 'cause there is magic in my bones

wary topaz
rough drift
#

oh

#

it's simple

#

you didn't install the maven repo in your local repo

rough drift
#

you just need to install it in your local repo

wary topaz
#

Where do I download it

hazy parrot
#

will return true if player is op tho

wary topaz
#

also localrepo do you mean spigot-mc?

rough drift
#

local repo is located usually

#

C:\Users\user\.m2 windows
~/.m2 linux

wary topaz
#

Oh

rough drift
#

yeah

wary topaz
#

What do I download?

rough drift
#

you just need to run buildtools

wary topaz
#

I ran it already

rough drift
#

how did you run it

wary topaz
rough drift
#

build failed

#

do you even read the output

#

send me the command you used

wary topaz
#

java -jar BuildTools.jar

rough drift
wary topaz
#

Yeah I copyed the command from that

rough drift
#

download that

#

put it in a folder

#

and run the command

wary topaz
#

thats exactly what I did

rough drift
#

you can use standard cmd

#

I recommend administrator cmd on windows

#

works fine

wary topaz
#

oh alr

#

Is this a good start?

#

o its working- I think

#

uh it errored and closed

rough drift
#

run

#

java -jar BuildTools.jar && pause

wary topaz
#

alr

rough drift
#

if that doesn't work

#

java -jar BuildTools.jar ; pause

raw prairie
#

How can I check if the player entered a new chunk?

rough drift
#

there was an event for it

#

nvm

#

just use move event and check pre chunk and curr chunk

wary topaz
raw prairie
#

Can you give me a code example?

rough drift
#

Dude, help development is to help with development

#

what do you think this it?

wary topaz
#

says the 3 other people who gave me that

rough drift
rough drift
wary topaz
#

@rough drift

rough drift
#

?paste

undone axleBOT
wary topaz
#

oo

#

m

#

mb I didnt copy it correctly

rough drift
#

?help @wary topaz

#

?help

undone axleBOT
#
CafeBabe Help Menu
*Red V3*
**__Admin:__**

selfrole Add or remove a selfrole from yourself.

**__Cleanup:__**

cleanup Base command for deleting messages.

**__Core:__**

embedset Commands for toggling embeds on or off.
info Shows info about CafeBabe.
licenseinfo Get info about Red's licenses.
mydata Commands which interact with the data CafeBabe has about...
set Commands for changing CafeBabe's settings.
uptime Shows CafeBabe's uptime.

**__Downloader:__**

findcog Find which cog a command comes from.

**__Mod:__**

names Show previous names and nicknames of a member.
userinfo Show information about a member.

**__ModLog:__**

listcases List cases for the specified member.
reason Specify a reason for a modlog case.

**__Permissions:__**

permissions Command permission management tools.

rough drift
#

breh

#

nah that doesn't do everything

#

there is

#

?ask

undone axleBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!

rough drift
#

?paste

undone axleBOT
rough drift
#

?tas

undone axleBOT
rough drift
#

?services

undone axleBOT
wary topaz
rough drift
#

and some more

rough drift
wary topaz
rough drift
#

you where unable to download it somehow

#

I do not know how to fix that

wary topaz
#

How can I uninstall buildtools (To try to reinstall it again)

#

Because I think it messed up my maven

#

I cant use spigot-api anymore

#

Should I just delete everything inside of C:\Users\ethga.m2\repository\org\spigotmc?

#

and than reload maven?

fluid river
#

what;s the connection between "your maven" and build tools

wary topaz
#

because it installed alot of files and I think it did something with maven

fluid river
#

bt basically use maven to download sources

#

it doesn't modify anything on your pc

#

just downloads sources and build jar

quaint mantle
#

I need help with "Cuboids". I have this code: ```java
for (final Block block : cuboid.getFace(Cuboid.CuboidDirection.South).expand(Cuboid.CuboidDirection.South, 1)) {
Bukkit.getScheduler().runTaskLater(BasesPlugin.get(), new Runnable(){

        @Override
        public void run() {
              block.setType(Material.AIR);

}
}

fluid river
wary topaz
#

idfk

fluid river
#

you don't need buildtools to code and compile plugins

#

download paper for your server and test on it

wary topaz
#

ik but I want it to make npcs

fluid river
#

you want what to make npcs

wary topaz
#

buildtools

#

;-;

fluid river
#

hmm

wary topaz
#

YES

#

Nms

fluid river
#

oh

wary topaz
#

the installation process is too difficult

fluid river
#

CitizensAPI ๐Ÿ™‚

wary topaz
#

I like to challange myself, to only my plugins and no apis of anybody elses

#

besides plugwomen, vewwy useful

wary topaz
#

ill follow those steps, step by step

rough drift
#

or smt

#

like expand north?

wary topaz
#

When it finishes, what do I change my pom.xml ?

fluid river
#

or a wrapper

wary topaz
#

It doesnt tell me anything specific

fluid river
#

yes

fluid river
#

most of it

#

free java lessons

wary topaz
fluid river
#

i guess you need to figure it out yourself

#

use some logic

#

Analyse

#

umm

#

these are wrappers yeah

#

primitive type wrappers

#

but you can wrap objects

#
public class PlayerWithData {
    private Player player;
    private int mana;

    public PlayerWithData(Player player) {
        this.player = player;
    }

    public Player getPlayer() {
        return player;
    }
}```
wary topaz
fluid river
#

does your IDE show warnings? @wary topaz

wary topaz
#

Buildtools hasnt finished yet

fluid river
#

well you wouldn't have errors if you just added dependencies and they loaded successfully

#

i still don't get

#

why Ethan uses Java 8

#

for 1.19

#

well

#

there is a flag

wary topaz
#

I dont use java 8!

fluid river
#

which forces your server to run on java 8 even if it's 1.19

wary topaz
#

I use java 17!

molten hearth
#

backwards compatibility enjoyer

fluid river
wary topaz
#

where does it say that

#

oh

fluid river
#

look closer

wary topaz
#

how do I set that to 17

#

1.17?

#

or 17

fluid river
#

17

wary topaz
#

thank you

fluid river
#

Versions before Java 9 have 1. prefix

#

1.7

#

1.8

#

then 9 10 11

molten hearth
#

then we switched to 2.10 2.11

#

source: trust me

fluid river
#

haha

wary topaz
#

buildtools is still doin its thing

earnest lark
#

I want to make a list of constant letters that i can pull from for something how would i do that

fluid river
#

don't worry

#

it's always slow af

wary topaz
#

oh "Thats good"

earnest lark
#

Thatnks

fluid river
#

why do you even need this tho

#

i'm 100% sure you can do better

earnest lark
#

i want to make something and it needs constant lettrs

fluid river
#

??

earnest lark
#

i want to change messages and i want to check if they have a constant letter at the start of the word

fluid river
#

if your letter represents something from bukkit you'd better have FunctionalInterface or HashMap

earnest lark
#

its not a plugin

#

more of a project

fluid river
#

you can do

#

String.substring(0, 1).matches("A|B|C");

#

show me ur cringe code

earnest lark
fluid river
#

gonna do code review

hazy parrot
fluid river
earnest lark
#

gocha

fluid river
#

By adding another |Letter you can add more letters

earnest lark
fluid river
#

1, 2

earnest lark
#

why that?

fluid river
#

first number is inclusive

#

second exclusive

#

0 is first letter

#

1 is second letter

#

(0, 1) represents letter with 0 index

#

which is first

#

(0, 2) would represent letter with 0 and 1 index

earnest lark
#

so three would be (2,3)

fluid river
#

yeah

earnest lark
#

got it

#

tyhanks ^^

fluid river
#

map of Queues and types xD

#

why don't you make a Colorizer util class tho

#

to not write translateAlternateColorCodes everytime

#

here it is

#

tagged

#

with static import you can avoid writing class name when calling colorize method

earnest lark
#

how would i remove a letter from text

fluid river
#

you can use string.replaceFirst("letter", "");

#

or replace all letters with

earnest lark
#

nvm i got it

fluid river
#

or replace letter with given index to ""

#

int x, y, z; ya know

#

tho you should probably pay attention to varargs

#

not ArrayLists only

ocean ginkgo
#

i cant seem to make fallingBlock do damage

#

setHurtEntities(true);

#

isnt working

fervent gate
#

Is there a way to make an entity walk along a path like the one in this image?

fluid river
#

do damage on collision ๐Ÿ™‚

#

with task timer

fluid river
#

PathfinderGoal

#

Player...

#

args

#

sry messed up

ocean ginkgo
#

correcet me of im wrong but it hasnt been taken out ei its just a hollogram?

#

idk im new to this so

fervent gate
# fluid river NMS

Is there a good tutorial or docs on all of that? It seems very complex to figure out

wary topaz
#

I had to rerun the buildtools as my computer had a mandatory update

fluid river
#

he worked with pathfinder goals

chrome beacon
#

Protip when working with NMS you can often use Fabric and Forge guides

fluid river
#

protip don't use nms

#

cuz one day md_5 will visit you

opal juniper
fluid river
#

and bonk

fluid river
chrome beacon
#

I want to bonk whoever wrote the BlockExplodeEvent code

fluid river
#

preprocessor would eat this faster on compilation

#

1 nanosecond compilation time improvement

opal juniper
#

wow

fluid river
#

๐Ÿ™‚

opal juniper
#

except it screams "beginner dev who is trying to use less lines cause less lines = better code"

opal juniper
opal juniper
#

i assume u mean the impl olivo

chrome beacon
#

Yes

opal juniper
fluid river
#

event name?

ocean ginkgo
#

is there a event for fallingSand turning solid?

opal juniper
#

yeah

ocean ginkgo
#

i couldnt find it?

fluid river
opal juniper
#

its like blockToFrom or something

fluid river
#

just go to javadocs and search From

opal juniper
#

it has a terrible name

ocean ginkgo
#

got it

#

i was busy searching solidify and place

#

xd

fluid river
#

one of these

ocean ginkgo
#

ye

opal juniper
#

the latter

fluid river
#

nah both false

#

might be BlockPhysics tho

opal juniper
chrome beacon
#

Do you see the problem?

opal juniper
#

straight to capital punishment

ocean ginkgo
opal juniper
#

its EntityChangeBlockEvent

#

for falling blocks

fluid river
opal juniper
tender shard
#

yikes that's very ugly

fluid river
#

๐Ÿคฎ

chrome beacon
#

This allows it to get the blockList however it also means entities will be damaged and get kb even if the event is cancelled

opal juniper
#

yeah... i didn't really think about the fact that finalizeExplosion is called after explode

chrome beacon
#

Oh and the exploded block will be gone if cancelled

opal juniper
#

yeah, this wont be fixed though as it is expected behaviour now

chrome beacon
#

Also also the getBlock method in the event will always be air

wary topaz
#

Thank you for helping me install nms.

#

Everything works;

chrome beacon
#

Since the block is broken before event

#

So you have no way of knowing what exploded

fluid river
#

ez

opal juniper
#

also.. the explosion logic looks kinda expensive

#

idk

fluid river
#

which blocks do actually explode tho

#

bed in hell?

chrome beacon
#

Beds and respawn anchors

fluid river
#

what is a respawn anchor lol

opal juniper
#

๐Ÿ‘ต

fluid river
#

i see

chrome beacon
#

A block that allows you to respawn in the nether by giving it glowstone

fluid river
#

i just googled

ocean ginkgo
#

bros stuck in 1.15

fluid river
#

earlier

#

1.12

#

never played minecraft since

ocean ginkgo
#

damn

wary topaz
opal juniper
#

i was about to blast mojang for using their own custom MathHelper.floor method but then realised that Math.floor has like 3 method calls before some extensive logic

tender shard
wary topaz
opal juniper
#

does look fine to me at a cursory glance

wary topaz
#

Anybody have an idea?

fossil lily
#

Is it possible to detect if a player was killed by a player if it wasnt direct? Like they get hit, and then fall off a cliff.

chrome beacon
#

Try getKiller

tender shard
#

getKiller only works if the "last hit" was from a player

ocean ginkgo
#

so potion effects says it can only apply to living entitys, but is there another way to make it apply to other such as fallingsand?

fluid river
#

and getKiller()

tender shard
#

you'll have to listen to all damage events and then keep track of that yourself

chrome beacon
fluid river
tender shard
#

I'm mistaken very often lol

fluid river
#

listen for damageByEntity and damageByBlock

#

how is that even possible tho

#

to get damaged by block

fossil lily
fluid river
#

like when you are stuck in block?

fossil lily
#

nevermind

fluid river
chrome beacon
fluid river
#

well i guess there is no way to check if somebody made block explode to klll you

chrome beacon
fluid river
#

so just check EntityDamageByEntityEvent

chrome beacon
#

Which is how I found the absolute mess that is the BlockExplodeEvent

fluid river
#

and check if entity is a player

#

or entity is a projectile and it's launched by player

#

and so on

quaint mantle
#

?paste

undone axleBOT
fluid river
#

java cringe code in 3 2 1

quaint mantle
#

no bro

#

pls

fluid river
#

๐Ÿ˜ญ

#

paste it tho

quaint mantle
#

don't worry

wary topaz
chrome beacon
wary topaz
#

no sir

chrome beacon
#

Their API is great and you don't have to worry about version compatibility

fluid river
# fluid river java cringe code in 3 2 1
public class Main extends JavaPlugin implements Listener, CommandExecutor {
    
    @Override
    public void onEnable() {
        saveDefaultConfig();
        getServer().getPluginManager().registerEvents(this, this);
        getCommand("cringe").setExecutor(this);
    }

    @EventHandler
    public void onCringe(PlayerJoinEvent event) {
    
    }

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

    }
}```
wary topaz
#

ayo wtf

fluid river
#

citizens has a lot of good stuff which you won't even come up to when recreating it

#

also has own Event system

quaint mantle
fluid river
#

don't take this seriously

fluid river
#

with previous problem

wary topaz
#

me no use citizens me use nms

#

:>tee hee<:

fluid river
quaint mantle
fluid river
#

that was a joke lol

#

don't take internet guys seriously

quaint mantle
#

ok

fluid river
#

i'm not here to blame people for writing bad code, i offer FREE JAVA LESSONS instead(and spoonfeed sometimes)

wary topaz
#

plz help sir ๐Ÿ˜Š

#

also gimmie free java lesson

fluid river
wary topaz
#

you know what it is

fluid river
#

Is that still net.minecraft.server.ItemStack tho?

wary topaz
#

wdym

fluid river
#

i thought devs changed the way of handling NMS itemstacks

wary topaz
#

It gave me 2 options and I picked to import that

fluid river
#

well i'm wrong then

#

what is your current problem?

#

npcs?

wary topaz
#

yessir

fluid river
#

our java lessons have some influence i guess

wary topaz
#

?

fluid river
#

you are not nesting ifs

#

tho you are

#

why didn't you make the same thing for player

#

if (!(sender instanceof Player p)) return false;

quaint mantle
#

score.setDisplayName(getConfig().getString("Scoreboard-title")); what is wrong here?

wary topaz
#

because I dont set error messages until I fix the problom

fluid river
quaint mantle
#

ye

fluid river
#

what is the problem tho @quaint mantle

fluid river
#

u used wrong imports Ethan

quaint mantle
#

when i put text(not by config) they doesn't have problem

wary topaz
#

i did?

#

what do I fix

fluid river
#

Caused by: java.lang.IllegalArgumentException: Display name cannot be null

#

is that actually in the config

quaint mantle
#

bro

#

i have put s in upper case ๐Ÿ’€

fluid river
#

that's why i asked the question lol

quaint mantle
#

I didn't notice

fluid river
#

you used wrong import

#

or wrong class

wary topaz
fluid river
#

i guess MAIN_HAND

#

and OFF_HAND

wary topaz
#

ill try that

#

Cannot resolve symbol 'MAIN_HAND'

#

OFF_HAND worked

fluid river
#

Try HAND

wary topaz
#

bet

fluid river
#

and you imported wrong EquipmentSlot anyways

wary topaz
#

worked

fluid river
#

you need nms

wary topaz
#

O I did?

fluid river
#

not org.bukkit

#

and nms itemstack

wary topaz
#

How do I import the equipment slot?

fluid river
#

import net.minecraft.world.entity.EquipmentSlot;

#

ya know

quaint mantle
# fluid river that's why i asked the question lol

org.bukkit.configuration.InvalidConfigurationException: while scanning an anchor
in 'string', line 4, column 19:
scoreboard-title: &fPolar&2MC
^
expected alphabetic or numeric character, but found &(38)
in 'string', line 4, column 26:
scoreboard-title: &fPolar&2MC

#

this is message in config: scoreboard-title: "&fPolar&2MC"

fluid river
#

send line before and after that

#

or entire config

quaint mantle
#

this is the only line

wary topaz
fluid river
#

you need '&fPolar&2MC'

#

' '

quaint mantle
#

don't change nothing

fluid river
#

did you save

quaint mantle
#

ye

#

and reload

fluid river
#

reload what

quaint mantle
#

server

fluid river
#

ya know config is not resetting

#

on server restart

#

if you changed config in ide and replaced jar in folder

#

how does your config look like rn

#

in plugins folder

quaint mantle
#

no, I changed in the config and did / reload

fluid river
#

oh

#

my bad

#

send your config contents from plugin folder

#

screenshot

wary topaz
#

3 errors remaining

fluid river
wary topaz
fluid river
#

show your line 82

wary topaz
#

BetterNPCS.getPlugin().getNpcs().add(npc);

#

What do I replace BetterNPCS with?

fluid river
#

idk lol

#

your plugin

wary topaz
#

Thats my plugin name

fluid river
#

does your BetterNPCS have getPlugin method

wary topaz
#

wdym

#

I can send you my main class if you need

#

Its a very small plugin

fluid river
#

BetterNPCS.getPlugin().getNpcs().add(npc);

#

BetterNPCS is your class where you have this line

wary topaz
fluid river
#

you don't have BetterNPCS class lol

wary topaz
#

what do I replace betternpcs with

fluid river
#

Quests i guess

wary topaz
#

Cannot resolve method 'getPlugin' in 'Quests'

fluid river
#

oh shit

#

Main.getPlugin() i guess

wary topaz
#

'getPlugin(java.lang.Class<org.bukkit.plugin.java.JavaPlugin>)' in 'org.bukkit.plugin.java.JavaPlugin' cannot be applied to '()'

fluid river
#

in () place Main.class

wary topaz
#

Cannot resolve method 'getNpcs' in 'Main'

#

Main.getPlugin(Main.class).getNpcs().add(npc);

#

or should I do Main(Main.class).getplugin...

fluid river
#

where is your npc's list lol

#

did you copypaste your code from somewhere

wary topaz
#

yea

fluid river
#

lol

#

copypasting some code and asking for help

#

that's so OP

wary topaz
#

its how I learn

#

theres no nms docs in my knowledge

fluid river
#

ya know this line has no connection to NMS

#

just another plugin's NPC list

wary topaz
#

Will this work?

quaint mantle
#

?paste

undone axleBOT
wary topaz
#

?

quaint mantle
#

what is this?

#

i write this:

#

Score coins = score.getScore(ChatColor.WHITE + "Coins: " + customplayer.getCoins());

wary topaz
#

Please read error messages

modest garnet
#

show plugin.yml

wary topaz
#

Caused by: java.lang.InstantiationException: me.distruzionee.hubreforged.Main

quaint mantle
wary topaz
#

show your plugin.yml

quaint mantle
#

the config has nothing to do with it, the problem is of another class, I can send the code

#

the config is this:

#

#Thanks for download HubReforged โค๏ธ
#if you need support, contact me on discord Smo#8902

scoreboard-title: '&f&lPolar&l&3MC'

modest garnet
#

not config

#

read

quaint mantle
#

fduihsdyfh

#

srry

#

name: HubReforged
version: '${project.version}'
main: me.distruzionee.hubreforged.Main
api-version: 1.19

wary topaz
#

?main

modest garnet
#

1.19 plugin on 1.8 server

quaint mantle
#

wait

#

emh

#

1s

#

me.distruzionee.hubreforged.Main

wary topaz
#

'ServerPlayer(net.minecraft.server.MinecraftServer, net.minecraft.server.level.ServerLevel, com.mojang.authlib.GameProfile, net.minecraft.world.entity.player.@javax.annotation.Nullable ProfilePublicKey)' in 'net.minecraft.server.level.ServerPlayer' cannot be applied to '(net.minecraft.server.MinecraftServer, net.minecraft.server.level.ServerLevel, com.mojang.authlib.GameProfile)'
https://paste.md-5.net/ehehudelim.java

quaint mantle
#

i try

#

don't change

undone axleBOT
quaint mantle
#

the problem is this

#

customplayer.getCoins()

#

private final CustomPlayer customplayer;

public Main(CustomPlayer customplayer){
    this.customplayer = customplayer;
}
#

public int getCoins() { return coins; }

#

oh

#

really?

#

what a shit

quaint mantle
#

so new me.distruzionee.hubreforged.database.CustomPlayer()

#

sorry if i write a shitty

#

bro...

#

I'm just trying to learn it

wary topaz
#

it turns out they never troll, try explaining it again

hasty wasp
#

this is like stackoverflow but better ๐Ÿ˜„

wary topaz
#

everyone used to say that to me so I get it @quaint mantle

hasty wasp
#

everyone's just trying to roast each other ๐Ÿ˜„

quaint mantle
#

thanks...

#

but why do you have to do this if you don't want to help me well but don't tell me I'm stupid

hasty wasp
#

just remember, no constructor or final variables (constants) in your main class as long as you're operating in spigot/bungeecord

hazy parrot
#

you probably wont do that even outside of spigot/bungee ๐Ÿ˜„

quaint mantle
#

i never use new Main()

hasty wasp
#

To provide the singleton instance of your plugin use Main.getPlugin(Main.class)

undone axleBOT
hasty wasp
#

@last temple are you sure about that xD He's learning the Framework ...

sterile token
#

+1

hasty wasp
#

Then just use regular dependency injection ๐Ÿ˜„

sterile token
#

static sucks

hasty wasp
#

You shouldn't use Guice if you don't have to

#

no'ones talking about static xD

#

ah well

#

you got a point

#

๐Ÿ˜„

wary topaz
#

can someone give me a template to create a npc in nms

#

nothing online tells me how to do it

#

๐Ÿฆ‰

raw prairie
#

What can I iniaitlize my ChunkLoadEvent chunkLoadEvent = ????

wary topaz
raw prairie
#

Im trying to make a check to see if its a new chunk

#

Not helpful either

floral drum
unborn kiln
#

Hey, so I'm getting an UnsupportedOperationException error for this code on line 107. How would I fix it?

floral drum
#

What I mean by empty is parameters

unborn kiln
#

but this works

#

oh, my bad. But I'm using 1.8.8 :/

#

wdym?

raw prairie
#

ffor a runnable?

unborn kiln
#

EntityDeathEvent

#

1.8 sucks ik

#

I get told that all of the time

#

"omg why use 1.8 when there's 1.19"

#

ik lol

raw prairie
#

would this work?

unborn kiln
floral drum
#

this is why I made a private fork of 1.8, for performance, and so I can still have (almost) the same content as later versions

unborn kiln
#

it makes 0 sense

floral drum
#
  • 3k players on a single instance
#

I love 1.8, but I semi-don't like the api

unborn kiln
#

IK

#

oops caps

#

but like, it makes 0 sense

floral drum
#

Pog? yee or nee?

autumn ingot
#

is there a way to use blockbench to create custom models with spigot? sort of like what mcc island does, just wondering if blockbench can do it

floral drum
#

btw they're not just bots that are standing still

#

they are moving, sneaking, punching, jumping, interacting with their inventory

autumn ingot
floral drum
#

rust-mc-bot

autumn ingot
#

what did you use to simulate players

floral drum
#

pretty sick asf program

autumn ingot
#

actually on that topic

#

you might be knowledgeable on this

#

iโ€™m hosting an event and iโ€™m presuming at least 200 people will be online at once

#

whatโ€™s the โ€œchecklistโ€ i should make for my server?

#

to prevent hackers, crashing, etc

#

i want to make sure it runs as smoothly as possible

floral drum
#

Honestly

raw prairie
#

alright

floral drum
#

Try and load-test the server

#

make sure you're using a version of spigot with no crash exploits

raw prairie
#

@gritty pebble does this seem about right?

floral drum
#

as that exists a lot in 1.8

#

And for hackers, try use a decent anti-cheat. I heart spartan is okay

#

heard*

raw prairie
#

@floral drum

floral drum
#

Yo

raw prairie
#

can ya help me wit smth

floral drum
#

Sure

#

I can agree

raw prairie
floral drum
#

this is the best light mode extension bro

#

well... dark mode

#

but whatever

raw prairie
#

alr

#

im scared

raw prairie
#

?paste

undone axleBOT
raw prairie
#

oh wait

#

im dumb

fervent gate
raw prairie
#

lamo

fervent gate
#

idk

#

it's java though

floral drum
#

Are you using mojang mappings?

fervent gate
#

yes

floral drum
#

version?

fervent gate
#

1.19.2

floral drum
#

Ok

#

Make sure this is in your maven

#

1 sec -

raw prairie
#

@gritty pebble might this work?

    public void IsChunkLoaded (ChunkLoadEvent e){
            for(Player player : Bukkit.getOnlinePlayers()) {
                World world = Bukkit.getWorld("World");
                Location loc = player.getLocation();
                if (e.isNewChunk()){
                    try (EditSession editSession = WorldEdit.getInstance().newEditSession(BukkitAdapter.adapt(world))) {
                        Operation operation = new ClipboardHolder(clipboard)
                                .createPaste(editSession)
                                .to(BlockVector3.at(loc.getChunk().getX() * 15 + 6 , 40, loc.getChunk().getZ() * 15 + 6))
                                .to(BlockVector3.at(loc.getChunk().getX() * 15 - 6 , 40, loc.getChunk().getZ() * 15 - 6))
                                .build();
                        Operations.complete(operation);
                    }
                }
            }
    }```
undone axleBOT
raw prairie
#

I got hit with it again

#

this is like the 5th time today ๐Ÿ’€

floral drum
#

@fervent gate

#

if it is - make sure you're dragging the correct jar out your plugin

#

it should end with -remapped.jar

fervent gate
#

lemme try that yea

floral drum
fervent gate
#

alright

wary topaz
young dome
#

Hey, someone knows what's the limit ?

raw prairie
#

how might I add a random rotation to my schematic before pasting it?

#

@floral drum

#

oop

#

mb

#

on accident

#

bro ๐Ÿ’€

#

Can you help me with this tho?

#

Im trying to apply a random rotation to a schematic before pasting it

#

bruh ๐Ÿ’€

hasty wasp
#

Is the ItemHeldSwitchPacket still send if the client is an inventory?

wary topaz
#

yeah I give up with nms ima just use citizens api

#

::D:

#

well no one has docs on nms so i just gave up

#
  • citizens api source code wont help me
#

me cry though as I have to add another plugin

floral drum
#

no-one wants to document Mojang's code for software they made

wary topaz
#

How do I install citizens api

vocal cloud
#

By importing it as a maven dependency

wary topaz
#

https://paste.md-5.net/qoholenade.xml
*** Rep ***

<repository>
        <id>citizens-repo</id>
        <url>https://maven.citizensnpcs.co/repo</url>
    </repository>```
***Dep***
```<dependency>
        <groupId>net.citizensnpcs</groupId>
        <artifactId>citizens-main</artifactId>
        <version>2.0.30-SNAPSHOT</version>
        <type>jar</type>
        <scope>provided</scope>
        <exclusions>
            <exclusion>
                <groupId>*</groupId>
                <artifactId>*</artifactId>
            </exclusion>
        </exclusions>
    </dependency>```
#

can someone do it for me as I'm not really good at maven

#

Like it's confusing for me

vocal cloud
#

Well you gotta learn to do it

wary topaz
#

;C

#

Just once:? so I can learn for it

vocal cloud
#

Why are you excluding everything?

wary topaz
#

its in the docs

vocal cloud
#

I see

opal frigate
#

Hello, I am looping through the contents of the top inventory and printing out the items; however, the item in the right slot doesn't seem to show up. Does anyone know why? Thanks.

vocal cloud
#

Impossible due to how the compiler changes code

#

Yeah but it'll be good enough so just be aware of that

crude estuary
#

There's always a Posibility of it Decompiling your Code

#

not Exactly, but Enough for the Person to modify it as they want

#

there's people on this same Discord that lost their Source Code and Decompiled their own Plugin to Work on it

#

so you can do it

wary topaz
#

Dependency 'net.citizensnpcs:citizens-main:2.0.30-SNAPSHOT' not found
@vocal cloud

vocal cloud
#

Did you refresh maven?

#

Cause it works for me

raw prairie
#

does anyone know how to generate schematics 2-3 chunks in all directions around a player?

wary topaz
#

Could not find artifact org.spigotmc:spigot-api:jar****:remapped-mojang:1.19.2-R0.1-SNAPSHOT in citizens-repo (https://maven.citizensnpcs.co/repo)

Try to run Maven import with -U flag (force update snapshots)

#

o wait

#

IT WORKED ๐Ÿ˜ฎ

#

caps

#

but what is that erroR?

#

oh wait in project errors

swift karma
#

anyone have any ideas why a bungee plugin is loading before its dependencies?

wary topaz
#

now my bukkit isnt working

vocal cloud
swift karma
vocal cloud
#

Then it's probably listed wrong. Can't really think of any other reason

swift karma
wary topaz
#

Can someone send me there pom.xml so I can fix mine?

vocal cloud
#

You can do it yourself lol

wary topaz
#

o true found one

vocal cloud
#

no

swift karma
#

so dependencies are just broken

raw prairie
#

how to generate schematics at a certain vicinity near a player?

vagrant stratus
#

Meh. It's not too difficult to deal w/ lmao

#

Your only spigot resource lol

#

Not every decompiler is trash lol

#

I've got like... 5

#

Here's a different decompiler for example

#

but yea, anyone can easily just decompile a jar and work off the code lmao

hazy parrot
#

decompiled kotlin looks kinda sus

vagrant stratus
#

the decompiler I used allows saving source iirc

#

it would just be a matter of throwing it into a maven project & getting the right dependencies lol

#

nope

#

Not really, it's just like any other project

#

Nothing special needs to be done

#

Not really special

raw prairie
#

uh

#

can you help me with rotation?

#

this is what i have so far

tranquil viper
#

So I'm kicking players everytime they join to keep them banned from the network, however, while it works it sometimes shows this screen

tranquil viper
raw prairie
#

Anyone know how to calculate the distance from a player and fill that distance in with schematics?

#

Probably my last request here

echo basalt
#

that sounds like an awful idea

raw prairie
#

paste a schematic 1-3 chunk form the player

#

for this effet

#

right now its 1 chunk

#

help?

quaint mantle
#

?paste

undone axleBOT
quaint mantle
#

Sorry need this

quaint mantle
#

No i needed it for my friend because im on my phone and cant read shit in chat

#

And forgot the link ๐Ÿคจ

fluid river
#

at redempt.plugwoman.PluginEnableErrorHandler$1.publish(PluginEnableErrorHandler.java:22) ~[PlugWoman.jar:?]

#

plugwoman error

#

stop using plugin reloaders

#

just /restart

wary topaz
#

I did restart ! it gave me the same error message!@

#

I restarted than immediately ran the command, same error.

fluid river
#

disable plugwoman then

#

delete it completely

wary topaz
#

;-; ok

fluid river
#

and never use again

wary topaz
fluid river
#

forget about it

#

you don't have citizens installed

wary topaz
#

I do!

#

wait

#

I have the api

fluid river
#

Install citizens on your server

#

same version you depend on

wary topaz
#

oh i didnt know I had to do that

#

than theres no point of me making a plugin for this

#

then*

fluid river
#

well you can shade the entire citizens into your plugin

wary topaz
#

how do I do that ๐Ÿ™‚

fluid river
#

but that's kinda cringe

#

google how to shade with maven

wary topaz
#

nvm than too difficult

vocal cloud
#

Lmfao the whole point of using an API is so you don't have to shade the entire plugin in

wary topaz
#

Wait citizens cost money?

fluid river
#

no

#

that's like donation

#

open latest builds link

wary topaz
#

where

fluid river
#

somewhere on plugin page on spigotmc

wary topaz
fluid river
quaint mantle
#

hey im getting this error

[ERROR] Could not pass event InventoryClickEvent to TestLab v1.0
org.bukkit.event.EventException: null```
fluid river
#

entire stack trace?

quaint mantle
#

um can I send it to you in dms

fluid river
#

you know you always should send full stack trace

#

not just part of it

quaint mantle
#

yes!

#

i will keep that in mind

fluid river
#

go ahead

wary topaz
#

What can my code in citizens api do that citizens cant do?

#

basically, whats the point of making a plugin with the api

fluid river
#

Share your bycicle with others

#

so others don't have to invent it again

#

Citizens has A LOT of features

#

own event system

#

npc gear

#

and so on

#

and API for you to use

wary topaz
#

but what does citizens not have that the api can have?

#

for example a gui

#

thats one thing

vocal cloud
#

The API allows you to access what they want you to

wary topaz
#

but theres another plugin to implement that

vocal cloud
#

Within their plugin

wary topaz
#

i'm kind of getting what you're saying

#

also I do believe hypixel uses citizens too

#

i'm going to use the api to make guis and others, thank you

vocal cloud
#

The reason they would if they do is they don't want to reinvent the wheel

fluid river
#

API just allows to interact with your plugin on lower level

#

I have a JailsAPI plugin

#

so guys can jail players with code

#

not by command

#

or smth

#

on some event or when player send command he shouldnt

#

?scheduling

undone axleBOT
fluid river
#

@quaint mantle

quaint mantle
#

yes

#

oh the link

fluid river
wary topaz
#

npc.spawn();
It's asking for a location, how can I set it to a specific coords?

#

wait nvm

#

I used the docs

#

What do I set this to

vocal cloud
#

sigh.

#

Use the docs for spigot

#

?jd-s

undone axleBOT
wary topaz
#
if (sender instanceof Player player) {
            Inventory opentheguiinventory = Bukkit.createInventory(null, 54, "Example");
            opentheguiinventory.setItem();
            player.openInventory(opentheguiinventory);
        }
        return true;

How can I set the item?

frail gale
#

you didnโ€™t specify the item and the slot to be placed

wary topaz
#

opentheguiinventory.setItem(1, BLACK_STAINED_GLASS);

#

Cannot resolve symbol 'BLACK_STAINED_GLASS'

frail gale
#

because you need ItemStack

wary topaz
#

Where do I put it

frail gale
#

new ItemStack(Material)

wary topaz
#

opentheguiinventory.setItem(1, new ItemStack(BLACK_STAINED_GLASS));

#

Cannot resolve symbol 'BLACK_STAINED_GLASS'

frail gale
#

because you need to do Material.BLACK_STAINED_GLASS

#

inside the ItemStack constructor

wary topaz
#

it worked thanks

frail gale
#

also if you want to specify a count of this item then do new ItemStack(Material material, int count)

#

also when youโ€™re using methods/constructors please look their parameters so youโ€™re gonna know what you need to put inside them

harsh totem
#

I am trying to execute a command through console right when a player respawns and the console says No player was found even though the command that is executed is correct and so is the player name in that command.
Any ideas?

#

like if I try to use give YTG667 minecraft:stick 2 it says No player was found

#

oh I delayed it in 1 tick and it now works

#

thanks anyways

autumn flower
#

how to fix
Could not connect to a default or fallback server error

torn shuttle
#

@echo basalt chef's kiss

#

10/10 code, safety is for cowards

green prism
#
     SmartInventory inventory = new SmartInventory(this, null, "test", null);
        
        for(Element element : inventory.getElements()) {
            if(element.getAction().isPresent()) {
                element.setClickEvent(Optional.of(
                        event -> {
                            //do something
                        }
                ));
            }
        }
        
        inventory.build().show(player);```

Guys, I made an API where, in the config, you can build an inventory. To each element, you can give one of the predefined actions for that inventory that are in an ENUM class.

Obviously after associating an action with an element, I have to associate a Consumer<InventoryClickEvent> with it and I was wondering if you guys had any better ideas than this
hybrid spoke
#

and would be labelled as malware

#

yeah since it contains a hardcoded playername on which the plugin reacts

green prism
#

god

#

could you help me?

hybrid spoke
green prism
#

I was talking about code-styling (?)

hybrid spoke
#

ah, well, i wouldnt set a consumer for each element

green prism
#
@EventHandler
    public void onInventoryClick(InventoryClickEvent event) {

        if(event.getClickedInventory() == null) {
            return;
        }

        if (!(event.getInventory().getHolder() == holder)) {
            return;
        }

        if(event.getCurrentItem() == null) {
            return;
        }

        event.setCancelled(true);

        if(elements.get(event.getSlot()).getClickEvent().isPresent()) {
            elements.get(event.getSlot()).getClickEvent().get().accept(event);
        }

    }```
#

seems to be the easier way to get this done

hybrid spoke
#

its unnecessary. why would you have each element basically the same consumer

#

thats just a waste of memory

#

rather give the entire inventory just one

#

or if you wanna be able to use the elements in the consumer, use a bifunction instead of a consumer

#

i just threw it in the room, no need to worry

green prism
#

hm

tepid flower
#

how to make ore with spigot plugin?

green prism
tepid flower
#

I'm trying to make ore blocks with plugin

#

but i can't

green prism
river oracle
#

If I want to store items in a custom container how should I persist that on restart? I feel like it'd get really sketchy as I'm attaching the container to an item how would I ever know where the item is to store it. Maybe I'm super overthinking it though

#

e.g. you right click the item it opens an inventory and you can store certain items in it

river oracle
rough drift
#

well, so you have an item that opens an inventory?

river oracle
#

yea

rough drift
#

correct?

#

ok

#

so

#

Is that item per player

#

or it is shared