#help-development

1 messages · Page 1807 of 1

buoyant viper
#

?

#

that would essentially be like running /teleport @a 821 32 917 i guess since its getting all the online players

lapis lark
#

Ideas why i am getting Failed to create remapped artifact, project main artifact does not exist. for specialsource-maven-plugin?

solemn igloo
lapis lark
solemn igloo
#

Ok

buoyant viper
#

learning java and the bukkit/spigot api helps

solemn igloo
#

Is ok for me to only one player

near aurora
#

Hello, what's the best way to send a command to a plugin trough a website?

buoyant viper
#

sockets 😎

lapis lark
#

MySQL?)

near aurora
#

Alright thanks 🙂

#

Nah MySQL won't cut it haha

buoyant viper
near aurora
#

I mean so people can ban people from the website

buoyant viper
#

yeah u need a way for server and site to interact

near aurora
#

yeah

buoyant viper
#

so anything with communication works ig, http, websocket, custom java.net.Socket stuff

#

just a matter of [de]serializing the data

near aurora
#

I'm trying to make a staff hub for Spigot where people can monitor there server from a website, check who's online, execute commands etc

spiral light
#

is it fixed ?

lapis lark
#

No

#

I have tried a lot of configuration variants but still Failed to create remapped artifact, project main artifact does not exist

spiral light
#

you can take a look at this.... maybe it will help you

lapis lark
#

Yes, you have sent it yesterday

#

I have tried that too

spiral light
#

you would just need to edit names at the top ... and this wont work ?

lapis lark
#

Failed to create remapped artifact, project main artifact does not exist.

oak blaze
#

I've encountered a bug in spigot that has yet to be fixed officially, but I can fix said bug locally. Is there a way to have build tools build the local changes rather than fetching the bugged version from git?

spiral light
spiral light
lapis lark
#

With your edits

#

Same Failed to create remapped artifact, project main artifact does not exist., without plugin specialsource-maven-plugin jar contains net.minecraft.nbt.CompoundTag

spiral light
#

<finalName>ntdLuckyBlock-${project.version}</finalName>
can you remove this and try again?

lapis lark
#

same

spiral light
#

and you forgot

lapis lark
#

No

#

This lines in my modules

#

Each module contains this lines

#

parent pom not contains that

spiral light
lapis lark
#

It is a parent pom

spiral light
#

hmmm dont know about module-system in maven... did you try to add this too ?

lapis lark
#

Ok, i could try

#

same

lapis lark
#

Yes

sullen marlin
#

That’s probably where you’re getting the error from

spiral light
# lapis lark Yes

hmm weird ... maybe fault of a childmodules ? dont know about the modules system sry

lapis lark
#

To nms 1_18 module?

sullen marlin
#

To the child pom where you need it

spiral light
lapis lark
sullen marlin
#

The ss config is version dependent anyway

#

So putting it in the parent pom doesn’t make much sense

lapis lark
#

Thank you so much

#

I love you

oak blaze
#

Inside the issue is a full overview of the issue and how to fix it and then nobody actually submitted the fix

quaint mantle
#

then you should do that

#

dont wait for others

#

just submit a PR

#

and everything will be fine

#

and according to what i've seen, you dont really know how to use git isnt it?

oak blaze
#

I know how to use git

quaint mantle
#

oooo ok

oak blaze
#

I can submit a pr, but I'm not sure exactly how to test to verify the fix actually works

sullen marlin
#

Once you’ve committed your changes you can use BuildTools —dont-update to build

#

You can use —dev to have buildtools put you into the master branch

solemn igloo
#

Guys

#

Where do i add codes here

solemn igloo
#
public class HelloCommand implements CommandExecutor {
    
    @SuppressWarnings("unused")
    private Main plugin;
    
    public HelloCommand(Main plugin){
        this.plugin = plugin;
        plugin.getCommand("gravityaroundthepizza").setExecutor(this);
    }
    
    @Override
    public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
        if (!(sender instanceof Player)){
            sender.sendMessage("no console!");
            return true;
        }
        
        Player p = (Player) sender;
        
        if (p.hasPermission("gravity.use")) {
            p.sendMessage("GRAVITY AROUND THE PIZZA");
            return true;
        } else{
            p.sendMessage("Ur Gravity");
            
        }
        return false;
    }

} ```
#

where do i add codes

spiral light
#

in your plugin or what ?

solemn igloo
#

plugin

#

thats the command

spiral light
#

create a new class named 'HelloCommand'

solemn igloo
#

that's the hellocommand clas

spiral light
#

and you want the cmd to be added ?

solemn igloo
#

i alredy have a command setup

#

when i run it it chats GRAVITY AROUND THE PIZZA

spiral light
#

and whats the problem then ?

solemn igloo
#

i want to teleport all players to a coordinate

#

but idk where to put

lapis lark
#
public class HelloCommand implements CommandExecutor {
    
    public HelloCommand(Main plugin){
        plugin.getCommand("gravityaroundthepizza").setExecutor(this);
    }
    
    @Override
    public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
        /* code */
    }

} ```
solemn igloo
#

ty

spiral light
#

@Override
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
if (!(sender instanceof Player)){
sender.sendMessage("no console!");
return true;
}

    Player p = (Player) sender;
    
    if (p.hasPermission("gravity.use")) {
        Bukkit.getOnlinePlayers().forEach(n->n.teleport(location));
        return true;
    } else{
        p.sendMessage("Ur Gravity");
        
    }
    return false;
}
lapis lark
#

Ideas how to remove this?

#

shaded maven compiler

sullen marlin
#

Does it matter

lapis lark
#

I dont want provide this

sullen marlin
#

Otherwise search maven shade excludes / filters

solemn igloo
# lapis lark ``` public class HelloCommand implements CommandExecutor { public Hello...
    @Override
    public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
        if (!(sender instanceof Player)){
            sender.sendMessage("no console!");
            return true;
        }
        
        Player p = (Player) sender;
        
        if (p.hasPermission("gravity.use")) {
            p.sendMessage("GRAVITY AROUND THE PIZZA");
            return true;
        } else{
            p.sendMessage("Ur Gravity");
            
            Location loc = new Location(world, 821, 32, 917);
            Bukkit.getOnlinePlayers().forEach(p -> p.teleport(loc));
            return true;
            
        }
        return false;
    }

}
``` so like this?
sullen marlin
spiral light
#

md_5 how is it going with the new worldcreator 😄 ?

spiral light
#

this will now teleport only if you dont have the permission

solemn igloo
lapis lark
#

Yesterday i have tried a lot of build configurations and one of them have removed this. I dont know how remove it now... search maven shade excludes / filters trying to understand...

spiral light
lapis lark
solemn igloo
spiral light
#

i dont know where you want to put this

solemn igloo
spiral light
#

do you want to put it there when "GRAVITY AROUND THE PIZZA" displays in the chat ?

sullen marlin
#

See second example with meta inf filter excludes

sullen marlin
spiral light
solemn igloo
#

yea

solemn igloo
solemn igloo
spiral light
#

where "GRAVITY AROUND THE PIZZA" will be send ?

solemn igloo
#

Yes

buoyant viper
#

then move it into there

lapis lark
#

It works

solemn igloo
# buoyant viper then move it into there
    @Override
    public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
        if (!(sender instanceof Player)){
            sender.sendMessage("no console!");
            return true;
            
            Location loc = new Location(world, 821, 32, 917);
            Bukkit.getOnlinePlayers().forEach(p -> p.teleport(loc));
            return true;
            
        }
        
        Player p = (Player) sender;
        
        if (p.hasPermission("gravity.use")) {
            p.sendMessage("GRAVITY AROUND THE PIZZA");
            return true;
        } else{
            p.sendMessage("Ur Gravity");
``` so like that or something different?
spiral light
#

