#help-development
1 messages · Page 1626 of 1
use <=
since you're inside the player its 0 block difference
so < is always false
its usually Double.MAX_VALUE
?
How to get all mobs (including hostile) to run away from the player, Kinda Like when you hit a passive mob? is it in Creature Spawn Event or something?
thank you, I will test this later
I'm still have no idea why this isn't working ;-;
there's a separate one for the player, PlayerDropItemEvent
I would need yall's advice
pp
yes, but i also wanted it to do something when a mob dies
for my click detection on my gui, I check if inv title is the same as a certain string, is there any way to prevent a user of simply naming a chest and faking my GUI??
i hate it when i cant read errors bcuz stoopid console spam to fast
logs.....
may have to be two events then
but i just need it for the mobs, and not the player
i put the == instead of != at first by accident, and changed it during the next attempts
oh, well then cancel the event on PlayerDropItemEvent
then do what you want in EntityDropItemEvent
i-i'm trying to cancel it when a mob drops an item
im so confused lol
so then just cancel it in EntityDropItemEvent, as im pretty sure that doesn't apply to players
no need to check if it's a player
that's pretty much what i'm trying to do but it doesn't work or output anything, also, i'm pretty sure players would trigger it as well since they're entities
right now you are testing if the entity is a player, if you want it to apply to all mobs, remove that check
i want it to apply only to non-player mobs*
yeah so you wouldn't need any check, just cancel the event
EntityDropItemEvent does not apply to players
that's why theres PlayerDropItemEvent
mmmmkay give me a second
public class EntityDropItem implements Listener {
@EventHandler
public void onEntityItemDrop(EntityDropItemEvent event) {
System.out.println(1);
event.setCancelled(true);
//if(event.getEntityType() != EntityType.PLAYER) {
// event.setCancelled(true);
//}
}
}
revised version
that should work
I wonder if there is any way to create a generic instance dynamically
annnd still nothing ;-;
is your jar compiling right?
not even an output?
just use PlayerDropItemEvent
no output, and i'm pretty sure i compiled it right
i tried EntityDropItem it didnt work for players for some reason
- was making an anti-dupe button
that's not what he wants though
and i'm only trying to get it for mobs and not players
ohhhh sorry
i only saw the code on phones
i'll stfu lol
I think the problem is his listener doesnt work at all
it's alri
i c
he did register it, so im not quite sure
mind if i uhhh try screensharing in a vc while deafend if it might help?
you cant
oh, nvm then
Does anyone konw if there is any way to create a generic instance dynamically?
like reflection?
yes
(MyObject) myObject.getClass().getDefaultConstructor().newInstance(args)
look through here
Sorry, my question is not very accurate. But I googled it and they say generics are a compile-time only feature. So i guess i cant do it.
[20:24:21 ERROR]: Could not load 'plugins/AbsenceBasics-1.0.jar' in folder 'plugins'
org.bukkit.plugin.InvalidPluginException: java.lang.UnsupportedClassVersionError: dev/bunk/absence/AbsenceBasics has been compiled by a more recent version of the Java Runtime (class file version 53.0), this version of the Java Runtime only recognizes class file versions up to 52.0
how to fix thdsi
i am
Evidently not
r
what is the difference between player.getName() and player.getDisplayName()?
UGH
getName is the players actual name. getDisplayName can be modified and is used in chat
aight, better to use getName() instead
dont use getDisplayName() if ur gonna use it for data storage purposes
if im correct
yes
yeah thats my main identifier
for my plugin
ik that players can change their username
which messes everything up
far
[20:48:51 ERROR]: Could not load 'plugins/AbsenceBasics-1.0.jar' in folder 'plugins'
org.bukkit.plugin.InvalidPluginException: java.lang.UnsupportedClassVersionError: dev/bunk/absence/AbsenceBasics has been compiled by a more recent version of the Java Runtime (class file version 53.0), this version of the Java Runtime only recognizes class file versions up to 52.0
at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:133) ~[patched.jar:git-PaperSpigot-"4c7641d"]
at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:331) ~[patched.jar:git-PaperSpigot-"4c7641d"]
at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:254) [patched.jar:git-PaperSpigot-"4c7641d"]
at org.bukkit.craftbukkit.v1_8_R3.CraftServer.loadPlugins(CraftServer.java:293) [patched.jar:git-PaperSpigot-"4c7641d"]
at net.minecraft.server.v1_8_R3.DedicatedServer.init(DedicatedServer.java:202) [patched.jar:git-PaperSpigot-"4c7641d"]
at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:563) [patched.jar:git-PaperSpigot-"4c7641d"]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_292]
Caused by: java.lang.UnsupportedClassVersionError: dev/bunk/absence/AbsenceBasics has been compiled by a more recent version of the Java Runtime (class file version 53.0), this version of the Java Runtime only recognizes class file versions up to 52.0
at java.lang.ClassLoader.defineClass1(Native Method) ~[?:1.8.0_292]
at java.lang.ClassLoader.defineClass(ClassLoader.java:756) ~[?:1.8.0_292]
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) ~[?:1.8.0_292]
at java.net.URLClassLoader.defineClass(URLClassLoader.java:468) ~[?:1.8.0_292]
at java.net.URLClassLoader.access$100(URLClassLoader.java:74) ~[?:1.8.0_292]
at java.net.URLClassLoader$1.run(URLClassLoader.java:369) ~[?:1.8.0_292]
at java.net.URLClassLoader$1.run(URLClassLoader.java:363) ~[?:1.8.0_292]
at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_292]
at java.net.URLClassLoader.findClass(URLClassLoader.java:362) ~[?:1.8.0_292]
at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:102) ~[patched.jar:git-PaperSpigot-"4c7641d"]
at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:87) ~[patched.jar:git-PaperSpigot-"4c7641d"]
at java.lang.ClassLoader.loadClass(ClassLoader.java:418) ~[?:1.8.0_292]
at java.lang.ClassLoader.loadClass(ClassLoader.java:351) ~[?:1.8.0_292]
at java.lang.Class.forName0(Native Method) ~[?:1.8.0_292]
at java.lang.Class.forName(Class.java:348) ~[?:1.8.0_292]
at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:65) ~[patched.jar:git-PaperSpigot-"4c7641d"]
at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:129) ~[patched.jar:git-PaperSpigot-"4c7641d"]
... 6 more
i cant IFX it
you using maven?
yes
send pom file
k
?paste
are you building with maven?
yea
it used to wiork
and then i chjanged my code a bit and compiled it again
and then it no work
you're building with java 9
whut shoudl i bne building iwhj
8
<configuration>
<source>9</source>
<target>9</target>
</configuration>
change that to 8
line 25
OH
i usually just put ${java.version}
but idk why it changed
it will
choco is finally wrong
maybe its because you took so long to send a message
😠
carry me to gc
in InventoryClickEvent is there a method to get the item you are moving if you use number keys?
declaration: package: org.bukkit.event.inventory, enum: ClickType
yeah ik about that, i mean using a number key on an empty slot to bring the item in the corresponding hotbar slot to the slot you clicked
Fuck gradle.
verbose = good
Its really not
verbose = more debugabble
thats not debugging
shutup
reading errors
plus, gradle aims to closer to a real language
and in fact, it uses kotlin or groovy
xml is like hell na
c a t g i r l l o v e r
how do i put a player head itemstack as a block in the world?
is that what you always resort to when you dont got anymore reasons
lol
i got more reasons
Mhm
but your simpleton mind is too stupid to recognize the pure intelligence of my being
you incapable nincompoop
nope
Did someone say cat girls
when u make an interactive book does ClickEvent.Action.RUN_COMMAND make player send command or does it make console send command?
k
It's sent by the player, yes
It was the whole reason Mojang added /trigger
Nah, I'm not even GC atm. I haven't played much rank. I think I finished at C3 again
I just don't care about ranked at all
Played to get my rewards then stopped playing. I really only play with my buddy, that's about it
Garbage collection?
just git gud
Hi, do a serializable class would be serialized automatically if I just put a map containing the serialized object into an YamlConfiguration?
Like Map<String, MySerializedObject> would it be all serialized ?
if it implements configurationserializable it needs a deserialise method
serialized** sorry ^^'
that can be a declared method or a constructor accepting a map<string, object>
I am C3 too I am too lazy to grind...
wanna play
Sure?
i mean its almost the end of the season
if the object implements configurationserialisable yes
@worldly ingot surely team of 3
add me on epic imajindevon kbm
ok!
Nice, thanks for the info ^^
Yeah sure why not. I guess so. I don't know what rank I'm at atm
I haven't played in like a month so may not be c3 lol
We got this!
Now, if I want to get all the data at once, like, My: data: is: here, would it be myYamlConf#get("") ?
And, would it be deserialized ?
Hello, I couldn't find anything for this online:
Is there a way to make it so that mobs like zombies or skeletons don't drop their armor when they die?
Just clear the drops from them
How?
If I'm correct, you just listen to the death of the entity and clear the drops
Alright
Thank you!
@opal sluice I used EntityDeathEvent and e.getDrops().clear();, but that seems to clear all drops (not just the armor). How can I clear only the armor?
Caused by: java.lang.NoSuchMethodError: org.bukkit.inventory.meta.BookMeta.spigot()Lorg/bukkit/inventory/meta/BookMeta$Spigot;
get the drops
y no method
loop through them and check the item material
Use an iterator btw and then iterator#remove() to remove the actual drop
Looks like you can't
He maybe use some nms to make it working, or the spigot lib could be changed in 1.8, anyway, we don't really support outdated versions ^^'
Something like this?
public void onEntityDeath(EntityDeathEvent e) {
List<ItemStack> drops = e.getDrops();
for (drop : drops) {
if(drop == Material.LEATHER_BOOTS) {
drops.remove();
}
}
}
(sorry I'm really bad at coding but I need this for my server)
You'll have a concurrent modification exception here
Modifying the actual list while looping it
You can modify safely the list with an iterator
Maybe you can use List#removeIf in this case.
That could also work
I'll try the removeIf and google the syntax
public void onEntityDeath(EntityDeathEvent e) {
List<ItemStack> drops = e.getDrops();
drops.removeIf(n -> (n.getType() == Material.LEATHER_BOOTS));
}
this could work
i have an item with a ton of color codes and all in its name, how do i get the item name without the color codes in it?
ChatColor#stripColor
yo, how can I execute a command as a player? player.performCommand isn't working..
It simply does nothing, nothing in console or anything
spawnPacket.getIntegers().write(0, 1).write(1, 1)
Im using protocolLib to spawn an armorstand. but it spawned a potion particle Effect. no matter what number i set to entitytype(field index is 1)
btw im in 1.16
this channel is dead
it works
your code must be failing leading up to that point
send code
its messy but this is the code: https://pastebin.com/RSXSi1wf
send code
you arent registering the command
hm?
getCommand("gmc").setExecutor(new GMC(this));
Also, the check if the command name matches "gmc" is useless.
This isn't working sadly
@EventHandler
public void onEntityDeath(EntityDeathEvent e) {
if (e.getEntity().getType() == EntityType.ZOMBIE || e.getEntity().getType() == EntityType.SKELETON) {
List<ItemStack> drops = e.getDrops();
List<String> armortypes = (List<String>) AdvancedSpawnersFix.plugin.getConfig().getList("armor-types");
drops.removeIf(n -> (armortypes.contains(n.getType())));
}
}
Config
armor-types:
- "LEATHER_BOOTS"
- "LEATHER_LEGGINGS"
- "LEATHER_CHESTPLATE"
- "LEATHER_HELMET"
- "IRON_BOOTS"
- "IRON_LEGGINGS"
- "IRON_CHESTPLATE"
- "IRON_HELMET"
- "GOLDEN_BOOTS"
- "GOLDEN_LEGGINGS"
- "GOLDEN_CHESTPLATE"
- "GOLDENt_HELMET"
- "CHAINMAIL_BOOTS"
- "CHAINMAIL_LEGGINGS"
- "CHAINMAIL_CHESTPLATE"
- "CHAINMAIL_HELMET"
Anything I did wrong?
n.getType().name()
Am I replacing that in the if statement?
just remove the 2nd entirely
place this getCommand("gmc").setExecutor(new GMC(this));
in your onenable
Thank you, this worked super well
hey, another quick question, should i use the linked s to do color codes?
Would i place that as the string in sender.sendMessage?
yes
try getEntityTypeModifier() and worked. Why protocol wiki says it is a VarInt ...
Can you make player wear helmets with packets and keep track of the helmet, so you can remove it later on.
I want to force the player to wear a helmet whereas they can still equip/unequip helmet on their helmet slot freely.
you mean let a player wear two helmet at the same time? or just render a fake helmet and wear a true helmet? both i think is not possible
Something like that yeah, so just a visual helmet, not actually an helmet.
But I want them to wear them at the same time.
maybe, you can let player put their own helmet in somewhere else and read its property , then apply it to player. but i think you cant let the client render two helmet at same time
Yeah I want to force them using a helmet with custom model data.
Ah, what If player wears netherite helmet and I force them to use the custom helmet that I want but the netherite helmet effect still applies.
So the actual helmet is netherite but the visual is the custom helmet.
I've seen a plugin on spigot do this I think.
Maybe player equipped a helmet A ,then he has a helmet B in hand then dosothing,u remove the helmet in hand & set the helmet A's CustomModelData
I don't want to actually change player's helmet, just the visual.
Wow that's great
I will see the sourcecode
Yeah, u found the better way
how 2 make player play fart sound?
Yeah they use packet, it's not complicated as I thought xd, just entity equipment packets.
Can you get a player from a uuid?
declaration: package: org.bukkit, class: Bukkit
it is most likely not able to be done async just saying
No need to do it async anyways xd
how come 2+ classes cause my plugin to stop workingh?
so Im guessing if I did it async i'd just get a null pointer
How can i remove all ai from a mob
u mean setNoAI()? Or remove all pathfinder?
What's the error?
it doesnt
fixed it, was an issue in plugin.yml
also, is there a way i can run a command like summon without it saying anything in chat?
like no "Object successfully summoned."
You might want to create the your own command I think.
simple or no?
Just summoning an entity is simple.
ah, im quite new to this so how would i do it?
Is there a function to make a LivingEntity invisible? If not how would one
do you know how to create a command?
https://www.spigotmc.org/wiki/create-a-simple-command/ I think this is a good way to start if you don't know how to make a command
I know how to listen, but i don't know how to summon an entity
And you can use World#spawnEntity() to summon
Alright, thanks ^^
oh also, how can i set the location of the summoned entity to @a?
would i need another variable?
You mean the player that ran the command?
or like whats @a
how do you get the amount of damage an item deals, i have p.getItemInHand()
stop using 1.8 spigot it sucks
all players at the same time
how do you get the amount of damage an item deals tho
You can
first
Use nms
you need to STOP. USING. 1.8. SPIGOT.
it is literally the ABSOLUTE WORST thing possible thing that you can do
Iterate through all the players then spawn the entity at their location
Simplified
nothing grinds my gears more than 1.8 spigot
Anyway does anyone know how can make an entity invisible?
Like should i use potion effects
World.spawnEntity(allplayerlocations,"LightningBolt"); how can i put it in this?
as an example
You cant
oh?
can you send a script? im pretty stupid ;-;
Im pretty sure spoonfeeding isnt allowed
Do you know java btw?
If not a reccomend learning it better before trying to make a plugin
i guess i could write some pseudo code of thats what its called
for player in players
World.spawnEntity(player.location,entity)
pretty simple
Anyway does anyway know how to make a mob invisible :pepehands:
how to use protocolLib to send a Entity_Metadata packet? I dont know how to write the entity metadata.
LivingEntity.setInvisible?
Dont think that exists in 1.8 
Can we have it so thread owners don't have a cooldown on replies on SpigotMC web site?
yes boosting was worth it 
why here lmao
Not sure this is the right channel
just create a suggestion on the forum
It makes it really hard to respond to queries on a plugin.
@worldly ingot who is responsible for Spigot website development?
oh god, pinging Choco
can I PR a fix for it?
Create a suggestion bro
How do i send packets to players?
oh is cindy still doing?
You need to use the build tools, and use PlayerConnection#sendPacket
yeah i was already using the version with nms and thanks
anyone know it? I found an example and it use an actually entity on serverside, but I need to modify a fake armorstand
idk how to do it on protocollib, sadge
an example without protocollib is okay, i think
PacketPlayOutEntityMetadata metaDataPacket = new PacketPlayOutEntityMetadata(entityID, dataWatcher, false);
playerConnection.sendPacket(metaDataPacket);
also required to use the nms version/buildtools
got it, I need to learn about datawatcher first
Ok so i am using the giant to make a big sword for something, how can i make it so this giant cant be attacked and doesnt move at all
quick question, how can i get the location of the first argument as a player?
you want a players location?
I dont really get the question
i want to save a players location to a var, and the player is an arggument from a command
Can i have more context
sorry if im typing slow, i have a broken arm
I'm guessing he want a Player object from String.
the player is the first(i think) argument, like: /spawnzombie (this is the location i want, as a player)
as an example
Also i was wondering if anyone had any idea if i could make a mob be unable to be moved by a palyer
NoAI:1b or whatever?
packet
but thats not just player
Invulnerable and collission?
Theres a collision event?
I think there is like a collission variable or something, to make the mob collide with something.
how can i save the first argument as a player?
Bukkit#getPlayer(String)
oh?
args[0] is the first argument
mybe thats what im doing wrong
ssssssssssssssssssssssssssssssssssssssssssssssssssspigotmc
So no luck for 1.8? 
/command arg0 arg1
in 1.8 there is no collission, so just make the entity invulnerable.
really?
nop
i think that may have fixed it
alright then, i don't know xd
alr time to do some intense googlin
im just testing it
maybe cancel the damage event or something
ayy! it works, tysm, that was me being stupid
I already did that it just still can get pushed around
how's the entity being pushed?
which ruins the sword position
but there is no colission
Is there a channel i cans end videos in?
you need to be verified to send a picture/video
anyway i dmed it to you
yeah i saw it
any ideas?
i have one but this is like whatever idea
yo, how come EntityType.LIGHTNING isn't working?
constantly checking the entity location, and teleporting them if the location does not match
World#strikeLightning or World#strikeLightningEffect
Alrrighty
Any way for me a stop a repeating task inside itself?
is BukkitRunnable exist on 1.8?
yeah
use that, BukkitRunnable can cancel itself
Doesnt work, do i need to include something? (strikeLightning cannot be resolved or is not a field)
same for both of them;
wait just wondering do you think this could work
var timesRan = 0
var taskId = 0
taskId = Bukkit.getScheduler().scheduleSyncRepeatingTask(SkyblockSandbox.instance, {
if(timesRan==30){
Bukkit.getScheduler().cancelTask(taskId)
}
timesRan++
},0,2)
show your code
you can test it out, i never do something like that
i just dont wanna use a bukkit runnable because a dont feel like making a class :p
you don't need to
nevermind, i.getWorld().strikeLightningEffect(i.getLocation()) seemed to work for some reason
World.strikLightning probably isnt in your version
or smth like that
anyway how would i use bukkit runnable without a class?
1.8.8?
new BukkitRunnable(){
@Override
public void run(){
if location is not the same:
teleport the entity back
if time equals to 30
this.cancel();
}
}.runTaskTimer(...
thanks again 
no problem
Also just did some research and the only way to make invulnerability in 1.8 is with nasty nms
public void setInvulnerable(Entity en){
net.minecraft.server.v1_8_R2.Entity nmsEn = ((CraftEntity) en).getHandle();
NBTTagCompound compound = new NBTTagCompound();
nmsEn.c(compound);
compound.setByte("Invulnerable", (byte) 1);
nmsEn.f(compound);
}
Is Invulnerable just make the entity cannot take any damage?
And player will still be able to collide with it.
how can i get the seconds since the server start, or the current timestamp in seconds, or whatever thing to calculate timing stuff? whats the proper way
@Command(
aliases = {"test"},
permission = "discordlink.test"
)
public class CommandTest {
@Default
public void test(CommandSender sender, boolean bruh, @Choice({"hi"}) String bruh2, PlatformPlayer player) {
sender.sendMessage(bruh2);
sender.sendMessage(String.valueOf(bruh));
}
@Command(aliases = {"sub"})
public void sub(CommandSender sender, @Choice({"yes", "no"}) String choice) {
sender.sendMessage("You said " + choice);
}
}
made my own command framework type thing with autocompletion built in, AND a brigadier implementation for fabric
Only one level of command nesting unfortunately tho
Not sure if theres a built in function but you can set a timestamp in your plugins onEnable then compare it to System.currentTimeMillis
cool is it public?
It will be soon, atm its part of my plugin DiscordLink
Which is on github
need to split it into its own thing
It mainly just exists for the pure reason of well... i want my plugin to work on fabric which uses brigadier instead of default commands (which is a lot harder to code for so i use annotations)
what package is it in?
Im about to push an update but theres a separation. The platform agnostic stuff is in com.github.riku32.discordlink.core.platform.command
The actual implementation in spigot for it to be used in commands is in com.github.riku32.discordlink.spigot.SpigotCommand
the spigot command is one class that gets dynamically registered using this ```java
private void registerDynamicCommand(String name, Command command) {
String bukkitVersion = getServer().getClass().getPackage().getName();
try {
Class<?> clazzCraftServer = Class.forName("org.bukkit.craftbukkit." + bukkitVersion.substring(bukkitVersion.lastIndexOf('.') + 1) + ".CraftServer");
Object craftServer = clazzCraftServer.cast(getServer());
Object commandMap = craftServer.getClass().getDeclaredMethod("getCommandMap").invoke(craftServer);
Map<String, Command> knownCommands = (Map<String, Command>) commandMap.getClass().getDeclaredMethod("getKnownCommands").invoke(commandMap);
knownCommands.put(name, command);
} catch (ClassNotFoundException | IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException | SecurityException e) {
e.printStackTrace();
}
}
@Override
public void registerCommand(CompiledCommand compiledCommand) {
Arrays.stream(compiledCommand.getBaseCommand().getAliases())
.forEach(name -> registerDynamicCommand(name, new SpigotCommand(name, compiledCommand, this, commandLocale)));
}
Works with most versions so dw
that seems pretty jank but what works works lol
You might need to modify it to suit your needs a bit tho
idk tho im pretty dumb
Yeah those methods are generally only there since spigot wants you to define commands in plugin.yml
this is a workaround
everything else is pretty clean tho
although
i might yoink that
because
i have been wanting
to make a custom command handler
but the plugin.yml thing
Beware it does not register CommandExecutor it uses the base Command class which is a little different (mostly the same tho)
has been screwing it up for me
ill take a look at yours and maybe make my own version for my needs 
thanks, atm the commands are kinda packed using CompiledCommand so that does error checking when the command is created.
So the SpigotCommand implementation just validates that all args are accounted for and beware, EVERYTHING is required
you cant have an optional argument for a command
You can have a Choice but that makes sure the response is at least in that list
I need to add @Optional later
so yeah if someone types an invalid reply it will just send them a "invalid arg lol"
when i make the fabric impl it will use brigadier so it just wont have error messages ig
wait a second your making a plugin that has the same jar for a fabric server and spigot?
thats pretty cool
Well no it has a Spigot and Fabric jar that essentially provide adapters for core
the core contains the main logic and code and i only write what is in core once
Spigot registers implementations for Plugin, Player, and its own Eventbus into templates core provides
and after that it kinda just works
public class JoinEvent {
@EventHandler
private void onPlayerJoin(PlayerJoinEvent event) {
event.getPlayer().sendMessage("Welcome");
}
}
@EventHandler is my own thing i based around spigots
Ah yeah i also really like how spigot manages events basically copied it for one of my projects with a minecraft bot
Anyway this channel is for spigot dev help dont wanna get too off topic
Does anyone know why my entity that im freezing in place by teleporting it to the same location is able to turn its head
i thought location stored yaw and pitch so if im teleporting it to the same location everyh tick
thats so wierd
So they cannot move?
Nah they arent moving
but they are turning their head
which ruins what im going for
well not head but their whole body
Just try to set the yaw pitch again
wait
actually
i just removed the invisible tag
and it seems that
the body isnt parralel with the head
so it adjusts after
hm
I’m so confused what I’m looking at
making a sandbox version
already made some cool stuff 😄
thanks
uh its an upside down giant turning its head when it shouldnt .w.
how 2 add 1.8 to maven
bcuz itkeep saying MUSHROOM_SOUP no work
but 1.8
work
sop hwop to do
try MUSHROOM_STEW
instead of stoup
soup
but its SOUP on 1.8
well show me your spigot dependency in maven
why is my plugin not making a file if it does not exist? Code: https://pastebin.com/F9SrAUmC
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
[17:20:17 WARN]: at java.base/java.io.FileInputStream.open0(Native Method)
[17:20:17 WARN]: at java.base/java.io.FileInputStream.open(FileInputStream.java:211)
[17:20:17 WARN]: at java.base/java.io.FileInputStream.<init>(FileInputStream.java:153)
[17:20:17 WARN]: at org.bukkit.configuration.file.FileConfiguration.load(FileConfiguration.java:126)
[17:20:17 WARN]: at io.github.eddiediamondfire.economyplus.config.file.Config.load(Config.java:50)
[17:20:17 WARN]: at io.github.eddiediamondfire.economyplus.config.FileManager.onLoad(FileManager.java:22)
[17:20:17 WARN]: at io.github.eddiediamondfire.economyplus.EconomyPlus.onEnable(EconomyPlus.java:47)
[17:20:17 WARN]: at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:263)
[17:20:17 WARN]: at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:370)
[17:20:17 WARN]: at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:500)
[17:20:17 WARN]: at org.bukkit.craftbukkit.v1_17_R1.CraftServer.enablePlugin(CraftServer.java:518)
[17:20:17 WARN]: at org.bukkit.craftbukkit.v1_17_R1.CraftServer.enablePlugins(CraftServer.java:432)
[17:20:17 WARN]: at net.minecraft.server.dedicated.DedicatedServer.init(DedicatedServer.java:277)
[17:20:17 WARN]: at net.minecraft.server.MinecraftServer.x(MinecraftServer.java:1126)
[17:20:17 WARN]: at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:316)
[17:20:17 WARN]: at java.base/java.lang.Thread.run(Thread.java:831)
[17:20:17 ERROR]: Error occurred while enabling EconomyPlus vdev-SNAPSHOT (Is it up to date?)
java.lang.NullPointerException: Cannot invoke "String.equalsIgnoreCase(String)" because the return value of "org.bukkit.configuration.file.FileConfiguration.getString(String)" is null```
at io.github.eddiediamondfire.economyplus.EconomyPlus.onEnable(EconomyPlus.java:51) ~[?:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:263) ~[patched_1.17.1.jar:git-Paper-112]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:370) ~[patched_1.17.1.jar:git-Paper-112]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:500) ~[patched_1.17.1.jar:git-Paper-112]
at org.bukkit.craftbukkit.v1_17_R1.CraftServer.enablePlugin(CraftServer.java:518) ~[patched_1.17.1.jar:git-Paper-112]
at org.bukkit.craftbukkit.v1_17_R1.CraftServer.enablePlugins(CraftServer.java:432) ~[patched_1.17.1.jar:git-Paper-112]
at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:277) ~[patched_1.17.1.jar:git-Paper-112]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1126) ~[patched_1.17.1.jar:git-Paper-112]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:316) ~[patched_1.17.1.jar:git-Paper-112]
at java.lang.Thread.run(Thread.java:831) [?:?]```
How to remove fake players only on the tablist?
what kind of damage fireball does? entity explosion, block explosion or somethinfg else?
debug and you'll got the answer easily
why TF is this not working?
ArmorStand stand = (ArmorStand) p.getWorld().spawnEntity(p.getLocation(), EntityType.ARMOR_STAND);
no errors or anything
It works for me normally
lmao
private ArmorStand createArmorStand(Location started) {
ArmorStand armorStand = (ArmorStand) started.getWorld().spawnEntity(started, EntityType.ARMOR_STAND);
armorStand.setVisible(false);
armorStand.setGravity(false);
return armorStand;
}
in my current project ^^
Hey there
I have a problem with Destroy Entities packet, which got changed in 1.17 to Destroy Entity pakcet and then it revert back to Destroy Entities packet in 1.17.1
I'm using protocollib for writing the packets and I made a function to determine if it's 1.17 or not
public void destroy() {
PacketContainer destroyEntityPacket = new PacketContainer(PacketType.Play.Server.ENTITY_DESTROY);
if (Utils.is1_17) {
destroyEntityPacket.getIntegers().writeSafely(0, entityID);
} else {
destroyEntityPacket.getIntegers().writeSafely(0, 1);
destroyEntityPacket.getIntegerArrays().writeSafely(0, new int[]{entityID});
}
try {
ProtocolLibrary.getProtocolManager().sendServerPacket(handler, destroyEntityPacket);
} catch (Exception e) {
e.printStackTrace();
}
}
but the problem is, it doesn't work on 1.17.1
even thou according to wiki.vg/Protocol, it is back again to what it used to be in 1.16.5, it doesn't destroy the entity and also it doesn't log any errors.
I also tried using 1.17 method in 1.17.1, it still doesn't work
I'll try this
not working
does the fact I'm using 1.8 change it at all?
bruh wtf is wrong with your server
no
it works on 1.8
add a sysout to check it actually gets called
mb I can try on my other test server
public void gameEnd(Team winner, EndReason reason) {
setFinished();
if (reason == EndReason.TEAM_WIN) {
for (Player pp : Bukkit.getOnlinePlayers()) {
pp.sendTitle("" + ChatColor.RED + ChatColor.BOLD + "GAME OVER!", ChatColor.GRAY + winner.name() + " has won!");
inventoryManager.setDeadFinishedInventory(pp);
SqlSetup.updateInt(pp.getPlayer().getUniqueId(), "losses", SqlSetup.getPlayerInt(pp.getPlayer().getUniqueId(), "losses") + 1);
SqlSetup.updateInt(pp.getPlayer().getUniqueId(), "winstreak", 0);
}
getPlayersInTeam(winner).forEach(p -> {
p.getPlayer().sendTitle(
"" + ChatColor.GOLD + ChatColor.BOLD + "VICTORY!", ChatColor.GRAY + "Your team won the game!");
||||||||||||||||||||||SqlSetup.setPlayerXP(p.getPlayer().getUniqueId(), SqlSetup.getPlayerXP(p.getPlayer().getUniqueId()) + 200);
SqlSetup.updateInt(p.getPlayer().getUniqueId(), "wins", SqlSetup.getPlayerInt(p.getPlayer().getUniqueId(), "wins") + 1);
SqlSetup.updateInt(p.getPlayer().getUniqueId(), "winstreak", SqlSetup.getPlayerInt(p.getPlayer().getUniqueId(), "winstreak") + 1);
});
} else {
for (Player pp : Bukkit.getOnlinePlayers()) {
pp.sendTitle("" + ChatColor.RED + ChatColor.BOLD + "GAME OVER!", "");
inventoryManager.setDeadFinishedInventory(pp);
SqlSetup.updateInt(pp.getPlayer().getUniqueId(), "losses", SqlSetup.getPlayerInt(pp.getPlayer().getUniqueId(), "losses") + 1);
SqlSetup.updateInt(pp.getPlayer().getUniqueId(), "winstreak", 0);
}
}
new BukkitRunnable() {
@Override
public void run() {
finish();
}
}.runTaskLater(CaptureTheClay.getInstance(), 200L);
}```
why
does the one
?paste
please
with the |s before it
ok
why does the one with |||||||||| before it
get run
like
52387257894235789 times
idk
like instead of changing it by 200
it changes it by like 1 billion
create a method for get wins and get losses
yea i will
same with winstreak
i got a small issue here, when I use breakNaturally() it just acts as if you just set the block type to AIR.. there is no sound or particles
that's kinda how it works iirc
aw really
can anyone help?
whats your issue
.
how do i give a zombie a helmet, or spawn a zombie with a helmet
what was it because im curious :D
CreatureSpawnEvent, get entity and its equipment
tho that will make it so with every spawn egg and natural zombie spawn itll have a helmet
Im almost certain
this is holograms
ooh i have to cast creature to it now ik
Is it true that inventories cannot store air?
np
if I want to make a natural block break I need to set it to air and then do the particles and sound manually?
So air is only for hands?
I don't think you use air with inventories at all
Last time i tried i got a bunch of errors
Well you can get air from entityequipment
better to use null imo
Thats definitely the case
Then yeah
yes
o
whats even the point of the breakNaturally method
Drones
but it is still a WIP
hm yeah "Breaks the block and spawns items as if a player had digged it regardless of the tool."
so i guess there is no mention of an actual particle+sound break
fair enough
thanks
Test it and see
i did already
just sets it to air :(
ill just be lazy and make it do the setblock vanilla cmd
tbh my plugin is doing way better than I expected
the OnceUnCraftable one ?
How can I remove fake player only on tablist?
Send the remove data info packet
Make your life easier by using Citizens no need to reinvent stuff
I don't want to create NPC, just want to create a fake player so I can do something like this
ah then you can't remove it from tab
There is a server called Origin Realms, they can do that.
Player Info Packet maybe?
It will entirely removes the fake player, so the fake player doesn't exist anymore.
I haven't tried, but those online solutions just use it
Maybe something related to the player receiving a player list to display there
Then listen to their packets and see what they do?
how can i see the 1.16 version of protocol wiki?
How would i check for a colon in commands? I use this and it always is true for some reason
it works on commmands
But anyways
Java isn’t indentation based
So that for loop will run regardless if the command contains : or not
oh
i used to do this
with a
prefix
i used asyncchatevent
how do i create a command like /gm <gamemode>
oh i dont think bungeecord has asyncchatevent, thats for bukkit
Compared with direct rotate a real armorstand, using packet to rotate a fake armorstand has obvious lag. is this normal?
https://gyazo.com/dd85becb54f6989b59f3f23ff6c710e0
probs really basic but how do I keep it in one location and not move around. idc about it going into walls just not into the floor or changing side from the right when walking
command then set their gamemode
you should learn day one java before spigot
I want to update my personal Scoreboard every second, is there a good way?
you can do autocompletion via brigadier iirc
nvm
unless you create separate commanddispatcher
that's a lot of work
It's not a command tho.
Hey, how would I call around 1000 fake BlockBreakEvents to the server without any lag.
for a specific player.
I have tried this:
Bukkit.getPluginManager().callEvent(new BlockBreakEvent(loc.getBlock(), e.getPlayer()));
But I get a lot of lag
Might also be worth taking another approval into whatever you are doing
Seems like there is a much better alternative way to do whatever you want todo…
Why
Why are you doing this
That’s probably not api yeah
For a prison plugin, to destroy a whole layer of a mine whilst registering each block broken as a event by the plugin.
Why don’t you add an api to that plugin
Why do you need the plugin signature of that block break
So that it knows who mined them
I presume what you are trying to do is have like an upgrade where you can mine the entire mine?
Yes
If so instead of actually breaking them all, id just get a count of all the blocks in that mine, (material, amount) delete all the blocks and do the math to give the loot rather then using a huge amount of events
My best guess at first glance, might be a better way
Yeah, that's probably a better way tbh
No, it's not.
I mean if it had an api you could probably hook into it
To like add broken blocks
But that is all dependent on it having an api and I doubt it
So probably just use racks way
Have a map of materials as the key and amount as the value.
An enum map I presume
Hi, im new to spigot and i had a question.
get the team you want to update and set the prefix/suffix every second
private Bukkit event;
final Player player = event.getPlayer();
if (event.getAction() == Action.LEFT_CLICK_BLOCK) {
if (event.block().getType() == Material.WEB) {
if (event.getItem() != null && event.getItem().getType() == Material.SHEARS) {```
its all in red
Does someone maybe have an example of this because im trying to learn
java logic is hosted in methods
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
use PlayerInteractEvent https://www.spigotmc.org/wiki/using-the-event-api/
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
are you working on a decompiled class?
and it;s not going to work as you arent working in a method
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
i already did some on the codecademy
dont you just have an example for me of how to use it?
Indy, you need to setup a class that implements Listener, then in that class, create a method that is decorated as an EventHandler. Keep in mind that some events will be called for each hand of the player.
but i dont want a listener
or i mean
i need to but
I dont want anything to be in it
then under that classe, create a method that has the @EventHandler(priority = EventPriority.LOWEST) or similar annotation
the method should have a single parameter that is the kind of event
like BlockDamageEvent
so I have a weirdish question, are chunks actually meant to be able to load twice in a single tick
you can look at the different events in the JavaDocs
public class c4 implements Listener {
@EventHandler(priority = EventPriority.LOWEST)
its not damage event
its block click event
no, like under your c4 class, create a method
can you give me an example?
https://gyazo.com/dd85becb54f6989b59f3f23ff6c710e0
probs really basic but how do I keep it in one location and not move around. idc about it going into walls just not into the floor or changing side from the right when walking
my code: https://paste.md-5.net/vemisetadi.java
I know it's EXTREMELY messy just playing around for now.
I have a world where every chunk on there is loading twice
it seems to just be that one world
public static void onBlockDamage(BlcokDamageEvent event) {
if (event == null || event.isCancelled()) return;
Player player = event.getPlayer();
Block block = event.getBlock);
...
}```
so this has me confused
something like that, doesn't have to be static if you are referencing by class
public static <ApplicableRegionSet, WorldGuardPlugin, ProtectedRegion> boolean playerinRegion(Player var0, String var1) {
ApplicableRegionSet var2 = ((WorldGuardPlugin)Bukkit.getServer().getPluginManager().getPlugin("WorldGuard")).getRegionManager(var0.getWorld()).getApplicableRegions(var0.getLocation());
Iterator<ProtectedRegion> var3 = var2.iterator();
while (var3.hasNext()) {
ProtectedRegion var4 = var3.next();
if (var4.getId().contains(var1))
return true;```
dont work
does location#getBlock() load the chunk the block is in?
can someone please help me
no? thats why i am testing things like this
this is horrendous
and asking for help
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
you are just wasting our time and your own by trying to do this with no understanding
yeh, way above your paygrade
don't try to make a plugin if you don't know java
toxic
how
i've already followed a course
you didnt learn anything then
asking for help != stupid
you're the one who doesn't know how to name a class LMFAO
youre the most toxic kid i've ever seen fucking hypocrit
by asking questions when you don't know java, some people know it and have good questions.
anyway, suggest you try the examples for the event stuff, aside from all the worldguard api stuff
you are the kid here buddy
hm I smell blood in the water
and overall learn java
as the course you used either didnt go into anything or what not
and not get discouraged by folks on this channel
i already expected something like this
and take advantage of the wiki and javadocs
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
some people who get mad because im not good at it
then get good at it before wasting peoples time on dumb basic java
Don’t learn java by jumping into an API
Spending time now to learn the basics of Java and then coming back to the spigot api will help way more then you could imagine
ok, ill just do a course then
You got this Indy!
don't know it at all and trying to make a plugin and expecting people to help*
You will learn and get there just be patient. It takes time 😦
You may have to do the course multiple times so you get a good understanding, or rotate between a few of them
how do i know if im ready to learn spigot
if you feel like you have an understanding of the langunage
i kind of do understand it
when you're sick of it
?
its just different
You need an understanding of methods, fields (vars), classes, lists, maps, etc.
i did courses for like 5 hours
The code is the same just prob a diff IDE
Not even 0.1% of enough
?learnjava has multiple courses
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
A different one might help
It is, its a java library
You will need to learn Java first then come back and learn the spigot library
Which will be 100 times easier with a good java understanding
@torn shuttle loading twice how?
Error: ```java
[15:34:39 WARN]: [Shaza] Task #2 for Shaza v1.0-SNAPSHOT generated an exception
java.lang.NullPointerException: null
at sh.aza.OnJoin$1.run(OnJoin.java:55) ~[?:?]
at org.bukkit.craftbukkit.v1_12_R1.scheduler.CraftTask.run(CraftTask.java:64) ~[patched_1.12.2.jar:git-Paper-1618]
at org.bukkit.craftbukkit.v1_12_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:423) ~[patched_1.12.2.jar:git-Paper-1618]
at net.minecraft.server.v1_12_R1.MinecraftServer.D(MinecraftServer.java:840) ~[patched_1.12.2.jar:git-Paper-1618]
at net.minecraft.server.v1_12_R1.DedicatedServer.D(DedicatedServer.java:423) ~[patched_1.12.2.jar:git-Paper-1618]
at net.minecraft.server.v1_12_R1.MinecraftServer.C(MinecraftServer.java:774) ~[patched_1.12.2.jar:git-Paper-1618]
at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:666) ~[patched_1.12.2.jar:git-Paper-1618]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_291]
Code: ```java
package sh.aza;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.scheduler.BukkitScheduler;
import java.sql.*;
public class OnJoin implements Listener {
private final Main main;
private Connection conn;
private String host, database, username, password;
private int port;
public static ResultSet coin;
public OnJoin(Main main) {
this.main = main;
}
@EventHandler
public void onJoin(PlayerJoinEvent e){
this.host = "localhost";
this.port = 3306;
this.database = "minecraft";
this.username = "root";
this.password = "";
Player p = e.getPlayer();
try {
openConnection();
System.out.println("SUCCESS: Successfully connected to database.");
} catch (SQLException x) {
x.printStackTrace();
System.out.println("ERROR: Couldn't connect to database.");
}
try {
ResultSet rs = prepareStatement("SELECT COUNT(UUID) FROM usercoin WHERE UUID = '" + p.getUniqueId().toString() + "';").executeQuery();
rs.next();
if (rs.getInt(1) == 0){
prepareStatement("INSERT INTO usercoin(UUID, COIN) VALUES ('" + p.getUniqueId().toString() + ", DEFAULT');").executeUpdate();
}
coin = prepareStatement("SELECT * FROM usercoin WHERE UUID = '" + p.getUniqueId().toString() + "';").executeQuery();
coin.next();
} catch (SQLException throwables) {
throwables.printStackTrace();
}
BukkitScheduler scheduler = main.getServer().getScheduler();
scheduler.scheduleSyncRepeatingTask(main, new Runnable() {
@Override
public void run() {
try {
p.sendTitle("", ChatColor.BOLD + "" + ChatColor.YELLOW + "Coins: " + ChatColor.WHITE + OnJoin.coin.getInt("COIN"), 0, 1, 0);
} catch (SQLException throwables) {
throwables.printStackTrace();
}
}
}, 0L, 1L);
}
private void openConnection() throws SQLException {
if (conn != null && !conn.isClosed()){
return;
}
conn = DriverManager.getConnection("jdbc:mysql://" + this.host + ":" + this.port + "/" + this.database, this.username, this.password);
}
public PreparedStatement prepareStatement(String query){
PreparedStatement ps = null;
try {
ps = conn.prepareStatement(query);
System.out.println("SUCCESS: Successfully prepared statement.");
} catch (SQLException x) {
x.printStackTrace();
System.out.println("ERROR: Couldn't prepare statement.");
}
return ps;
}
}
?paste
I tried to make a coin system using databases
.
@regal moat please put it in a paste
chunk load event fires twice for the same chunk in a single tick
Are there spigot api events called when player equip armor using hotkeys
Magma, is this a custom world?
@regal moat the result set seems to be null inside your runnable.
Also I don’t recommend storing that in a static
custom in which sense?
I believe it's a void world and we just built some stuff in it
it's a really inconsistent issue because so far I've only seen it happen to one world
is it possible for someone to please help me
two ChunkLoadEvents or two ChunkEvents?
because a new chunk says it will make a ChunkLoadEvent, then a ChunkPopulateEvent
load events specifically
and they're not freshly generated chunks, these already exsited
any other plugins that could be interfering?
I already removed some of the more suspicious ones so at this stage I am suspecting I might be doing it myself
but at the same time it's incredibly inconsistent and I am treating every chunk load the same
it does it 100% of the time on one world, then never on pretty much every other world I've tested
do you code plugins?
yes, but I'm very expensive.
whatever he's charging I'm charging double
in otherwords, if you are looking for a developer please post in the forums
does somebody code plugins for free?
@torn shuttle How exactly are you interacting with the chunks?
unfortunately, that's been the bane of my existence here
if you would like to donate....
I don't have money
the most "sus" thing I was doing with them was querying block type of a block in a loading chunk
well what good are you then?
but I've delayed the entire event by 1 tick on my end and it's still doing the double loading before I seemingly run any code
I think it's been cosistently on 1.17.1, it's been reported by a few of my users with a spread among at least purpur and paper, I've just noticed the issue now so I've not pinned it on any one specific version
I did review some of the older code and I was always checking for double chunk loading so I am pretty sure this is something I've had to handle since... 1.14?
it's just weird that chunks would allow themselves to be loaded twice in the first place
Could you try checking to see if this behaviour occurs on other spigot versions.
There is nothing we can do about version related bugs except for make a PR and get denied 🙅♂️
cough accepted
I guess the main thing I need to know is whether querying a block in a chunk that is in the middle of loading will cause it to load again
hmm, maybe its designed that way
Do you have the source code anywhere?
yeah but uh, it's fairly extensive
Hello,
meme lovers! I'm trying to remove living entity but it doesn't work.
LivingEntity livingEntity = BossCore.getBoss(player); // get living entity from map.
livingEntity.getLocation().getChunk().load();
livingEntity.remove()``` what's problem? (also, teleport doesnt work)
maybe there is a spigot patch that is calling it to decorate chunks that are generated inside the world constructor
Iirc the reference is lost when the chunk unloads
https://gyazo.com/dd85becb54f6989b59f3f23ff6c710e0
probs really basic but how do I keep it in one location and not move around. idc about it going into walls just not into the floor or changing side from the right when walking
my code: https://paste.md-5.net/vemisetadi.java
I know it's EXTREMELY messy just playing around for now
I dont want it to go up and down or backwards and forwards just side to side and then follow behind
If I recall correctly
yes, but I loaded chunk
The reference is already lost
Store the chunk coords and the entity uuid
Load the chunk and then get entity by uuid
hmm how can I store chunk Coordinates? you said the reference is lost so I can't get chunk with my livingentity
Hash maps owo
ya but my livingentity will move away
I offered 20 for a custom discord bot (and that was VERY generous) and he blocked me instantly
20 is not very generous buddy
20 ETH?
20 btc
eth?
20 pizzas?
20 dollars
disgusting
Shut up
No u owo
...
that's not even 4 beers
Where did that even come from
How can I change a villager's location?
Told you it was generous
teleport them
.
wdym? i am new to java & the spigot api so 😅
kludge I will offer you $-1 to access to your onlydevs
Do I need to do villager#teleport?
Yes
it's where you post raw code, dirtied with copy pasted code, if statements instead of switch statements and everything is static all the time
I recommend to only keep the result set in the same scope as where you declared it.
can I please have help
Ok
https://gyazo.com/dd85becb54f6989b59f3f23ff6c710e0
probs really basic but how do I keep it in one location and not move around. idc about it going into walls just not into the floor or changing side from the right when walking
my code: https://paste.md-5.net/vemisetadi.java
I know it's EXTREMELY messy just playing around for now
I dont want it to go up and down or backwards and forwards just side to side and then follow behind
Zoi you don’t do that based on the player direction
That is where you are doing it wrong to begin with
then what should I do it on?
You do it based on the distance from the player
if no one ever sees the code, does it make a difference?
Make it constantly want to move towards the player and if the distance is less than a certain amount have the armorstand stop moving
aight. Should I use a vector or just set the location to the player?
You are making a pet plug-in I assume?
na just playing with an idea in my head
or that I saw on another server
What is the idea you have?
I can’t help you if I don’t know exactly what you are trying to do
honestly the answer here is just to go look at how vectors work
i mean, if the stuff is utility code, and never instantiate more than one class, what is the point of not using static?
there is only one server, why not make everything static
why not skip oop altogether and go straight to functional coding
https://gyazo.com/9fd305fab527af6f781af0d437f2ebc1 this one is better @native nexus
Oh I see what you are trying todo.
bro why are we even bothering with spigot I'm just going to mod the server jar directly and without telling people I'm modifying it during runtime
what could go wrong anyhow
guys i need help i want to get list of files in the "messages" resource folder to put them in a Map of file name and its content string
You need to understand how vectors work.
ah, but you also have to use self-modifying code to modify the jar
I do
but I just didnt know if I was going off distance or what
dare I say, "string manipulation"
Then why are you updating the y value when that is literally the value you shouldn’t change
actually my code is based on a genetic algorithm, I couldn't be bothered to write good code so I just made it so it keeps creating new instances of itself until it reaches the highest arbitrary score possible
by modifying itself and the server jar
idk just going off what I saw on google for getting on block behind the player lmfao
must be morning, i see light coming through the curtains
i-
hi...
bump~
The player direction is a good start.
- entities aren't necessarily loaded when a chunk loads
- your entity isn't necessarily in there
- you can't guarantee that the chunk is loaded by the time the third line runs
off the top of my head
hmm, this discord server doesn't have threads enabled?
yeh, think the server has to be configured to make it work
Go to bed it’s past all your bedtimes
In 1.16 somehow Location.getChunk().load() produced a NullPointerException.... Anyone know what would cause that?
Not many bots rely directly on the discord rest api but on wrappers which haven’t updated to support threads yet
nah, i'm too wired from rebuilding like 20 plugins


