#help-development

1 messages · Page 17 of 1

opal juniper
#

groovy ThisIsFine

chrome beacon
#

I use groovy too

opal juniper
echo basalt
#

excuse me if I started making plugins in like 2016 and there wasn't anything much better

opal juniper
#

maven aPES_RoastedPepe

echo basalt
#

lol no

twilit roost
#

me who started in 2018 ( or so ) and clicked random Build Thingy

opal juniper
#

nah i mean to learn kotlin gradle but ughhhhh things

echo basalt
#

maven bad

#

idk why people ask me to use it

twilit roost
#

maven gut

opal juniper
#

maven is just simple

chrome beacon
#

Gradle errors are horrible

#

At least with groovy

opal juniper
#

so are maven sometimes - it will just give no error message and mark the project as invalid

chrome beacon
#

Never had that issue

opal juniper
#

i did the other day, i was trying to put modules in modules

#

and it threw a tantrum

#

but it accepted it eventually

#

but that way i could have an nms module with different sub modules and the nms module could do all the version logic

twilit roost
#

override registerPaths

tender shard
#

get the targetSelector field, then use addGoal(int, Goal)

vast raven
#

.

tender shard
#

the priority

#

lower number = "more important"

twilit roost
#

priority

tender shard
#

it goes through all added goals, then takes the one with the lowest priority that returns true for "canUse"

chrome beacon
vast raven
twilit roost
#
this.goalSelector.addGoal(3, new DashToPlayerGoal(this,2,this.getBukkitEntity().getWorld(),10,20));
        

this is my code which adds my custom goal to index 3

#

then attackgoal is index 0
follow 1

chrome beacon
#

Priority not index

tender shard
#

yeah for example. e.g. for villages, "run away from pillager" is more important than just "just randomly stroll around", and "go back to village" is more important than "just randomly stroll around" too

twilit roost
#

custom goals

#

its all google

tender shard
#

unfortunately there are only videos about this topic

#

and videos suck

visual tide
#

write a book

tender shard
#

I don't know anything about pathfinders

twilit roost
#

i thought of creating resource
but I realized im lazy piece of shit

tender shard
#

only yesterday did I write my custom wrapper for them so I can use them without NMS

#

before that I had no idea how they work

twilit roost
#

that codedred video helped a lot to start creating custom goals ..

#

"my own custom goal"

#

this isnt vannila
I coded this thingy

#

yep
imma send u all goals

tawdry scroll
#

TempGoal

tawdry scroll
#

Used by vanilla for pigs and sheep

twilit roost
#

but I encourage u to try and code custom goal
by doing so, you will get some knowledge of how pathfinder goals work

#

java docs

#

or IntelliSens

chrome beacon
#

No javadocs for nms

#

Open the class and see what it uses them for

twilit roost
visual tide
#

thats the point of obfuscation 🙃

twilit roost
#

but for me personnally it suggests correct names

chrome beacon
#

Yeah

#

Mojang obfuscates for file size as far as I'm aware

visual tide
#

ask mojang

twilit roost
#

oh sorry

#

nvm

#

i forgot u needed variables, not methods

#

but u can still find in code that if this.d = var2
then var2 is speedModifier

visual tide
#

try follow owner goal maybe

#

or tempt goal

twilit roost
#

nms player can be used as mob

#

i think

#

not .class
just get ur player
nms Player p = ((CraftPlayer)bukkitPlayer).getHandle);
and feed the goal with nmsPlayer

vast raven
twilit roost
#

thread pls

chrome beacon
vast raven
chrome beacon
#

And not in a screenshot

vast raven
chrome beacon
#

All of the config code

vast raven
chrome beacon
#

?paste

undone axleBOT
chrome beacon
#

^

vast raven
naive bolt
#
if(damager instanceof Player){
      plugin.getLogger().info("Damager is player");
      if(entity.getType() == EntityType.BLAZE) {
        plugin.getLogger().info("Its a blaze");
        Player p = (Player) damager;
        JobsPlayer jobsPlayer = Jobs.getPlayerManager().getJobsPlayer(p);
        Job job = Jobs.getJob("Hunter");
        if (!jobsPlayer.isInJob(job)) {
          plugin.getLogger().info("Player not in hunter job");
          Long unixTime = System.currentTimeMillis() / 1000L;
          if(!messageCooldown.containsKey(p.getUniqueId())) {
            Long expirationTime = unixTime + 100;
            messageCooldown.put(p.getUniqueId(), expirationTime);
          }

          if(messageCooldown.containsKey(p.getUniqueId())) {
            Long lastMessage = messageCooldown.get(p.getUniqueId());
            Long expirationTime = lastMessage + unixTime;

            if(unixTime < expirationTime){
              return;
            }
          }
           // messageCooldown.remove(p.getUniqueId());
            messageCooldown.put(p.getUniqueId(),unixTime);
            p.sendMessage(ChatColor.translateAlternateColorCodes('&',"&7[&eReminder&7]: &bDon't forget to do &6\"&b/jobs join Hunter&6\" &bto earn extra money!"));
          }
        }
      }
public static Map<UUID, Long> messageCooldown = new HashMap<>();

can anyone see anything obvisoly wrong with this

#

my message just doesnt seem to be sending

vast raven
eternal oxide
#

A blaze is never going to be a Player

eternal oxide
#

ah damagee and entity. different

vast raven
#

I think is better

eternal oxide
#

Its easier if you tell us what problem you are having, rather than post a bunch of code and ask us whats wrong.

chrome beacon
#

Also I'm not sure of an inventory is serializable

#

Store the items

peak depot
#

for(Player players : Bukkit.getWorld(worldName).getPlayers()) {
if(players != player) {
player.sendMessage(prefix + "§cDie Welt in der du dich befandest wurde gelöscht! §7(§e" + worldName + "§7)");
player.playSound(playerLoc, Sound.NOTE_BASS_GUITAR, 1 ,1);
}
}

#

why am Im only I getting the message (player) and the others dont

naive bolt
#

"my message just doesnt seem to be sending"