wtf

#

you want it at the same position like "GRAVITY AROUND THE PIZZA" right ?

solemn igloo
#

yea

spiral light
#

why do you dont put it there then ?

solemn igloo
#

mix it in with gravity around the pzza?

spiral light
#

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

spiral light
#

?commands

#

?learnjava

undone axleBOT
spiral light
#

there you go

solemn igloo
lapis lark
#

Without knowing java basics you cannot code plugin

#

If you want obligate us to code it for you it is really not a good solution

solemn igloo
#

ok ;-;

lapis lark
#

Community ready to help you, but not code full plugin from scratch

chrome beacon
#

If you need it fast pay someone to make it

chrome beacon
#

?services

undone axleBOT
vital lotus
#

Why is new Entity hide/show API got deprecated?

chrome beacon
#

It's draft api

#

It might not be 100% finished yet

vital lotus
#

Ah I see, okay thanks

#

Didnt saw that

wicked lake
#

@solemn igloo it's clear that you want to learn how to make a plugin, but I must make it perfectly clear that you need to learn how to program before you dive into this. I made the same mistake a couple years ago and it put me off the programming game for a while before I got back into it with Python. Any one of the links that have been being given to you all night are good, you just need to learn this first.

wicked lake
# solemn igloo ok

I'm happy to code a quick plugin for you if you need it right now, free of charge. It's 2:31 am right now so I can start work on it tomorrow. Just DM me what you need

novel kite
#

it's like Gordon Ramsey but discord mod

spiral light
#

stop writing ... so annoying

candid galleon
#

congratulations you are wasting people's time, bandwidth, space, air, oxygen, and your own life

#

👍

novel kite
#

if he's doing this then he was planning on wasting all of that either way

candid galleon
#

true

#

not like you can use it productively

novel kite
#

pshhbhb

#

okay atleast move out of a chat meant for helping people smh

quaint mantle
#

someone was deleted my messages...

#

ok bro i will help you

candid galleon
#

save the messages!

quaint mantle
#

ok i helped you bro no prob

vivid cave
#

usually modules have a maven guide and at least a compiled version already, this one has none

quaint mantle
#

who gonna do it...?

#

btw it was 3 years ago

vivid cave
#

sorry if my question seems a bit "u should learn java in the first place" i simply never really gave a freak about compiling and stuff and now that i search i can't find

quaint mantle
#

i dont think learnjava command really effective?

#

oh the compile

#

hmm k

#

?learnjava when 😂

undone axleBOT
vivid cave
#

bruh

#

I just want to compile it with maven

quaint mantle
#

hmmm

vivid cave
#

Can anyone help me

quaint mantle
#

it doesnt have pom.xml

vivid cave
#

yeah thats the whole pb

quaint mantle
#

if normal then you can just go and use mvn -e clean install

#

but if you dont then get a template from somewhere

vivid cave
#

alright

quaint mantle
#

and try to get every dependencies the repo need and put it in pom.xml

vivid cave
#

will do, thanks for the help, i'll update on how it goes

mighty pier
#
    public JavaPlugin plugin = Utilities.getPlugin(Utilities.class);
    @EventHandler
    public void OnJoin(@NotNull PlayerJoinEvent e){
        Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, () -> {
            Player p = e.getPlayer();
            Location location = p.getLocation();
            p.playSound(location, Sound.ENTITY_PLAYER_LEVELUP, 1.0F, 1.0F);
        }, 20L);
    }
}``` it doesnt play the sound
#

i tried sending a message and it didnt work either

brittle loom
#

Hello, I'm getting an error when I try removing a merchant, could you help me figure out what I'm doing wrong? ``` @EventHandler
public void onInventoryClose(final InventoryCloseEvent event) {
if (event.getInventory().getType() == InventoryType.MERCHANT && event.getPlayer().hasMetadata("Trading")) {
System.out.println("Holder: " + event.getInventory().getHolder());
final InventoryHolder merchant = event.getInventory().getHolder();

        ((Entity) merchant).remove();
        //event.getPlayer().removeMetadata("Trading", SimplePlugin.getInstance());
    }
}```
chrome beacon
#

What's the error

coral bobcat
#

I made a small hello world plugin, it’s just 30 lines of code and does nothing but add a new recipe to the item stack. The .jar i get is 51 MB. Is this normal? Dependencies I guess?

quaint mantle
#

you forgot to add <scope>provided</scope>...

brittle loom
quaint mantle
#

great job compiling the entire jar into your file

coral bobcat
#

Ah that makes sense thanks

vivid cave
#

any clue?

quaint mantle
#

it pretty obvious isnt it?

#

learn how to make bukkit plugin when

#

oh wait, the pom.xml

#

does it contain the line with src/main/resources?

#

if it does

#

then move config.yml, plugin.yml or everything related to the jar but isnt .java files to that folder

#

dont move license and readme btw, it does nothing so dont need to keep it

vivid cave
#

alright will do

quaint mantle
#

?learnmaven when?

#

wait there is no learnmaven...?

vivid cave
#

also i was wondering

#

but their plugin.yml doesn't contain it

#

where should i add it?

quaint mantle
#

huh...?

#

....

vivid cave
#

nvm it does

solemn igloo
#
[18:31:17 ERROR]: Error occurred while enabling GravityAroundThePizza v1.0 (Is it up to date?)
java.lang.NullPointerException: Cannot invoke "org.bukkit.command.PluginCommand.setExecutor(org.bukkit.command.CommandExecutor)" because the return value of "me.Jaden.GravityProject.Main.getCommand(String)" is null
vale ember
solemn igloo
#

no

#

wait

vale ember
#

you should

solemn igloo
#

i will add it wait

#

@vale ember

vale ember
#

yes?

solemn igloo
#

Should i do it like this

#
commands:
gravityaroundthepizza
#

or do i add more

#

thats the only commands

#

command*

vale ember
#

and make sure you keep all indentations

solemn igloo
#

@vale ember

#

whats load

vale ember
#

don't mind, just check command section

solemn igloo
#

ok

#

i dont have another command

#

its just gravityaroundthepizza

vale ember
#

then just add only one

solemn igloo
#

ok

#
name: GravityAroundThePizza
version: 1.0
author: JadenPlaysMC569
main: me.Jaden.GravityProject.Main
description: FIRST PLUGIN I CODED
api: 1.18
commands:
gravityaroundthepizza
#

Is thsi gud

vale ember
#

no

#

keep indentations!

#

YAML will not parse it correctly

solemn igloo
#

what is indentations

vale ember
#

place 2 spaces before 'gravityaroundthepizza'

solemn igloo
#

ohh ok

#

ok

#

i put it

vale ember
#

Also, java package names should be lowercase ALL

#

like me.jaden.gravityproject, not me.Jaden.GravityProject

solemn igloo
#

k

#

do i change theothers

#

or thats it

vale ember
#

2 spaces should be only before command name

solemn igloo
#

yes

vale ember
#

other is ok

solemn igloo
#
name: GravityAroundThePizza
version: 1.0
author: JadenPlaysMC569
main: me.jaden.gravityproject.main
description: FIRST PLUGIN I CODED
api: 1.18
commands:
  gravityaroundthepizza
#

Thats good?

vale ember
#

it should be ok

solemn igloo
#

ok thakns

summer scroll
#

add : at the end of the command

solemn igloo
#

Then?

summer scroll
#

change api to api-version

solemn igloo
#

ok

#

then?

vale ember
#

also did you changed the actuall name of package?

summer scroll
#

that's it ig

vale ember
#

and class names should be CamelCase

#

me.jaden.gravityproject.Main

solemn igloo
#

ok wait'

#

done

quaint mantle
#

anyone know why i might be getting "cannot access <package>" when im trying to use 1.18 NMS?

vale ember
solemn igloo
#

@vale ember i ahve error

summer scroll
vale ember
vale ember
solemn igloo
vale ember
quaint mantle
#

cannot access net.minecraft.world.entity.npc.InventoryCarrier
cannot access net.minecraft.world.entity.ai.goal.PathfinderGoalLookAtPlayer
cannot access net.minecraft.world.level.GeneratorAccessSeed

#

on compile

summer scroll
#

what is your java version for the project

quaint mantle
solemn igloo
summer scroll
solemn igloo
#

ok

summer scroll
#

and it's case-sensitive

chrome beacon
quaint mantle
#

'x()' in 'net.minecraft.world.entity.EntityInsentient' clashes with 'x()' in 'net.minecraft.world.entity.EntityLiving'; attempting to use incompatible return type

#

anyone seen this?

#

no idea how to fix

solemn igloo
#

@summer scroll when i did the command this showed p

quaint mantle
#

tried adding in a filler and it errored x() in me.marco.Economy.NMSShopkeeper cannot override x() in net.minecraft.world.entity.EntityLiving

solemn igloo
#
[18:53:18 WARN]: Unexpected exception while parsing console command "gravityaroundthepizza"
org.bukkit.command.CommandException: Unhandled exception executing command 'gravityaroundthepizza' in plugin GravityAroundThePizza v69420.69
    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:47) ~[spigot-api-1.18-R0.1-SNAPSHOT.jar:?]
    at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:149) ~[spigot-api-1.18-R0.1-SNAPSHOT.jar:?]
    at org.bukkit.craftbukkit.v1_18_R1.CraftServer.dispatchCommand(CraftServer.java:800) ~[spigot-1.18-R0.1-SNAPSHOT.jar:3353-Spigot-dbf4938-f49e9d1]
    at org.bukkit.craftbukkit.v1_18_R1.CraftServer.dispatchServerCommand(CraftServer.java:785) ~[spigot-1.18-R0.1-SNAPSHOT.jar:3353-Spigot-dbf4938-f49e9d1]
    at net.minecraft.server.dedicated.DedicatedServer.bf(DedicatedServer.java:453) ~[spigot-1.18-R0.1-SNAPSHOT.jar:3353-Spigot-dbf4938-f49e9d1]
    at net.minecraft.server.dedicated.DedicatedServer.b(DedicatedServer.java:429) ~[spigot-1.18-R0.1-SNAPSHOT.jar:3353-Spigot-dbf4938-f49e9d1]
    at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:1206) ~[spigot-1.18-R0.1-SNAPSHOT.jar:3353-Spigot-dbf4938-f49e9d1]
    at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:1034) ~[spigot-1.18-R0.1-SNAPSHOT.jar:3353-Spigot-dbf4938-f49e9d1]
    at net.minecraft.server.MinecraftServer.lambda$0(MinecraftServer.java:304) ~[spigot-1.18-R0.1-SNAPSHOT.jar:3353-Spigot-dbf4938-f49e9d1]
    at java.lang.Thread.run(Thread.java:833) [?:?]
Caused by: java.lang.Error: Unresolved compilation problem: 
    String literal is not properly closed by a double-quote

    at me.Jaden.GravityProject.commands.HelloCommand.onCommand(HelloCommand.java:26) ~[?:?]
    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[spigot-api-1.18-R0.1-SNAPSHOT.jar:?]
    ... 9 more
vale ember
#

send your command code, there's an error

quaint mantle
solemn igloo
summer scroll
solemn igloo
#

@vale ember

quaint mantle
#

id love to use my old code but i guess thats nms pains

solemn igloo
# solemn igloo <@!740236306491375808>
    @SuppressWarnings("unused")
    private Main plugin;
    
    public HelloCommand(Main plugin){
        this.plugin = plugin;
        plugin.getCommand("gravityaroundthepizza").setExecutor(this);
summer scroll
#

i don't know, i'm still trying figure it out too

quaint mantle
#

😂

summer scroll
#

without using remapped-mojang, that's confusing as hell

quaint mantle
#

i guess its changed heaps

#

i mean nahhh

quaint mantle
#

deepdiving is part of the fun but

vale ember
quaint mantle
#

this is just bonkers

chrome beacon
quaint mantle
#

'x()' in 'net.minecraft.world.entity.EntityInsentient' clashes with 'x()' in 'net.minecraft.world.entity.EntityLiving'; attempting to use incompatible return type

summer scroll
#

what is

#

EntityArmorStand on remapped?

chrome beacon
#

ArmorStand would be my guess

solemn igloo
summer scroll
#

hold on, let me open my ide

quaint mantle
#

wait how do u even spawn stuff in in 1.18??

#
        super(EntityTypes.aX, ((CraftWorld) loc.getWorld()).getHandle());
        WorldServer craftWorld = ((CraftWorld) loc.getWorld()).getHandle();

        this.bR.a(0, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 16.0F));

        this.b(loc.getX(), loc.getY(), loc.getZ());
        craftWorld.addWithUUID(this, CreatureSpawnEvent.SpawnReason.CUSTOM);
    }```
#

is his like not how u do it anymore

chrome beacon
#

Level#addFreshEntity with mojmaps

#

Since you're using unmapped good luck finding it

quaint mantle
#