chrome beacon
young knoll
#

This is why good variable names are important

vast raven
#

it works

#

just after the reload it gets lost

chrome beacon
#

Save the items

#

And getConfig in on enable

#

That's it

vast raven
ornate mantle
#

whats gonna happen if i replace every instance of Player with OfflinePlayer

#

in my code

#

wait nevermind

slate delta
#

Anyone have an idea how I can do when I do Build Artefacts (Intelij IDEA) that sends directly to the test server on my machine via SFTP?

slate delta
echo basalt
#

All I have is a CD script for a self-hosted gitlab endpoint

#

that makes a batch file that deploys to production

tender shard
#

anyone knows why 1.19.1 doesn't print any stacktraces anymore >.<

slate delta
#

omg i have your ip !

hybrid spoke
slate delta
#

let's go!

ornate mantle
#

if i need to get the OfflinePlayer instance of a player via only their username and no UUID, will Bukkit.getOfflinePlayer(UUID.nameUUIDFromBytes(username.getBytes())) work?

slate delta
#

Someone knows how I can make it accept the "null".

tender shard
#

for real wtf why does it not print any stacktrace

hybrid spoke
#

then you can pass in null

slate delta
hybrid spoke
#

yeah use the wrapper for int

slate delta
#

ooh okay

hybrid spoke
#

a primitive cant be null

slate delta
#

i used Integer and can use null

#

thank you bro 😅

#

i'm begginer in java

#

@echo basalt okay thanks!

hybrid spoke
#

just use the name of the player

echo basalt
ornate mantle
echo basalt
#

Thread.setUncaughtExceptionHandler((thread, throwable) -> { ... });

hybrid spoke
echo basalt
#

I have an ExceptionLogger class

icy beacon
onyx fjord
#

hope its correct channel

#

(looks like client side pms?)

hybrid spoke
vivid cave
#

I would like to report a bug/code flaw in spigot/bukkit, where can I do so?

hybrid spoke
#

?jira

undone axleBOT
frosty tinsel
tender shard
young knoll
#

Try their speed values from the wiki maybe?

tender shard
#

then the llamas would be almost standing still

#

IIRC the default value for llamas should be something like 0.3 or so, but even with 1.0 they are extremely slow

#

for villagers, using the Attribute.GENERIC_MOVEMENT_SPEED seems to be pretty accurate, but for other entities, they are sooo slow that they'd almost be standing still then

young knoll
#

Hmm

#

Weird

tender shard
#

yeah it's weird D:

young knoll
#

Check the base NMS class, does it have speed values?

tender shard
#

hm

#

I'll check it out

tender shard
#

uuugh why isnt it part of any interface

pine forge
#

Any advices how to minimize a plugin jar? Mine is pretty big (10,6MB) considering i only have a few classes and other jars of much bigger plugins are only around 500KB (i.e. CoreProtect).

hybrid spoke
#

exclude packages you dont need

pine forge
#

I already enabled the minimizeJar configuration for the shading execution in my pom.xml which reduced the jar to about a quarter of its previous size (about 40MB)

tender shard
pine forge
hybrid spoke
#

yes

pine forge
#

Exclude it from the shading or where exactly?

tender shard
#

?paste your pom

undone axleBOT
pine forge
#

yes probably i decompiled my plugin and it looked like it still had all of the spigot classes

#

I compared it with coreprotects plugion

hybrid spoke
#

well welll well

#

dont just shade everything in anyways

#

mark the stuff which is already there as provided

pine forge
#

Do i just exclude the entire spigot?

tender shard
#

no

hybrid spoke
#

no you mark it as provided

tender shard
#

just set the proper scopes

hybrid spoke
#

set the scope

tender shard
#

as said, paste your pom

pine forge
tender shard
#

you added spigot 1.13 with scope "compile"

#

just add <scope>provided</scope> to your spigot dependency

pine forge
#

i do have that

tender shard
#

no

#

you don't

pine forge
tender shard
pine forge
#

oh

#

the api

#

yea

#

right

tender shard
#

also why do you have spigot-api 1.8 and spigot 1.13?

#

you should only use one version

pine forge
#

only the api?

tender shard
#

depends. do you use any NMS stuff?

pine forge
#

not sure why i included both

tender shard
#

if no -> only use the API

pine forge
#

yeah

#

i think i do nms

dire marsh
# onyx fjord eyo can someone tell me what this does? https://github.com/nodusclient/girlboss

https://github.com/nodusclient/girlboss

Girlboss is a mod that lets you detect when someone sends a private message to another player and attempts to detect who the receiving player is. The detection of someone sending a message is achieved by listening to "header packets" which are sent whenever a private message is sent. The detection of who ...

▶ Play video
pine forge
#

i remember

tender shard
#

well just comment out the "spigot 1.13" thing, see if it still compiles. If yes, you don't use nms 😄

dire marsh
#

it appears it lets you expose who is sending private messages?

pine forge
#

Ill exclude the api then

tender shard
#

if you'd use NMS, then your plugin would run only on 1.13 and not other versions

pine forge
#

I remember i do use nms

tardy delta
#

shading the spigot api 🤤

pine forge
#

For log4j

tender shard
young knoll
#

Why not just

#

Depend on log4j

tardy delta
#

lmfao

dire marsh
pine forge
#

I removed the api and it did compile

tender shard
#

yeah of course, you should have removed spigot instead of spigot-api if you don'T use NMS

#

spigot-api is part of spigot

river oracle
pine forge
#

I do use nms for hooking into log4j

river oracle
#

No

#

Just use the log4j classes

young knoll
#

Again, why not depend on log4j then

pine forge
#

I guess if thats an option

#

ill do that

river oracle
#

It is an option lmfao

pine forge
#

whats the dependency for it

eternal oxide
#

Why use log4j at all in a plugin? Just use teh logger

pine forge
#

We have an entire thread about that, dont you remember

tardy delta
#

👀

eternal oxide
#

I've seen no thread

#

I do remember talking to somene about hooking log4j

#