public class NMSShopkeeper extends EntityVillagerTrader {
errors
'x()' in 'net.minecraft.world.entity.EntityInsentient' clashes with 'x()' in 'net.minecraft.world.entity.EntityLiving'; attempting to use incompatible return type

quaint mantle
vale ember
#

how can i use remapped version with gradle?

chrome beacon
#

To solve it use remapped

quaint mantle
#

its from spigot itself tho

#

isnt remapped like

#

not allowed to be compiled with or smth

#

so it wont solve my problem anyway bc when i re-compile with non mapped itll be the same

summer scroll
#

what is EnumItemSlot on remapped?

chrome beacon
#

🤷‍♂️ find it yourself

#

Working with NMS is mostly unsupported

quaint mantle
#

how else do u make numb entities with look@player tho

chrome beacon
#

You don't

quaint mantle
#

exactly

#

:/

summer scroll
#

oh okay

#

the package names are still the same right?

#

i guess i can find it from the package names

quaint mantle
vivid cave
quaint mantle
#

i just go on an old version and 1:1 deep dive

#

usually works

#

dont even need to do the mapping thing but probs makes life ez

#

so far most thing shave stayed the same

#

@summer scroll im getting the error even when i make my object extend EntityArmorStand

#

are you also getting it?

chrome beacon
summer scroll
#

nah

quaint mantle
#

wtf

#

can i see ur class

vivid cave
quaint mantle
#

Is there an event that gets triggered when a player gets deop'd?

#

am i just stupid or is NMS on the new patch literally impossible

quaint mantle
eternal oxide
#

of the two given options, the second one is wrong

summer scroll
quaint mantle
#

I need to prevent /deop'ing

quaint mantle
#

and just print the deop message

#

without the player being deopd

#

can u show me ur class pls i legit cant get anything to work

#

so fried

#

how r u creating nms entities

summer scroll
#

still haven't tried yet

quaint mantle
#

o

chrome beacon
summer scroll
#

what about packets Olivio?

quaint mantle
#

i mean i just cant override a read only abstract class

#

unsolved ig

summer scroll
#

Clientbound hmm

chrome beacon
vivid cave
slim cairn
#

How would I give the player an Item when they stand on a type of block? For example blue glass

chrome beacon
quaint mantle
brittle loom
vivid cave
#

uhm how can i open the jar from command line?

#

do u just want me to read its content? (characters)

chrome beacon
brittle loom
#

I'm using lambda

#

Common.runLater(1, () -> (Entity) merchant).remove();

slim cairn
quaint mantle
# slim cairn Could you elaborate? I suck at Java :3
@EventHandler
public void onMove(PlayerMoveEvent event){
Player player = event.getPlayer(); // get the player
Block block = player.getLocation().add(0, -1, 0);
if(block == null) return;
if(block.getType() == Material.DIAMOND_BLOCK){
        player.getInventory().addItem(new ItemStack(Material.DIAMOND_BLOCK, 64));
    }
}
#

might not work

chrome beacon
quaint mantle
#

i wrote it off memory here

tardy delta
#

what's the difference between a player's metadata and the persistent data container?

vivid cave
chrome beacon
undone axleBOT
ivory sleet
#

Olivo r u at your pc? If so can you push 😅

chrome beacon
#

Yeah

brittle loom
ivory sleet
#

Thanks :3

chrome beacon
slim cairn
# quaint mantle ``` @EventHandler public void onMove(PlayerMoveEvent event){ Player player = eve...
package com.host.ringitem;

import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.player.PlayerMoveEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.java.JavaPlugin;

public final class RingItem extends JavaPlugin
{

    @Override
    public void onEnable()
    {

    }

    @EventHandler
    public void onMove(PlayerMoveEvent event){
        Player player = event.getPlayer(); // get the player
        Block block = (Block) player.getLocation().add(0, -1, 0);
        if(block == null) return;
        if(block.getType() == Material.DIAMOND_BLOCK){
            player.getInventory().addItem(new ItemStack(Material.DIAMOND_BLOCK, 64));
        }
    }
    @Override
    public void onDisable()
    {

    }
``` I spammed alt Enter and now I dont seem to have any errors 🤔
ivory sleet
#

🙌🙌

solemn igloo
# vale ember i mean onCommand method's body

public class HelloCommand implements CommandExecutor {

@SuppressWarnings("unused")
private Main plugin;

public HelloCommand(Main plugin){
    this.plugin = plugin;
    plugin.getCommand("gravityaroundthepizza").setExecutor(this);
}

@Override
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
    if (!(sender instanceof Player)){
        sender.sendMessage("WHY U IN CONSOLE U MUST BE IN GAME"");

        return true;
slim cairn
#

IntelliJ moment

chrome beacon
vivid cave
quaint mantle
#

i dont get what u mean

#

bit tired sorry

chrome beacon
quaint mantle
#

@slim cairn do you need to registerevents for javaplugisn

#

try add getServer().getPluginManager().registerEvents(this, this); in onEnable() idk if u need to do that

vivid cave
slim cairn
pastel mauve
slim cairn
#
package com.host.ringitem;

import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerMoveEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.java.JavaPlugin;

public final class RingItem extends JavaPlugin implements Listener {

    @Override
    public void onEnable()
    {

    }

    @EventHandler
    public void onMove(PlayerMoveEvent event){
        Player player = event.getPlayer(); // get the player
        Block block = (Block) player.getLocation().add(0, -1, 0);
        if(block.getType() == Material.GREEN_STAINED_GLASS)
        {
            player.getInventory().addItem(new ItemStack(Material.LIGHT_BLUE_DYE, 1));
        }
    }
    @Override
    public void onDisable()
    {

    }
}

``` I changed a bit more, how's this?
slim cairn
summer scroll
gritty urchin
#

How do I stop fake blocks from disappearing on left or right click?

quaint mantle
#

i dont see anything wrong with it

slim cairn
#

How do I export it to a usable .jar for my server lol

quaint mantle
#

idk its been a while since ive done starter tutorial plugins

#

uh

#

what are you using 😂

#

eclipse or intellij

slim cairn
#

Intellij

#

How do you think I was able to fix itt with spamming alt enter

quaint mantle
#

are you using maven

slim cairn
#

ye Maven

quaint mantle
#

uh

#

you need to like

gritty urchin
quaint mantle
#

far out i dont even remember my own

#

linking him wont help tbh if hes a noob he just wants to learn by doing

#

he will learn by reading when hes had more hands on imo

gritty urchin
#

It literally tells you want to do

#

What do you think hes doing now

#

reading what we're saying

#

same thing

slim cairn
#

Reading is exactly what learning is

quaint mantle
#

haha

#

if u understand it go for it

#

just wanted to help u m8

#

i remember even after following that there was smth else i had to do but that might just b me

#

gl

slim cairn
#

nah its fine I was just confused

ivory sleet
quaint mantle
#

by doing 🕺

gritty urchin
#

@ivory sleet How do I stop fake blocks from disappearing on left or right click?

quaint mantle
#

@ivory sleet are u a contributor?

gritty urchin
#

No

quasi epoch
#

Looking for someone to code me a very simple chest locking plugin. DM me for more info and to discuss price!

gritty urchin
#

he is a discord helper

quaint mantle
#

i see

#

has anyone thats come online recently dealt with 1.18 nms?

#

im getting 'x()' in 'net.minecraft.world.entity.EntityInsentient' clashes with 'x()' in 'net.minecraft.world.entity.EntityLiving'; attempting to use incompatible return type

quaint mantle
#

like a fake block update

solemn igloo
#

Who can help me

quaint mantle
#

i think from my little testing experience you can just like send another fake update

quaint mantle
#

i wasnt reading urs

solemn igloo
# quaint mantle what was ur problem again
[18:53:18 WARN]: Unexpected exception while parsing console command "gravityaroundthepizza"
org.bukkit.command.CommandException: Unhandled exception executing command 'gravityaroundthepizza' in plugin GravityAroundThePizza v69420.69
    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:47) ~[spigot-api-1.18-R0.1-SNAPSHOT.jar:?]
    at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:149) ~[spigot-api-1.18-R0.1-SNAPSHOT.jar:?]
    at org.bukkit.craftbukkit.v1_18_R1.CraftServer.dispatchCommand(CraftServer.java:800) ~[spigot-1.18-R0.1-SNAPSHOT.jar:3353-Spigot-dbf4938-f49e9d1]
    at org.bukkit.craftbukkit.v1_18_R1.CraftServer.dispatchServerCommand(CraftServer.java:785) ~[spigot-1.18-R0.1-SNAPSHOT.jar:3353-Spigot-dbf4938-f49e9d1]
    at net.minecraft.server.dedicated.DedicatedServer.bf(DedicatedServer.java:453) ~[spigot-1.18-R0.1-SNAPSHOT.jar:3353-Spigot-dbf4938-f49e9d1]
    at net.minecraft.server.dedicated.DedicatedServer.b(DedicatedServer.java:429) ~[spigot-1.18-R0.1-SNAPSHOT.jar:3353-Spigot-dbf4938-f49e9d1]
    at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:1206) ~[spigot-1.18-R0.1-SNAPSHOT.jar:3353-Spigot-dbf4938-f49e9d1]
    at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:1034) ~[spigot-1.18-R0.1-SNAPSHOT.jar:3353-Spigot-dbf4938-f49e9d1]
    at net.minecraft.server.MinecraftServer.lambda$0(MinecraftServer.java:304) ~[spigot-1.18-R0.1-SNAPSHOT.jar:3353-Spigot-dbf4938-f49e9d1]
    at java.lang.Thread.run(Thread.java:833) [?:?]
Caused by: java.lang.Error: Unresolved compilation problem: 
    String literal is not properly closed by a double-quote

    at me.Jaden.GravityProject.commands.HelloCommand.onCommand(HelloCommand.java:26) ~[?:?]
    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[spigot-api-1.18-R0.1-SNAPSHOT.jar:?]
    ... 9 more
slim cairn
#

Legit just had to double click package

quaint mantle
slim cairn
quaint mantle
slim cairn
quaint mantle
#

easy lmk how u go

solemn igloo
solemn igloo
# quaint mantle show me ur yml
name: GravityAroundThePizza
version: 1.0
author: JadenPlaysMC569
main: me.Jaden.GravityProject.Main
description: FIRST PLUGIN I CODED
version-api: 1.18
commands:
  gravityaroundthepizza:
quaint mantle
#
commands:
  gravityaroundthepizza:
    description: gravityaroundthepizza
    usage: /<gravityaroundthepizza>
    aliases: [gatp]
#

make it that

#

copy mine over your commands part

solemn igloo
#

Wdym

quaint mantle
#
name: GravityAroundThePizza
version: 1.0
author: JadenPlaysMC569
main: me.Jaden.GravityProject.Main
description: FIRST PLUGIN I CODED
version-api: 1.18
commands:
  gravityaroundthepizza:
    description: gravityaroundthepizza
    usage: /<gravityaroundthepizza>
    aliases: [gatp]
#

make this your yml brother

solemn igloo
#

Ok thanks but can u dm me this because im on my phone rn

quaint mantle
#

nooo

#

not opening a dm with random ppl soz

ivory sleet
#

Interesting command name

quaint mantle
#

new minigame

solemn igloo
quaint mantle
#

classic

ivory sleet
quaint mantle
#

ah im not verified

#

i dont even have a spigot account

#

@ivory sleet how would you make shopkeepers without nms

#

its broken in 1.18

gritty urchin
#

but completely breaking block

#

doesnt

#

I am using PlayerInteractEvent

quaint mantle
#

hm

#

so clicking lets you mine it now

#

right

#

i wonder if it triggers blockbreakevent?

#

or if the client sends some sort of trigger

gritty urchin
#

yeah it doesnt

#

I tried

quaint mantle
#

i wonder if like

#

nah itd be strictly client side

#

im assuming you cant put a placeholder there?

#

are you trying to cancel it

#

or smth

ivory sleet
quaint mantle
#

had some code in 1.17 but 1.18 nms is sooo bad 😭

ivory sleet
#

Oh use citizens api?

slim cairn
#
package com.host.ringitem;

import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerMoveEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.java.JavaPlugin;

public final class RingItem extends JavaPlugin implements Listener {

    @Override
    public void onEnable()
    {

    }

    @EventHandler
    public void onMove(PlayerMoveEvent event){
        Player player = event.getPlayer(); // get the player
        Block block = (Block) player.getLocation().add(0, -1, 0);
        if(block.getType() == Material.GREEN_STAINED_GLASS)
        {
            player.getInventory().addItem(new ItemStack(Material.LIGHT_BLUE_DYE, 1));
        }
    }
    @Override
    public void onDisable()
    {

    }
}

``` Okay so this didnt work
gritty urchin
#

Yeah so right / left click respawns it

quaint mantle
ivory sleet
#

That’s a you problem

quaint mantle
#

ego reason

#

yessir

gritty urchin
#

but completely destroying

gritty urchin
#

makes the original block visible

#

and I don't know how to listen

#

for that

ivory sleet
#

Idk why you would hate abstraction of things

#

Sounds pretty lame

quaint mantle
#

id have thought it'd play out a break event on the original

quaint mantle
#

also masochism

#

like+retweet this if you like bdsm or pizza

ivory sleet
#

I guess I can accept masochism as an argument

gritty urchin
#

and Action.LEFT_CLICK_BLOCK

quaint mantle
gritty urchin
#

no

slim cairn
gritty urchin
#

just in general

quaint mantle
slim cairn
#

I did.. nothing happened

quaint mantle
#

import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerMoveEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.java.JavaPlugin;

public final class RingItem extends JavaPlugin implements Listener {

    @Override
    public void onEnable()
    {

    }

    @EventHandler
    public void onMove(PlayerMoveEvent event){
        Player player = event.getPlayer(); // get the player
        getServer().broadcastMessage("Hello there!");
        Block block = (Block) player.getLocation().add(0, -1, 0);
        if(block.getType() == Material.GREEN_STAINED_GLASS)
        {
            player.getInventory().addItem(new ItemStack(Material.LIGHT_BLUE_DYE, 1));
        }
    }
    @Override
    public void onDisable()
    {

    }
}```
slim cairn
#

oh

quaint mantle
#

tell me if the message prints out

quaint mantle
gritty urchin
#

No message prints out when desrtoying the block

quaint mantle
#

i.e on left click change the item in their hand

#

but dont update the inventory

#

or just update it

#

just dont let them mine

#

fk em 😂

ivory sleet
#

May I ask why are you casting a Location to a Block?

quaint mantle
#

in my original

slim cairn
#

which one lolhttps://gyazo.com/08d4dcb03eb2fd75a97d77e40f40415e

ivory sleet
quaint mantle
#

OOPS

#

tired

gritty urchin
ivory sleet
#

😅

quaint mantle
#

for one tick

#

then right after maybe anoither tick

gritty urchin
#

??

quaint mantle
#

like oninteract, set it to air, then a tick after, make it glass again

#

that way the mine stops

#

and they physically cant break it in time

#

unless theyre hacking

#

import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerMoveEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.java.JavaPlugin;

public final class RingItem extends JavaPlugin implements Listener {

    @Override
    public void onEnable()
    {

    }