but you shoudl still not need nms to hook into log4j

pine forge
tender shard
#

you cannot just use the log4j dependency unless you shade it, because spigot has it relocated to a different package name

pine forge
#

I need both the log4j-core and log4j-api right

rain mason
#

why does this happen, whitelist isn't even enabled

river oracle
rain mason
#

these are all my plugins, I don't think any of them are doing that

icy beacon
#

i thought it was an edge case

pine forge
#

It compiled fine except this warning

#

I used the api version 1.12

young knoll
icy beacon
#

yeah but it's a terrible guh

pine forge
#

and included both log4j-api and log4j-core

icy beacon
#

bug

young knoll
#

Are you up to date on spigot

#

Builds get released very often after an update

tender shard
icy beacon
#

oof lol

pine forge
#

oh wow

#

My pluigin is now at a single kilobyte

#

no

#

no way

vast raven
pine forge
#

its 1000

#

lol

tardy delta
#

saveDefaultConfig()?

vast raven
tardy delta
#

and then adding defaults afaik

vast raven
#

Read the answers and old messages

tardy delta
#

what answers

vast raven
chrome beacon
jade roost
#

why dont i have image access

young knoll
#

Verify

mystic sky
#

why you register commands before than config xd

vast raven
jade roost
#

can someone help me with this question