    @EventHandler
    public void onMove(PlayerMoveEvent event){
        Player player = event.getPlayer(); // get the player
        getServer().broadcastMessage("Hello there!");
        Block block = player.getLocation().add(0, -1, 0).getBlock();
        if(block.getType() == Material.GREEN_STAINED_GLASS)
        {
            player.getInventory().addItem(new ItemStack(Material.LIGHT_BLUE_DYE, 1));
        }
    }
    @Override
    public void onDisable()
    {

    }
}```

@slim cairn
quaint mantle
#

make it this brother my bad

#

WAIT

#

editing

#

go

#

copy it now @slim cairn

quaint mantle
# gritty urchin ??

if you make it so they cant mine it your problem is solved as scuffed as it seems

#

since its client side theres not much u cando unless u wanna start dancing around with packets or protocollib

#

too lucrative to play with unless you enjoy mental gymnastics and update changes

tacit drift
ivory sleet
#

Uh like use

#

?paste

undone axleBOT
ivory sleet
#

Prnt thing doesn’t work on my phone

tacit drift
#

k

quaint mantle
#

@ivory sleet do u know any smart people that might be able to help me with my NMS problem

ivory sleet
gritty urchin
solemn igloo
#

@quaint mantle can u answer my question

quaint mantle
quaint mantle
quaint mantle
ivory sleet
gritty urchin
quaint mantle
#

np brother

#

glad i could help

#

@solemn igloo what went wrong

#

show me ur error

solemn igloo
#

I need to teleport @a to a specific coordinates and someone sent me this code

#
Location loc = new Location(world, 821, 32, 917);
Bukkit.getOnlinePlayers().forEach(p -> p.teleport(loc));```
#

Where do i put it

quaint mantle
#

show me you rcommand

ivory sleet
#

new DataFiles().getMessages() is null gushell

quaint mantle
#

@ivory sleet can u raise the issue i had w the devs

#

idk if anyone else has had it but

#

kinda sad to see it happen

ivory sleet
#

What issue?

quaint mantle
#

ruined my scheudle 😭

#

let me find it

solemn igloo
# quaint mantle show me you rcommand
public class HelloCommand implements CommandExecutor {
    
    @SuppressWarnings("unused")
    private Main plugin;
    
    public HelloCommand(Main plugin){
        this.plugin = plugin;
        plugin.getCommand("gravityaroundthepizza").setExecutor(this);
    }
    
    @Override
    public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
        if (!(sender instanceof Player)){
            sender.sendMessage("WHY U IN CONSOLE U MUST BE IN GAME"");

            return true;
quaint mantle
#

i deleted the code so i coudl compile

#

ill scroll up

solemn igloo
quaint mantle
ivory sleet
#

@tacit drift thing is

opal juniper
quaint mantle
#

i made

return false
}```
ivory sleet
#

You probably want to use
DataFiles files = new DataFiles();
files.createPluginFolder();
Configuration config = files.getMessages();

quaint mantle
#

and it didnt work

#

it said some shit like cant override it

tacit drift
#

hmm

#

i will test

opal juniper
#

why

ivory sleet
#

Such that you reuse the same DataFiles object

solemn igloo
ivory sleet
#

Instead of having two different ones

quaint mantle
#

like i do everything else with nms

#

'x()' in 'net.minecraft.world.entity.EntityInsentient' clashes with 'x()' in 'net.minecraft.world.entity.EntityLiving'; attempting to use incompatible return type

#

i cant change the return type of x() in EntityInsentient or EntityLiving

#

both are read only

chrome beacon
#

Try using remapped

solemn igloo
quaint mantle
opal juniper
#

true - olivio GigaBrain

quaint mantle
#

you cant compile with remapped

tacit drift
quaint mantle
#

following the eula

chrome beacon
#

You can

solemn igloo
chrome beacon
quaint mantle
#

of remapped?

#

doesnt compiling my jar means i get the remapped source code with it

#

even tho i probably wont get sued by microsoft id still rather not do that

#

and considering it works fine normally i feel like this is an easy fix

#

i people up above are aware of it

chrome beacon
solemn igloo
quaint mantle
#
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
    if (cmd.getName().equalsIgnoreCase("gravityaroundthepizza")) { // If the player typed /gravityaroundthepizza then do the following, note: If you only registered this executor for one command, you don't need this
        if (!(sender instanceof Player)){
            sender.sendMessage("WHY U IN CONSOLE U MUST BE IN GAME"");
            return true;
}
    Location loc = new Location(world, 821, 32, 917);
Bukkit.getOnlinePlayers().forEach(p -> p.teleport(loc));
        return true;
    } //If this has happened the function will return true. 
        // If this hasn't happened the value of false will be returned.
    return true; 
}
#

@solemn igloo enjoy

solemn igloo
#

Omg tyy

proven raptor
#

hello! Does anyone have any Linux-compatible profiler to recommend? I'm looking to investigate into my plugin thread usage, after ~10mn of use my server becomes super slow and often runs several hundreds of ticks behind

eternal oxide
#

if it only takes 10 mins to crawl to a stop you don;t need a profiler

#

look at every point where you create any new Threads/tasks

proven raptor
#

well currently I have only one additional thread running, and while I get why I can take much performance (without going much into details I have an external WASM module that constantly polls for events), I don't get why it actually does, it's at the lowest possible priority and doesn't affect directly performance once running, but only after a while

tacit drift
#

i think this can help you

#

¯_(ツ)_/¯

eternal oxide
#

performance drop over time you are either creating more and more threads, or you are filling up memory

proven raptor
proven raptor
slim cairn
#
package com.host.ringitem;

import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerMoveEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.java.JavaPlugin;

public final class RingItem extends JavaPlugin implements Listener {

    @Override
    public void onEnable()
    {
        getServer().getPluginManager().registerEvents(this, this);
    }

    @EventHandler
    public void onMove(PlayerMoveEvent event){
        Player player = event.getPlayer(); // get the player
        Block block = player.getLocation().add(0, -1, 0).getBlock();
        if(block.getType() == Material.LIME_STAINED_GLASS)
        {
            player.getInventory().addItem(new ItemStack(Material.LIGHT_BLUE_DYE, 1));
            player.teleport(new Location(player.getWorld(), 1, 63, 0));
        }
       
    }
    @Override
    public void onDisable()
    {

    }
}
```so this would be the final thing?
tardy delta
#

whoa am i looking at the bible every time i join?

#

also Location#subtract(0, 1, 0)?

gritty urchin
#

Is it possible to send linked glass pane block changes?

tired monolith
#

Hi everyone, I have a question. When I used the updated Inventory title in 1.18, it caused the item to be cleared, but it was fully usable in 1.17.
Does anyone know the reason?

slim cairn
slim cairn
#

General question: Is there ANY blocks in minecraft that are invisible & non-collidable? Ones that arent string.

ivory sleet
#

air blocks

slim cairn
#

anything else?

#

because I dont want the player to be getting a token every time they touch air 🚎

summer scroll
#

Umm, so I use remapped-mojang on Gradle, and how can I reobfuscate the thing?

eternal oxide
#

specialsouce?

summer scroll
#

yeah but i don't know how to use it on gradle

tardy delta
#

but those are obtained with the /give command

quaint mantle
slim cairn
#

for example, flies into it with an elytra

peak depot
#

Hi, I want to try out the new 1.18 spigot version but I dont get any classes like JavaPlugin or CommandExecuter

quaint mantle
vague swallow
#

How can execute a command?

#

Like how can I let the console execute a command?

vital lotus
#

I just see in the bukkit player class there's sendEquipmentChange,hideEntity,showEntity method,.But when I try to use that, the method isn't exist? (I did try to remove my maven cache)

tardy delta
peak depot
quaint mantle
vague swallow
tardy delta
#

thats like looking at python code for two minutes and after that searching how to become a data scientist

#

anyways

#

you can do it by command

#

lemme search for the code way

vague swallow
#

Ty

summer scroll
vague swallow
quaint mantle
# summer scroll wdym?

You cant use specialsource on gradle, but there's an alternative in gradle by paper. I suggest you using it

pastel arrow
#

i want that when a entity shoots an entity with a projectile, the entity that shot, should be teleported. i have the teleport part but i have problems with the hit listener. is ProjectileHitEvent even the right listener for that?

tardy delta
#

probably

vague swallow
tardy delta
summer scroll
quaint mantle
#

yes

tardy delta
#

just on a itemstack with material itemframe, this refers to plugin's instance

summer scroll
#

how can i use it?

vague swallow
summer scroll
tardy delta
#

it isnt the best code but you should be able to modify it

#

and ItemFrame#setItem(itemstack)

quaint mantle
#

All you do is add paperweight-userdev plugin and in depenencies you write
paperDevBundle("MC version>")
and now you have remapped mojang jar in your classpath

summer scroll
#

idk where is pluginManagement

quaint mantle
#

settings.gradle.kts

summer scroll
#

oh you put that on the settings.gradle

#

what if it's a module?

quaint mantle
#

there should settings in your parent module

vague swallow
quaint mantle
vague swallow
summer scroll
#

when trying to reload the gradle

slim cairn
#

could you explain?

peak depot
#

Hi, I want to try out the new 1.18 spigot version but I dont get any classes like JavaPlugin or CommandExecuter

quaint mantle
#

maybe later

#

google it a bit

#

"how to check hit block spigot"

#

google that

summer scroll
#

the pluginManagement

tardy delta
#

apply the new meta

item.setItemMeta(newMeta);```
summer scroll
# quaint mantle What error
Caused by: io.papermc.paperweight.PaperweightException: paperweight requires a development bundle to be added to the 'paperweightDevelopmentBundle' configuration, as well as a repository to resolve it from in order to function. Use the paperweightDevBundle extension function to do this easily.
summer scroll
quaint mantle
#

well, you need paperweightDevelopmentBundle() in dependencies

summer scroll
#

still i receive error

peak depot
#

Hi, I want to try out the new 1.18 spigot version but I dont get any classes like JavaPlugin or CommandExecuter

summer scroll
quaint mantle
#

everything fine with settings

summer scroll
#

and that's the build.gradle from the child module

tardy delta
#

does anyone knows where player's metadata is stored?

#

.dat files?

young knoll
#

yes

quaint mantle
#

Metadata does not persists

peak depot
quaint mantle
#

if you are about bukkit one

tardy delta
young knoll
#

Yeah that doesn't persist

quaint mantle
vague swallow
quaint mantle
peak depot
tardy delta
#

whats the errror?

quaint mantle
#

oh

summer scroll
tardy delta
coral bobcat
#

Can anyone recommend a good tutorial to learn java if you already know similar languages?

vague swallow
quaint mantle
vague swallow
#

But it's still underlined, without the comma

quaint mantle
#

Yed

summer scroll
#

both gives me error

quaint mantle
#

May you resend build.gradle

summer scroll
quaint mantle
#

Aha

#

same error?

summer scroll
#

yes

chilly pike
#

From a BlockBreakEvent of a container (e.g. a chest) is there a way to prevent the drop of the actual container item, but allow the loot it contains to drop normally?

#

Previously I had used event.setDropItems(false) and that used to only cancel the drop for the container item. Somehow there has been an API change because this does not work anymore. It now cancels all drops, including the container content.

young knoll
#

Iterate over the inventory and drop each item

chilly pike
#

Right, so you suggest to still setDropItems(false) and handle the dropping manually?

#

that could work

young knoll
#

Yes

blazing scarab
#

well i get those suggestions when i type paper

quaint mantle
#

ah

summer scroll
#

i don't have that suggestion at all

blazing scarab
#

because not using kotlin dsl 😎

quaint mantle
#

try cloning paperweight test plugin and see if it works

left swift
#

is it possible to use custom nms biomes in world generation?

ember estuary
#

How can i do this ((CraftPlayer) player).getHandle().b.sendPacket(p); using Reflections?

Class<?> craftPlayerClass = Class.forName("org.bukkit.craftbukkit."+ getServerVersion() +".entity.CraftPlayer");
craftPlayerClass.cast(player).getClass().getMethod("getHandle").invoke(null).getClass().getField("b").getClass().getMethod("sendPacket").invoke(p);

I got this so far, but it says Cannot resolve method 'sendPacket'

peak depot
#

Hi, I want to try out the new 1.18 spigot version but I dont get any classes like JavaPlugin or CommandExecuter

rough basin
#

Is it possible for a player or individual Entity to have some sort of "List" like a scoreboard?

ember estuary
#

just make a hashmap mapping each player to a list

quaint mantle
ember estuary
#

the b?

#

what to do about that?

#

so u cant use reflections when its obfuscated?

quaint mantle
#

you can

ember estuary
#

so what am i doing wrong

quaint mantle
#

but you have to find out obfuscated names

ember estuary
#

((CraftPlayer) player).getHandle().b.sendPacket(p); <- this works fine

#

why would i need different names when doing the reflection

quaint mantle
#

oh

#

you also need to define parameter types

ember estuary
#

alright, gotta look that up xD

coral bobcat
#

but i figured just writing own plugins and googling as problems arise is a neat tutorial for me as well. Just worried i might do something that compiles, but is fundamentally wrong from a design perspective

chrome beacon
#

C# is very close

ancient plank
#

c++ is fun

quaint mantle
#

literally a microsoft java

chrome beacon
ancient plank
#

grrrr

coral bobcat
#

Yes i felt pretty much at home with java at once

ancient plank
#

c#'s naming conventions make me wanna kermit unfunny jokes

#

thankfully vs autoformats the brackets for me else I'd never get those down

coral bobcat
#

at least it has naming conventions… looking at php 🙂

ancient plank
#

the fact that its convention to put a space between if and the () bois is annoying

coral bobcat
#

I have JetBrains to handle conventions 🙂

chrome beacon
#

I just use Java and the Spring framework instead of PHP

ember estuary
#

@quaint mantle
So I do this .getMethod("getHandle", String.class), but then how can I call it?
StackOverflow says i must pass an instance, but I don't know of what. Do they mean like this? .invoke(craftPlayerClass, (Object) null) ?

quaint mantle
#

you dont

coral bobcat
quaint mantle
#

i dont think getHandle needs a String

peak granite
#

how would i add something to a list variable

ember estuary
#

it needs a null?

peak granite
#

CommandSender

quaint mantle
ember estuary
#

but it has no parameters

quaint mantle
#

it literally has no parameters

ember estuary
#

oh so i dont need to declare a type there

#

So the Method needs a Packet<?>, but how do i do that, Packet.class doesnt seem to do the trick

quaint mantle
#

why

ember estuary
#

.getMethod("sendPacket", Packet.class)

quaint mantle
#

Class.forName moment

tardy delta
analog fjord
#

Hey, how can I check correctly if player was punched by mob, ...? I want to do nothing if that happens.

young knoll
#

EntityDamageByEntityEvent

analog fjord
#

and about pushing?

tardy delta
#

i want to do nothing uwu

#

i assume you want to cancel the event?

peak granite
#

no

pastel arrow
#

i want that when a entity shoots an entity with a projectile, the entity that shot, should be teleported. i have the teleport part but i have problems with the hit listener. is ProjectileHitEvent even the right listener for that?

tardy delta
#

so block the punch

analog fjord
#

yeah if player is punched or pushed

tardy delta
#

just put event.setCancelled(true)

tardy delta
#
@EventHandler
public void onHit(EntityDamageByEntityEvent event) {
  event.setCancelled(true);
}```
pastel arrow
analog fjord
#

because I mean for example

#

sheep can push you from the position

peak granite
tardy delta
#

pushing is just a hit

#

which gives damage

analog fjord
#

okay

#

so that would solve both things

quaint mantle
#

thats the collision

young knoll
#

Pushing players around is different

quaint mantle
#

that wouldnt

young knoll
#

You can set entities not to collide

tardy delta
#

ah pushing

#

i thought punching

analog fjord
#

i asked for both things 😄

summer scroll
#

@quaint mantle maybe it's only work with kotlin?

tardy delta
#

ah

#

i've the same issue

peak granite
#

kotlin is ew

quaint mantle
tardy delta
#

casting it to a LivingEntity

quaint mantle
#

but kotlin dsl is cooler anyways

tardy delta
#

and disabling collision doesnt seem to work

quaint mantle
#

have you tried building paperweight-test-plugin?

summer scroll
#

can't right now

analog fjord
#

@young knoll, any tips tho?

analog fjord
quaint mantle
summer scroll
#

wdym?

#

what repo

quaint mantle
#

that you've been working with

#

i wanted to clone it and try by myself

summer scroll
#

oh, no it's not public

#

but i can give you access maybe

quaint mantle
#

if you don't mind, ill just try

summer scroll
#

kk, drop github name

analog fjord
#

so anyone knows how to detect if player was pushed by some entity?

summer scroll
quaint mantle
#

m4nya

tardy delta
#

should i save a byte in the player's pdc to indicate if he's vanished or not?

#

instead or saving all the vanished player's uuid in a file?

peak granite
#

no

tardy delta
#

better way?

summer scroll
#

Set maybe

eternal oxide
#

Yes store it in teh players PDC

tardy delta
ember estuary
#

.getMethod("sendPacket", Class.forName("net.minecraft.network.protocol.Packet<?>")) throws a ClassNotFoundException
but
.getMethod("sendPacket", Class.forName("net.minecraft.network.protocol.Packet")) throws a NoSuchMethodException

How can i tell the reflection that its Packet<?> and not Packet ?

eternal oxide
#

its what the PDC is for. Minimal data directly relating to the player

tardy delta
#

ok i'll try

ivory sleet
ember estuary
#

but how do i get it then

ivory sleet
#

you dont

ember estuary
#

sendPacket wants a Packet<?>

ivory sleet
#

or well

ember estuary
#

but the latter throws a NoSuchMethodException

ivory sleet
#

how does the method look inside intellij?

ember estuary
#

public void sendPacket(Packet<?> packet)

digital rain
#

hello people im clueless at this point, what im trying to do is to damage the player again with the same damage as before but 8 ticks later, the event.getdamage is 1.1 but the actual projected damage is 0.1 why is that so, been stuck in this for so long

ivory sleet
#

try with getDeclaredMethod

#

also maybe its obfuscated?

ember estuary
#

isnt that for static stuff

ivory sleet
#

no lol

eternal oxide
ember estuary
#

ok lemme try

#

still java.lang.NoSuchMethodException: net.minecraft.server.network.PlayerConnection.sendPacket(net.minecraft.network.protocol.Packet)

digital rain
eternal oxide
#

getFinalDamage is the actual amount of damage that will be applied

ivory sleet
#

floskater I think that method is obfuscated

ember estuary
#

but ((CraftPlayer) player).getHandle().b.sendPacket(p); works fine

#

(playerConnection is obfuscated, but the sendPacket is not)

#

as far as i can tell

vague swallow
ivory sleet
#

try Arrays.stream(PlayerConnection.class.getDeclaredFields()).map(Field::getName).forEach(System.out::println)

#

or smtng and see if it'd print 🤷

quaint mantle
#

run getDeclaredMethods on location and see toString output

tardy delta
young knoll
#

sendPacket is a spigot mapping iirc

rough basin
#

When the server is shut down, what should I do if I want to save the plugin's data?

young knoll
#

Save it to a file or database

tardy delta
#

write it down on a noteblock

#

😄

digital rain
#

@eternal oxide no as it seems thats not a problem, its still doesnt work

#

it almost feels like smth in other classes is messing with it but i have no idea what

spiral light
ivory sleet
#

I mean it can?

ember estuary
#

True, seems to be obfuscated, i cant find it

vague swallow
ember estuary
#

but in intellij, it isnt

#

i'll just use a then i guess?

#

and pass (GenericFutureListener) null myself

undone axleBOT
ivory sleet
#

sure floskater

vale ember
#

can someone help, when i am trying to create gradle project with intellij and java 17, it says 'Cannot find supported gradle version for java 17, do you want to continue with gradle 6.8?', i have gradle 7.3 install via snap

ivory sleet
#

or find which method it is

ember estuary
#

but how

#

how can i find the methods obfuscated name

digital rain
spiral light
ember estuary
#

every

#

1.17 +

spiral light
#

https://timcloud.ddns.net/mapping/
made this for 1.18 ... should be 99% correct translation between mojang <-> obfuscated <-> spigot (but spigot just renames the class and not the methods/variables)

ivory sleet
#

Arrays.stream(PlayerConnection.class.getDeclaredMethods())
.map(Method::getName)
.filter(m -> {
return m.getReturnType() == void.class && m.getParameterTypes().length == 1 && m.getParameterTypes()[0] == Packet.class;
})
.forEach(System.out::println)

#

I think

ember estuary
#

without the map

analog fjord
#

so anyone knows how to detect if player was pushed by some entity? please?

ivory sleet
#

oh yeah right lol

#

apply map after the filter

ember estuary
#

alright :D

ivory sleet
#

hopefully you should get 1 result

ember estuary
#

the result is a

#

weird

#

xD

#

so my a isnt actually a then

ivory sleet
#

uh well then use
.getMethod("a", Class.forName("net.minecraft.network.protocol.Packet"))

#

:p

ember estuary
#

xD

spiral light
#

you want to get a method in PlayerConnection that sends a packet ?

ember estuary
#

yea

#

using reflection

spiral light
#

why reflection?

ember estuary
#

so my plugin works on every version