tardy delta
chrome beacon
tardy delta
#
saveDefaultConfig();
getConfig().addDefault("is-conclure-sus", true);
getConfig().option().copyDefaults(true);```or smth?
jade roost
jade roost
#

trhere is only one tihing

tardy delta
#

wtf

chrome beacon
jade roost
#

how to code it

tardy delta
eternal oxide
#

If you store it in a field you have to reassign it if you reload

vast raven
tardy delta
#

just call the getConfig() method or make a variable in your onEnable

pine forge
#

You cant use plugins with api versions below 1.13 on your servers right (unless the servers are below 1.13 as well)?

eternal oxide
#

you don;t need a var, just getConfig() each time

jade roost
#

nvm

#

i did it

#

i did it

#

favoriteArticles[favoriteIndex] = newArticle;

young knoll
pine forge
#

My plugin compiled with a 1.12 api version

vast raven
young knoll
#

And servers below 1.13 don’t even check api version of plugins

#

Of course it’ll compile, it’s just a line of text in a text file

#

But it does nothing

pine forge
#

Well apparently it found the dependency

#

Im talking about the pom.xml

#

DIfferent question, how can you make your plugin compatible with versions below 1.13

tardy delta
#

you passed a null to the constructor?

jade roost
#

whats a differenece between hashset and hashmap

tardy delta
#

hashmap stores key value pairs

#

hashset is just a normal collection that stores stuff

jade roost
#

a

tardy delta
#

please contact google for further questions ©️

drowsy helm
#

both have hash in the name

#

thats all i have deducted

tardy delta
#

hasj

pine forge
#

How can you make your plugin compatible with versions below 1.13?

icy beacon
#

build it for versions below 1.13 and see if it works on 1.13+

#

use abstraction

#

xseries for enums

pine forge
#

If i use versions below 1.13 i cant use it for a server thats above 1.13

tardy delta
#

reflections 🤣

icy beacon
#

just make sure to break your reflections

#

otherwise people won't know that you use reflections

chrome beacon
#

Just takes a bit of work

icy beacon
#

and if you use reflections, you always want people to know that you use reflections

#

otherwise, don't use reflections

pine forge
#

Or do i leave the version on 1.13 in the plugin yml

young knoll
#

Correct

icy beacon
#

"i tried" like if we know what you tried :wheeze:

pine forge
#

okay

#

That worked

#

On 1.19

#

I should probably test on 1.12 now too

jade roost
#

almost finishing code cademy

#

can i get into cool boy coders club

#

@undone axle

tardy delta
#

not yet

#

🤓

patent fox
#

how can i make an entity follow a player? using remapped btw

chrome beacon
#

Add a goal to the mob

tardy delta
#

add a follow entity goal or smth

chrome beacon
#

^

patent fox
#

yes

#

that's the point

#

i dont know how

chrome beacon
#

See the thread

patent fox
#

ok maybe i got a little rude

#

sorry

chrome beacon
#

We helped a with this earlier

tardy delta
#

Map<PersistentDataContainer, Integer>?

#

or uuid int

#

imma not save that to the pdc

chrome beacon
#

You should just save that to the pdc

patent fox
chrome beacon
#

Idk how to link threads on mobile

tardy delta
#

there is a Player#getStatistic(Statistic.MINE_BLOCK, Material) too

jade roost
#

now that am done with code cademy

chrome beacon
jade roost
#

is there any website or video on spigot

#

tutotiral

patent fox
jade roost
#

yes

patent fox
#

kody simpson

#

he is a chad

chrome beacon
#

Youtube videos are usually quite bad

tardy delta
patent fox
jade roost
#

from him

tardy delta
#

theyre bad

jade roost
#

43 videos to be exact

tardy delta
#

i expected quality but i was like bruh what is this code

patent fox
#

and you still don't know?

jade roost
#

me

#

no

#

i know some but

#

i want to learn more complexed plugin coding

patent fox
#

oh

#

nms

#

protocl lib?

jade roost
#

like minigames

#

and some

patent fox
#

yeah me too

jade roost
#

and apis

hybrid spoke
#

✨ pair programming ✨

chrome beacon
#

Those are things you learn to figure out yourself

jade roost
#

what

hybrid spoke
#

?paste

undone axleBOT
jade roost
#

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

jade roost
#

how do i give a player a custom head

patent fox
#

packets?

jade roost
#

packwhat

chrome beacon
patent fox
#

u can set thier helmet manually

#

but that means they cant wear other helmets

jade roost
#

i found

#

SkullMeta

chrome beacon
#

Yeah

#

That's what you use

patent fox
#

oh

#

i thought he meant to set thier helmet

#

sorry

tender shard
#

I finally finished my wrappers for Goal (PathfinderGoal in spigot mappings) and PathNavigation (AbstractNavigation in spigot mappings) for 1.16.1 - 1.19.1 Damn, that was annoying lol

chrome beacon
#

Did you write that blog post Alex?

tender shard
chrome beacon
#

(About heads)

tender shard
#

oh no, I was busy with my path and goal wrappers

#

I'll write it this evening (its about 3pm here)

chrome beacon
#

Ah ok

rough drift
#

yo alex

#

rightclick on block

tardy delta
#

rightclick chest

jade roost
#
package me.goldenheads.goldenheads.commands;

import com.google.common.collect.Multimap;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.SkullType;
//import org.bukkit.attribute.Attribute;
//import org.bukkit.attribute.AttributeModifier;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.Item;
import org.bukkit.entity.Player;
import org.bukkit.inventory.EquipmentSlot;
import org.bukkit.inventory.ItemFlag;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.inventory.meta.SkullMeta;
//import org.bukkit.inventory.meta.tags.CustomItemTagContainer;
//import org.bukkit.persistence.PersistentDataContainer;

import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Set;

public class GoldenHeadCommandGiver implements CommandExecutor {
    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if(sender instanceof Player) {
            Player player = (Player) sender;

            ItemStack goldenhead = new ItemStack(Material.PLAYER_HEAD); //here
            ItemMeta itemStackMeta = goldenhead.getItemMeta();
            itemStackMeta.setDisplayName("&6Golden Head");
            SkullMeta skullMeta = (SkullMeta) goldenhead.getItemMeta();
            skullMeta.setOwningPlayer(Bukkit.getOfflinePlayer("BlindFrenetic"));
            goldenhead.setItemMeta(skullMeta);
            goldenhead.setItemMeta(itemStackMeta);
        }
        return true;
    }
}

cannot find symbol is the error

formal bear
#

which symbol

jade roost
#

unless i did something sutpid

formal bear
#

why do you place item meta two times?

jade roost
#

idk

formal bear
#

you set the skull meta then set back the old one

jade roost
#

uh

eternal oxide
#

You are using two Meta instead of using one. If your missing symbol is on PLAYER_HEAD you have a missing api version in your plugin.yml

jade roost
#

wym

formal bear
#

whats your missing symbol

#

and remove the last line, setitemmeta(itemstackmeta)

jade roost
#

ok

#

but but about the missing symbol

#

what to do

formal bear
#

it shows you where is the missing symbol

jade roost
#

Material.PLAYER_HEAD

chrome beacon
#

It's skull in 1.12

#

With durability of 3

jade roost
#

what

eternal oxide
#

add an api-version: 1.13 to your plugin.yml

jade roost
chrome beacon
jade roost
#

1.8.8

chrome beacon
#

Ok

#

Skull durability 3

#

That's what you need

old cloud
#

Is it possible to save a ConfigurationSection to a file?

formal bear
#

Save string path?

old cloud
#

Saving the content of a ConfigurationSection

formal bear
#

you can do for loop and do what you want with it

solid cargo
#

MAYBE HE COULD HAVE HELPED ME OUT BUT NO

#

ALL HE SAID IS "I've found out why it wont work"

formal bear
old cloud
solid cargo
#

all i want to do is for it to add "oil" every certain seconds in the "result" slot in a furnace

#

it caps at 1 (duh)

chrome beacon
#

Get the item stack and add 1 to the amount

solid cargo
#

item stack at inventory slot 2? (result slot)

#

then add?

old cloud
#

i would say if its empty, just set one oil there. if it is not empty, get the already existing oil and increment its amount by one.

solid cargo
#

how can i increment it by one tho?

chrome beacon
#

getAmount + 1

solid cargo
#

ohhhhhhhhhhhhh

#

okey

#

if i use inv.getItem(int index) method

#

then do +1

#

it throws out an error

#

is there another method????

slate delta
#

How to fix that

solid cargo
#

show line 71 of Core.java

slate delta
solid cargo
#

Core.java, line 71

slate delta
old cloud
solid cargo
#

thanks 👍

tight torrent
#

Hello

#

could someone help me out on my skript

#

ik im bad at coding

#

so what am i doing wrong here

#

command /gamble: trigger: if player has honeycomb named "&a&lcoin" chance of 10%: give player 10 honeycomb named "&a&lcoin" send "&a&lYou won!"

#

im getting a error on line 3

solid cargo
#

not the right place to ask. go to the skript discord

#

they will help a lot better there

slate delta
#

I would like to modify the cobblestone generated by a cobblestone generator (Water + Lava)

By 50% chance a diamond block
20% chance an iron block
and 40% chance a netherite block

This is an example
How can make this?

tender shard
#

is there a way to get the NMS class from a bukkit class? E.g. org.bukkit.entity.LivingEntity -> net.minecraft.world.entity.LivingEntity?

hot wolf
#

Is there a way to prevent players from switching an item to the other hand? Because I couldn't find an event for that

brave sparrow
tender shard
#

I only have the EntityType or sth like Class<Zombie> (bukkit zombie class)

#

but not any instance of the entity

#

if I'd had an instance, it'd be no problem at all

brave sparrow
#

I don’t think you can get the NMS class from that, no

tender shard
#

RIP

eternal night
#

Might be an option through the entity type

brave sparrow
#

Because the API intentionally doesn’t know about it

tender shard
#

I wanna wrap the AvoidEntityGoal to make it usable without NMS

eternal night
#

Nms has entity type registry

tender shard
eternal night
#

The entity type should expose it's key

#

Bukkit one ^

#

Then you could try a lookup through that

#

Tho idk if the entity type actually hard links to the nms class

brave sparrow
#

that might work

eternal night
#

Or just includes a factory for the nms instance

brave sparrow
#

Nothing in the bukkit api hard links to the NMS class

#

The api intentionally has no concept of NMS

eternal night
#

No I was talking about nms entity type

#

Bukkit entity type does nothing X's

tender shard
#

hm I didnt find anything useful in NMS EntityType

#

I hoped maybe something like CraftMagicNumbers.toNmsEntityType existed lol

worldly ingot
#

Man you're going to hate to hear that the whole concept of EntityType is fucked

tender shard
#

I'd also be fine with a "mapping" between bukkit entity classes and NMS entity classes 😄

worldly ingot
#

Bukkit's EntityType is returned as a literal in all Craft implementations of each entity, and the spawnEntity(EntityType) methods just have a massive if statement chain

#

There is no direct mapping between EntityType and NMS' EntityType

worldly ingot
#

The best you'll do is just pulling from an NMS registry the key of the EntityType, but if all you have is a Class<Entity>, you're not going to be able to do much with that

tender shard
#

hm the weird thing is also that AvoidEntityGoal takes a Predicate<NMSLivingEntity> but seems to never use it

#

if it would at least use that, I wouldnt need to map any bukkit type or class to the NMS one

#

oh wait, it does use it, just not the field. it uses the constructor parameter to turn it into a TargetingConditions

#

then I can just use that

worldly ingot
#

It's also protected. So if something extends it, it probably uses it directly

#

I'm not in my IDE though so I can't get a type hierarchy

tender shard
#

yeah I'm basically just wrapping some NMS goals into my own interfaces. So I'll just try to turn the Predicate that uses NMS stuff into one that uses bukkit classes

#

I got it to work by just wrapping the Predicate<BukkitEntity> into a Predicate<NMSEntity> that just calls the other predicate using getBukkitEntity()

tardy delta
#

run mate

glossy venture
eternal night
#

it does not 😅

tender shard
#

I just always pass LivingEntity as class and then use the predicate 🙂

#

that's way more flexible anyway

formal bear
#

I want to make that every player get sent block data for example playerhead but they could walk thru it

#

If i make it air its just not capable of even send data

tender shard
#

you can use FallingBlocks

formal bear
#

Just wondering how to make block appear for every player

solid cargo
#

dis in ticks right?

tender shard
#

but they are quite buggy and will always disappear after X minutes

formal bear
glossy venture
formal bear
#

But only for player that interacted with the block

eternal night
#

Yea it contains the factory

#

sadly

frosty tinsel
#

?tas

undone axleBOT
formal bear
#

Oh, would be better to just place armor stand with head as block?? ;D

frosty tinsel
#

If so, you'll have to introduce packets

formal bear
#

Ik but for some reason i cannot send blockdata when the block is air

#

then how to make it only disappear for one player... idk

#

i want to make player albe to walk thru it

#

certain

quaint mantle
#

anyone know how tall is the player in blocks?

formal bear
#

not 1.8?

quaint mantle
#

isn't it at least lower than 2?

#

cause there is a gap

#

when below a ceiling

#

jsut thought if someone knew it first, cause i would rather not dig through nms

formal bear
#

not at least 2

#

then player could not walk thru the 2 block gap

quaint mantle
#

right, typo, at most 2

worldly ice
quaint mantle
#

mh nice

quaint mantle
worldly ice
#

it's in a weird spot below the player images

quaint mantle
#

1.8 and 1.5 for stand and sneak

worldly ice
#

yep

quaint mantle
#

yeah, needed some pinpoint accuracy

#

too lazy to pay, also can't expand this, so better just make my own

#

"too lazy to pay" lol

#

what is this, chef simulator?

#

XD

tender shard
#

would be very useful to know that lol

frosty tinsel
tender shard
#

but the parameter names aren't included in the mappings

opaque gust
#

why it not work? mc 1.19.1

#

before 1.19.1 it worked correctly

#

all text dont work

#

oh one moment

#

sorry

formal bear
#

I have SkullMeta, how to set it to the block?

opaque gust
opaque gust
#

its minecraft client text, how change it?

#

otherwise the unknow command option in the spigot yml config is now meaningless

#

clear papermc server and this item text

#

**unknow-command **text dont replaced

#

give me a sec

formal bear
patent fox
#

does anybody know how to make entity follow player? using remapped

#

i dont know how to use goal path

opaque gust
#

i know!!!!

#

why dont replace message from spigot yml???

#

unknow-command parameter

#

any unregistered cmd need replaced message "unknow commannd"

fringe latch
#

Hey guys, simple question, is 1.19.1 still 1_19_R1 or is it a new version of spigot 1_19_R2?

tender shard
#

still R1

fringe latch
#

thanks!

tender shard
#

just use entity.getNavigation().walkTo(path)

#

or directly do
entity.getNavigation().walkTo(x, y, z, speed);

formal bear
tender shard
#

oh yeah

#

thats what I meant

#

i used walkTo because that's how I called it in my wrapper class lol

tender shard
tardy delta
#

bruh doesnt github ignore files that are in the gitignore file but are pushed to gh already?

#

its a config files which contains sensitive info and i want the file on gh to contain different data than the real one

#

git noob basically

ashen quest
#

hey guys, this is my plugin structure and when I build using maven, the server says it cant find plugin.yml

tall dragon
#

Does any1 know how i can convert an ItemStack to one of these stings?

opaque gust
#

how change this text? like a "this command not register"

tall dragon
ashen quest
#

its not there

tall dragon
#

i think you might need to mark your resources root

tardy delta
#

bruh this in the .gitignore would point to the config.json file in the resources folder right?

ashen quest
tall dragon
tender shard
#

did you override the "canUse" method?

#

what's "speed" set to?

#

what entity? some entities are really slow

#

it's not the actual speed but a speed "modifier"

#

havent checked for husks but just for fun, set the speed modifier to 20 and see if anything happens

tardy delta
tender shard
#

also you gotta call moveTo periodically, otherwise it'll stop walking after some time. You should just save the entity's path in a field, and then in tick(), call walkTo(path) periodically

formal bear
#

can i cast GameProfile to PlayerProfile?

eternal night
#

no

#

PlayerProfile is an API representation of a game profile

tardy delta
#

hey hey i need help i just fucked up git, how can i 'ignore' new changes made to a file but the file is already pushed?

formal bear
#

ehhhhhhhhhh im getting annoyed, theres really no easy way to place custom skull block

#

i dont understand

eternal oxide
#

custom skulls are easy

#

it just depends on how you have your texture

formal bear
#

gameprofile and getproperties.put

tardy delta
formal bear
# eternal oxide it just depends on how you have your texture

What do i need to return so i can place it as block 🙃

    private SkullMeta getSkull(String url, GameProfile profile, ItemStack itemStack) {
        if (!url.isEmpty()) {
            SkullMeta headMeta = (SkullMeta) itemStack.getItemMeta();
            profile.getProperties().put("textures", new Property("textures", url));

            try {
                assert headMeta != null;
                Field profileField = headMeta.getClass().getDeclaredField("profile");
                profileField.setAccessible(true);
                profileField.set(headMeta, profile);
            } catch (NoSuchFieldException | IllegalAccessException e) {
                e.printStackTrace();
            }
            return headMeta;
        } else {
            return null;
        }
    }
tender shard
#

what are x, y, z?

#

looks like trying to move to your current location

formal bear
tardy delta
#

bruh what a bs is this

#

i fucked up

tender shard
#

print out every start, stop, canUse result, and tick

#

see if it actually keeps running

formal bear
formal bear
tender shard
#

canUse should also get printed every tick though?

patent horizon
#

could anyone help me with a little bit of packet problems?
this is my code https://paste.md-5.net/oyoxokiriz.cs. my problem is that when i try to summon a dropped item, the item never spawns yet i dont get an error in console, but when i change the entity to something like an armorstand, it works perfectly fine

tardy delta
#

just pushed my bot token to gh lmfao

#

not understanding anything of the git shit

patent fox
#

what is profile public key?

eternal oxide
#

or do you mean you want to change teh texture of an already placed skull?

patent fox
#

how do i create an npc in 1.19? beacuse it needs something called profile public key

eternal oxide
#

pass null

patent fox
#

oh

#

thx again

#

if u remember from yesterday

eternal oxide
#

yeps

patent fox
#

remember me

desert frigate
#

dont understand why i cant use > on a integer

river oracle
#

right now its reading it as a string

desert frigate
#

ohhhh

#

i see

river oracle
#

the way string concatanation works is afaik is it autoreads ints as strings

#

may be wrong but thats what I recall

desert frigate
#

im new to java and im using knowledge from my other coding langs to this thats why lol

river oracle
#

java has autounboxing and boxing for primitive types

quaint mantle
desert frigate
#

hey magma guy

torn shuttle
#

<>^v are the only characters a programming language should accept

#

hey

#

I'll call this vector based programming

river oracle
desert frigate
#

if it provides extra functionality then why dont i use it instead lol

river oracle
#

because its uneeded especially in your scenario

#

its always best to use the primitives over wrapper objects if you can help it

#

to translate a number to a string you can do String.valueOf(number)

torn shuttle
#

Integer is also annoying because it can be null and is generally annoying to cast

river oracle
#

That too primitives can not be null

torn shuttle
#

bad for math

river oracle
#

null pointer error in my math problem 💀

final thunder
#

yo yaw is from -180 to 180 || 0 to 360 ?

torn shuttle
#

how much is zero divided by null?

river oracle
#

😭 I don't know

#

wait I know

#

its NullPointerException

tardy delta
#

2 / ((Integer) null)

#

:/

quaint mantle
#

Rust best language

#

Null safety

river oracle
#

does that throw an error or does java be like bruh wtf you doing idiot and auto make it 0

torn shuttle
#

safety is for dorks

torn shuttle
#

<insert fortnite L dance here>

river oracle
#

I like my code to be unsafe thats why I quit rust permanently I want to make everything null

quaint mantle
torn shuttle
#

I hope you understand how well I am dancing this L dance

tardy delta
#

lets go for C

river oracle
tardy delta
#

but rust has segmentation errors when doing unsafe casts kekw

#

like (const*) 12345 or smth

torn shuttle
#

interesting

river oracle
torn shuttle
#

hm

#

I did half of that

#

I am literally in the process of doing the other half rn

#

moving to canada

quaint mantle
#
let x: *const u8 = std::ptr::null();
println!("{}", unsafe { *x });
tardy delta
#

nullptr lmfao

quaint mantle
unique breach
#

@quaint mantle you can check dm with me please?

quaint mantle
#

Thanks for giving me 20 seconds to answer

merry lodge
#

Heyo

#

How do I add attributes to my item?

tardy delta
#

ItemMeta#addAttribute or smth?

merry lodge
#

Yeah

tardy delta
#

or itemflags

merry lodge
#

one second

peak depot
#

who can I get an text from anvil rename?

merry lodge
peak depot
azure hawk
#

he means how he can get the input out uf an anvil inventory

merry lodge
#

Oh

tender shard
golden turret
#

do someone knows why this happens? The entity "jumps" if it will pass the slab

#

here the speed is about 10

azure hawk
tender shard
#

that's the builtin MoveToBlockGoal lol

torn badge
#

Does anyone know how exactly ItemsAdder is doing the emotes?

tender shard
#

aren't those just custom fonts for unused characters?

torn badge
#

No I mean actual emotes, like a dancing player model

undone axleBOT
torn badge
#

What does that have to do with Java as a language lol

azure hawk
#

nothing just a joke

hasty wasp
#

Does anyone know why i keep getting this exception if I try to reload my plugin using Plugman?
https://paste.md-5.net/ojujojitut.bash

Caused by: java.util.zip.ZipException: ZipFile invalid LOC header (bad signature)
    at java.util.zip.ZipFile$ZipFileInputStream.initDataOffset(ZipFile.java:920) ~[?:?]
    at java.util.zip.ZipFile$ZipFileInputStream.read(ZipFile.java:931) ~[?:?]
    at java.util.zip.ZipFile$ZipFileInflaterInputStream.fill(ZipFile.java:448) ~[?:?]
    at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:158) ~[?:?]
    at java.io.FilterInputStream.read(FilterInputStream.java:132) ~[?:?]
    at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:270) ~[?:?]
    at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:313) ~[?:?]
    at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:188) ~[?:?]
    at java.io.InputStreamReader.read(InputStreamReader.java:177) ~[?:?]
    at java.io.Reader.read(Reader.java:250) ~[?:?]
    at java.util.Properties$LineReader.readLine(Properties.java:504) ~[?:?]
    at java.util.Properties.load0(Properties.java:419) ~[?:?]
    at java.util.Properties.load(Properties.java:382) ~[?:?]
    at java.util.PropertyResourceBundle.<init>(PropertyResourceBundle.java:200) ~[?:?]
    at java.util.PropertyResourceBundle.<init>(PropertyResourceBundle.java:177) ~[?:?]
    at java.util.ResourceBundle$Control.newBundle0(ResourceBundle.java:3245) ~[?:?]
    at java.util.ResourceBundle$Control.newBundle(ResourceBundle.java:3151) ~[?:?]
    at java.util.ResourceBundle.loadBundle(ResourceBundle.java:1984) ~[?:?]
    at java.util.ResourceBundle.findBundle(ResourceBundle.java:1770) ~[?:?]
    at java.util.ResourceBundle.findBundle(ResourceBundle.java:1722) ~[?:?]
    at java.util.ResourceBundle.findBundle(ResourceBundle.java:1722) ~[?:?]
    at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1656) ~[?:?]
    at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1586) ~[?:?]
    at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1549) ~[?:?]
    at java.util.ResourceBundle.getBundle(ResourceBundle.java:858) ~[?:?]
    at org.apache.commons.dbcp2.Utils.<clinit>(Utils.java:38) ~[API-1.0.2.jar:?]
tardy delta
#
  1. do not use plugman
twilit lynx
#

any solution?

fatal: repository '../Bukkit' does not exist
./applyPatches.sh: 16: cd: can't cd to /home/spigot/Spigot-API
Resetting Spigot-API to Bukkit...
fatal: ambiguous argument 'origin/spigot': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
  Applying patches to Spigot-API...
fatal: could not open '../Bukkit-Patches/*.patch' for reading: No such file or directory
  Something did not apply cleanly to Spigot-API.
  Please review above details and finish the apply then
  save the changes with rebuildPatches.sh```
fossil lily
#

What event is called when Water and Lava come together to make obsidian/cobblestone?

#

1.8.9

visual tide
#

use a newer version

fossil lily
#

Is there any way to prevent this happening on 1.8.9?

visual tide
#

no

#

unless you make your own spigot fork

#

but

#

just use a newer version

sharp verge
#

Can i make this more efficient ?

    public void promoteTeamMember(UUID member) {
        if(isTeamLeader(member)) throw new IllegalStateException("Cannot promote the team leader, leader is the highest status");
        if(!(teamRegistry.getTeam(member) == this)) throw new IllegalStateException("this player was not in the team that they tried to get promoted in");
        if (getTeamRole(member) == TeamRole.values()[2]) {
            memberList.put(member, TeamRole.values()[1]);
        }
        if (getTeamRole(member) == TeamRole.values()[1]) {
            Bukkit.getLogger().info("Only one player can be leader");
        }
    }```
```enum
package me.r4wpanda.hold;

public enum TeamRole {
    LEADER,
    CO_LEADER,
    MEMBER
}```
hasty wasp
#

why aren't you using the enum?

getTeamRole(member) == TeamRole.MEMBER
patent fox
#

is there a way to set a player's vision like an enderman's?

tardy delta
#

do not throw exceptions, rather return a boolean or smth

tender shard
#

da fuq

tardy delta
#

TeamRole.values()[0] -> TeamRole.LEADER

slate delta
#

Someone knows how to simplify this code

hasty wasp
sharp verge
#

Well what i meant was is there a way to simplify the code?

#

Btw that isn't the whole class

#

That's just what i need simplified, if possible

tardy delta
tender shard
tardy delta
#

true lol

real spear
#

I am trying to make it so a player is banned for a set amount of time. The .banPlayer() function can do this with the expiration date feature. I was wondering if there was a function that could take an input of time and add it to the current time. Ie. I input 20 mins and it returns the time it will be in 20 mins. I might just be being dumb

young knoll
#

System.currentTimeMills + your time in milliseconds

tardy delta
#

/ban fourteen bad 18263637 smh

onyx fjord
#

whats a good config framework/lib that yall use/recommend

#

with updater!

tardy delta
#

config framework which supports what?

slate delta
#

But there is no way to put the class in a variable and then make the constructor with the variable of this one? instead of putting all the parameters every time

real spear
tardy delta
#

yes

tardy delta
onyx fjord
ashen quest
onyx fjord
#

is using static for logger reasonable?

unreal quartz
#

Yes

merry lodge
#

yo is it possible to get more attributes (item attributes)

#

Like haste

young knoll
#

You can make custom ones using pdc

merry lodge
#

Whats that? Could you link me it please

young knoll
#

?pdc

ornate patio
#

so in vanilla minecraft when you set a world border to say, size 800

#

the nether's world border will automatically be set to 100

#

and idk how the end does it

#

is it possible to replicate this in spigot, or do I have to loop through each world and manually do it?

opal juniper
#

i mean, just loop through all the words and check the type. it’s not that hard

azure hawk
#

?paste

undone axleBOT
azure hawk
ornate patio
#

just wondering if theres a built in method

#

out of curiosity

quaint mantle
#

where can i ask for plugin devs again?
or find them

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!

azure hawk
#

?

#

Why ?ask

azure hawk
#

?notworking

undone axleBOT
#

"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.

azure hawk
crisp steeple
quiet ice
#
Caused by: java.lang.NullPointerException
	at buildserver.main.listeners.inventoryListener.onInvClick(inventoryListener.java:60) ~[?:?]

Those are the easiest to fix -.-

jade roost
#

any sites that would be recommended to start learning about coding spigot plugins

#

or videos

dusk flicker
#

do you know Java

jade roost
ornate patio
#

is there an event for when a player travels through a portal

dusk flicker
#

?learnspigot

#

need that tbh

jade roost
#

xd

dusk flicker
#

?wiki Has a lot of good resources

undone axleBOT
dusk flicker
jade roost
#

ok let me finish codecademy

noble lantern
#

if your doing code cademy one run through isnt to helpful for the basics

#

run through it a few times to cement the knowledge

jade roost
#

uh

dusk flicker
#

other resources will probably be good too

#

?learnjava

undone axleBOT
jade roost
#

Inside the loop, create a condition that checks if i is not divisible by 5. what does divisible mean

dusk flicker
#

divide

jade roost
#

a

#

uh

#

i hav no idea how to do it i forgot

#

;-;

dusk flicker
#

you dont know how to divide or you dont know how to implement division in Java

jade roost
#

how to implement division

dusk flicker
#

/

#

I would highly recommend you redo that course, a few times

jade roost
#

a

#

loops?

dusk flicker
#

the entire course

jade roost
#

oh

dusk flicker
#

or finish that one, and move down the list on learnjava

jade roost
#

wym

golden turret
#

hi. I want to write my own movement system using custom entities. Basically, I just need to check the block collision. How can I do that?
Current code java @Override public void move(EnumMoveType enummovetype, Vec3D vec3d) { IBlockData data = aU(); if (data.isAir()) setPosition(locX() + vec3d.b, locY() + vec3d.c, locZ() + vec3d.d); else setPosition(locX() + vec3d.b, locY(), locZ() + vec3d.d); }

echo basalt
#

there's a collide(vec3d) method

torn badge
#

% is the modulo operator, and it defines the leftover of a division. So 5 % 2 would be 1, since 2 fits into 5 twice and 1 is left over

jade roost
solid cargo
#

why does this still make the player pick up the enderpearl

#

PlayerAttemptPickupItemEvent

noble lantern
#

because that if event isnt firing more than likely

#

check the material type

#

dont use equals on itemstacks for checks

solid cargo
#

epearls cant differ tho

#

vanilla epearls*

noble lantern
#

So then debug log, see if that fires

azure hawk
#

that has nothing to do with that

crisp steeple
solid cargo
#

it spammed it

#

so ig idk what went wrong

noble lantern
#

Try using the PlayerPickupItemEvent instead of the attempt one

solid cargo
#

wait but when my homie drops his pearl he can pick it up

#

ok so it sometimes works and sometimes doesnt

#

when enderman drops item is it an item or an itemstack?

solid cargo
#

why are all javadocs light mode??????????

#

whyyyyyyyyy

noble lantern
#

he told you the line the exceptions happening on

Its either item meta is null or item name is null when using .equals

#

Also

#

Why InventoryClickEvent?

#

1.8?

golden turret
echo basalt
#

might be a paper thing

#

just decompile the move(...) method

#

and see how it worky

#

literally what I did

#

I decompiled it, checked every part for collisions and banged my head against the wall for 3 hours straight

golden turret
#

i did that but im using the obfuscated code 🤡

dim palm
#

hello how can i do a code that automatic builds a glass cube without nothing inside?

quaint mantle
#

Is it possible to create a custom packet listener

golden turret
#

yes, with ProtocolLib

noble lantern
#

he might mean without protocol lib

#

At least, i assume so since he said custom

noble lantern
#

You can likely steal fawes, or just use fawe api

astral smelt
#

guys, anyone here knows how thermos work ?

#

im trying to run a plugin that utilizes nms but aparently thermos does not have nms on his libraries

quaint mantle
#

From what I've read custompayload is my best guess

rain mason
#

it's me again!! how would I load NMS stuff? (specifically net.minecraft.server.v1_7_R4.ItemStack, NBTTagCompound, CraftItemStack)

peak depot
#

?paste

undone axleBOT
golden turret
#

it have some bugs

#

it is good enough for you to have the idea

#

the bugs are with /reload though

quaint mantle
#

flawless!

golden turret
#

1.17.1

peak depot
peak depot
rain mason
peak depot
golden turret
#

I would like to it ignore the slabs

twilit roost
#

how can I create custom toasts?
this thing

one plugin already does it, but idk how

jade roost
#

that looks hella complicated

peak depot
golden turret
twilit roost
#

do you remember just a part of the name?

rain mason
#

we were talking about this in a thread, but how would I install org.bukkit:bukkit? I ran buildtools many times before

#

so I have no idea why it doesnt exist

chrome beacon
#

Why do you need that

golden turret
#

see if it is in your ~/.m2/repositories

rain mason
rain mason
golden turret
#

then it is not running

#

try running it again

#

and if any error happens

#

paste it here

chrome beacon
#

You use the Spigot artifact for NMS

rain mason
#

just {coolThing:"coolValue"} not really

twilit roost
wet breach
golden turret
rain mason
chrome beacon
wet breach
rain mason
#

just so the plugin can tell if the item's special

chrome beacon
#

Why not use pdc

#

?pdc

peak depot
#

im using 1.8

wet breach
chrome beacon
peak depot
#

ok

rain mason
#

gonna check out if it works thx

peak depot
#

well how should I then go about doing it if I get the name in asyncchatevent

wet breach
#

just because you get the name from an asyncevent doesn't mean your entire method after has to be async

peak depot
#

yeah but how do I execute it then

chrome beacon
#

You can use the scheduler to jump back to the main thread

wet breach
#

^

chrome beacon
#

?scheduling

undone axleBOT
golden turret
#

?pdc

golden turret
#

@rain mason

rain mason
#

already working w it

golden turret
#

pdc good

rain mason
#

yeah

#

weird that I never heard about it tbh

#

i've searched up NBT tags so many times

wet breach
jade roost
#

i have 78% on codecademy almost done with my suffering

#

👐

wet breach
#

my suffering was done many moons and suns ago

jade roost
#

lol

river oracle
#

wtf is codecademy

wet breach
#

its a site that is suppose to help teach you java and other things

jade roost
#

yes

#

i am taking java course

#

i have 78%

wet breach
#

here are some other links

#

?learnjava

undone axleBOT